瀏覽代碼

gpiolib: remove redundant initialization of pointer desc

The initialized value stored in pointer desc is never read as it
is updated in the first executable statement in the function.
This is therefore redundant and can be removed.

Cleans up clang warning:
drivers/gpio/gpiolib.c:3710:20: warning: Value stored to 'desc'
during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Colin Ian King 7 年之前
父節點
當前提交
40a3c9db08
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/gpio/gpiolib.c

+ 1 - 1
drivers/gpio/gpiolib.c

@@ -3692,7 +3692,7 @@ struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
 					 enum gpiod_flags dflags,
 					 const char *label)
 {
-	struct gpio_desc *desc = ERR_PTR(-ENODEV);
+	struct gpio_desc *desc;
 	unsigned long lflags = 0;
 	enum of_gpio_flags flags;
 	bool active_low = false;