Commit a67ef278 authored by Denys Vlasenko's avatar Denys Vlasenko Committed by Linus Torvalds

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: default avatarDenys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 26c5be3c
...@@ -1786,7 +1786,7 @@ static int ofonly __read_mostly; ...@@ -1786,7 +1786,7 @@ static int ofonly __read_mostly;
int fb_get_options(char *name, char **option) int fb_get_options(char *name, char **option)
{ {
char *opt, *options = NULL; char *opt, *options = NULL;
int opt_len, retval = 0; int retval = 0;
int name_len = strlen(name), i; int name_len = strlen(name), i;
if (name_len && ofonly && strncmp(name, "offb", 4)) if (name_len && ofonly && strncmp(name, "offb", 4))
...@@ -1796,8 +1796,7 @@ int fb_get_options(char *name, char **option) ...@@ -1796,8 +1796,7 @@ int fb_get_options(char *name, char **option)
for (i = 0; i < FB_MAX; i++) { for (i = 0; i < FB_MAX; i++) {
if (video_options[i] == NULL) if (video_options[i] == NULL)
continue; continue;
opt_len = strlen(video_options[i]); if (!video_options[i][0])
if (!opt_len)
continue; continue;
opt = video_options[i]; opt = video_options[i];
if (!strncmp(name, opt, name_len) && if (!strncmp(name, opt, name_len) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment