From patchwork Tue Jul 14 01:01:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 494839 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 C722214076B for ; Tue, 14 Jul 2015 11:02:30 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752117AbbGNBC3 (ORCPT ); Mon, 13 Jul 2015 21:02:29 -0400 Received: from conuserg012.nifty.com ([202.248.44.38]:65351 "EHLO conuserg012-v.nifty.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752055AbbGNBC3 (ORCPT ); Mon, 13 Jul 2015 21:02:29 -0400 Received: from beagle.diag.org (KD014014081072.au-net.ne.jp [14.14.81.72]) (authenticated) by conuserg012-v.nifty.com with ESMTP id t6E11mgt019551; Tue, 14 Jul 2015 10:01:52 +0900 X-Nifty-SrcIP: [14.14.81.72] From: Masahiro Yamada To: linux-gpio@vger.kernel.org Cc: Alexandre Courbot , Masahiro Yamada , Linus Walleij , Alexandre Courbot , linux-kernel@vger.kernel.org Subject: [PATCH v2] gpio: of: remove unnecessary variable in of_get_gpio_hog() Date: Tue, 14 Jul 2015 10:01:44 +0900 Message-Id: <1436835704-6371-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 unneeded. Signed-off-by: Masahiro Yamada Acked-by: Alexandre Courbot --- Changes in v2: - Fix a typo in git-log. "It is is unneeded" -> "It is unneeded" 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; } /**