Skip to content

Commit

Permalink
Blackfin arch: Fix bogus str_ident check in gpio code
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
  • Loading branch information
Michael Hennerich authored and Bryan Wu committed Oct 13, 2008
1 parent 46aa04f commit e9fae18
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions arch/blackfin/kernel/bfin_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static void gpio_error(unsigned gpio)

static void set_label(unsigned short ident, const char *label)
{
if (label && str_ident) {
if (label) {
strncpy(str_ident[ident].name, label,
RESOURCE_LABEL_SIZE);
str_ident[ident].name[RESOURCE_LABEL_SIZE - 1] = 0;
Expand All @@ -247,9 +247,6 @@ static void set_label(unsigned short ident, const char *label)

static char *get_label(unsigned short ident)
{
if (!str_ident)
return "UNKNOWN";

return (*str_ident[ident].name ? str_ident[ident].name : "UNKNOWN");
}

Expand All @@ -260,7 +257,7 @@ static int cmp_label(unsigned short ident, const char *label)
printk(KERN_ERR "Please provide none-null label\n");
}

if (label && str_ident)
if (label)
return strncmp(str_ident[ident].name,
label, strlen(label));
else
Expand Down

0 comments on commit e9fae18

Please sign in to comment.