diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-10 21:02:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-11 11:59:09 -0400 |
commit | a67ef278e24b1fe5ab8f5e8ef27f9654b91732de (patch) | |
tree | dbef61c3226194d95c93105ccb1a83774e74776e /drivers/video/fbmem.c | |
parent | 26c5be3c750df6f8a9193d478905627ec75f7f41 (diff) |
drivers/video/fbmem.c: simplify strlen()==0 check in fb_get_options()
Replaced !strlen(str) check with !str[0]. Removed the variable which was
used solely to store strlen result.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r-- | drivers/video/fbmem.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 731fce64df9d..a8500c61bb16 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -1786,7 +1786,7 @@ static int ofonly __read_mostly; | |||
1786 | int fb_get_options(char *name, char **option) | 1786 | int fb_get_options(char *name, char **option) |
1787 | { | 1787 | { |
1788 | char *opt, *options = NULL; | 1788 | char *opt, *options = NULL; |
1789 | int opt_len, retval = 0; | 1789 | int retval = 0; |
1790 | int name_len = strlen(name), i; | 1790 | int name_len = strlen(name), i; |
1791 | 1791 | ||
1792 | if (name_len && ofonly && strncmp(name, "offb", 4)) | 1792 | if (name_len && ofonly && strncmp(name, "offb", 4)) |
@@ -1796,8 +1796,7 @@ int fb_get_options(char *name, char **option) | |||
1796 | for (i = 0; i < FB_MAX; i++) { | 1796 | for (i = 0; i < FB_MAX; i++) { |
1797 | if (video_options[i] == NULL) | 1797 | if (video_options[i] == NULL) |
1798 | continue; | 1798 | continue; |
1799 | opt_len = strlen(video_options[i]); | 1799 | if (!video_options[i][0]) |
1800 | if (!opt_len) | ||
1801 | continue; | 1800 | continue; |
1802 | opt = video_options[i]; | 1801 | opt = video_options[i]; |
1803 | if (!strncmp(name, opt, name_len) && | 1802 | if (!strncmp(name, opt, name_len) && |