From patchwork Thu Jul 2 08:27:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 490510 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BC61714029E for ; Thu, 2 Jul 2015 18:27:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751262AbbGBI1d (ORCPT ); Thu, 2 Jul 2015 04:27:33 -0400 Received: from conuserg009.nifty.com ([202.248.44.35]:37391 "EHLO conuserg009-v.nifty.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751279AbbGBI1b (ORCPT ); Thu, 2 Jul 2015 04:27:31 -0400 Received: from beagle.diag.org (KD106154052185.au-net.ne.jp [106.154.52.185]) (authenticated) by conuserg009-v.nifty.com with ESMTP id t628RA0I025215; Thu, 2 Jul 2015 17:27:13 +0900 X-Nifty-SrcIP: [106.154.52.185] From: Masahiro Yamada To: linux-gpio@vger.kernel.org Cc: Masahiro Yamada , Linus Walleij , Alexandre Courbot , linux-kernel@vger.kernel.org Subject: [PATCH] gpio: of: remove unnecessary variable in of_get_gpio_hog() Date: Thu, 2 Jul 2015 17:27:12 +0900 Message-Id: <1435825632-16103-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The variable "desc" is only used for storing the return value at the end of the function. It is is unneeded. Signed-off-by: Masahiro Yamada Acked-by: Alexandre Courbot --- drivers/gpio/gpiolib-of.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 9a0ec48..fd2db4b 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -136,7 +136,6 @@ static struct gpio_desc *of_get_gpio_hog(struct device_node *np, { struct device_node *chip_np; enum of_gpio_flags xlate_flags; - struct gpio_desc *desc; struct gg_data gg_data = { .flags = &xlate_flags, }; @@ -193,9 +192,7 @@ static struct gpio_desc *of_get_gpio_hog(struct device_node *np, if (name && of_property_read_string(np, "line-name", name)) *name = np->name; - desc = gg_data.out_gpio; - - return desc; + return gg_data.out_gpio; } /**