OSDN Git Service

mfd: htc-i2cpld: container_of() cannot return NULL
authorLee Jones <lee.jones@linaro.org>
Wed, 13 Aug 2014 12:48:27 +0000 (13:48 +0100)
committerLee Jones <lee.jones@linaro.org>
Fri, 26 Sep 2014 07:15:29 +0000 (08:15 +0100)
Logically dead code (DEADCODE)

dead_error_line: Execution cannot reach this statement: return;

Remove the check for NULL.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/htc-i2cpld.c

index b44f020..8e3ea07 100644 (file)
@@ -227,13 +227,10 @@ static irqreturn_t htcpld_handler(int irq, void *dev)
 static void htcpld_chip_set(struct gpio_chip *chip, unsigned offset, int val)
 {
        struct i2c_client *client;
-       struct htcpld_chip *chip_data;
+       struct htcpld_chip *chip_data =
+               container_of(chip, struct htcpld_chip, chip_out);
        unsigned long flags;
 
-       chip_data = container_of(chip, struct htcpld_chip, chip_out);
-       if (!chip_data)
-               return;
-
        client = chip_data->client;
        if (client == NULL)
                return;