[{"id":1770038,"web_url":"http://patchwork.ozlabs.org/comment/1770038/","msgid":"<CAMuHMdX=AyJ2JVSBO8YwcfCMxEFAwEHe7Wxd_d4OreZaWFoF=A@mail.gmail.com>","list_archive_url":null,"date":"2017-09-18T09:11:31","subject":"Re: [PATCH 5/7] i2c: gpio: Local vars in probe","submitter":{"id":703,"url":"http://patchwork.ozlabs.org/api/people/703/","name":"Geert Uytterhoeven","email":"geert@linux-m68k.org"},"content":"Hi Linus,\n\nOn Sun, Sep 17, 2017 at 11:39 AM, Linus Walleij\n<linus.walleij@linaro.org> wrote:\n> By creating local variables for *dev and *np, the code become\n> much easier to read, in my opinion.\n>\n> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>\n> ---\n> I put this at the end of the series because compared to the\n> rest of the patches it is completely unimportant.\n> ---\n>  drivers/i2c/busses/i2c-gpio.c | 26 ++++++++++++++------------\n>  1 file changed, 14 insertions(+), 12 deletions(-)\n>\n> diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c\n> index 97b9c29e9429..beb5ce523684 100644\n> --- a/drivers/i2c/busses/i2c-gpio.c\n> +++ b/drivers/i2c/busses/i2c-gpio.c\n\n> @@ -99,15 +101,15 @@ static int i2c_gpio_probe(struct platform_device *pdev)\n>         bit_data = &priv->bit_data;\n>         pdata = &priv->pdata;\n>\n> -       if (pdev->dev.of_node) {\n> -               of_i2c_gpio_get_props(pdev->dev.of_node, pdata);\n> +       if (np) {\n> +               of_i2c_gpio_get_props(np, pdata);\n>         } else {\n>                 /*\n>                  * If all platform data settings are zero it is OK\n>                  * to not provide any platform data from the board.\n>                  */\n> -               if (dev_get_platdata(&pdev->dev))\n> -                       memcpy(pdata, dev_get_platdata(&pdev->dev),\n> +               if (dev_get_platdata(dev))\n> +                       memcpy(pdata, dev_get_platdata(dev),\n>                                sizeof(*pdata));\n\nThis fits on one line again (you have to do something to offset the LoC\nincrease 14 insertions(+), 12 deletions(-) ;-)\n\nGr{oetje,eeting}s,\n\n                        Geert\n\n--\nGeert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org\n\nIn personal conversations with technical people, I call myself a hacker. But\nwhen I'm talking to journalists I just say \"programmer\" or something like that.\n                                -- Linus Torvalds","headers":{"Return-Path":"<linux-i2c-owner@vger.kernel.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-i2c-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Pkl5GYJs\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xwhFb6m3vz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 18 Sep 2017 19:55:15 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1755678AbdIRJzL (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tMon, 18 Sep 2017 05:55:11 -0400","from mail-pg0-f66.google.com ([74.125.83.66]:38506 \"EHLO\n\tmail-pg0-f66.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751341AbdIRJLc (ORCPT\n\t<rfc822; linux-i2c@vger.kernel.org>); Mon, 18 Sep 2017 05:11:32 -0400","by mail-pg0-f66.google.com with SMTP id m30so4934034pgn.5\n\tfor <linux-i2c@vger.kernel.org>; Mon, 18 Sep 2017 02:11:32 -0700 (PDT)","by 10.100.160.13 with HTTP; Mon, 18 Sep 2017 02:11:31 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=zUwKuXVahJyp/hQO8G1awzpws5SvESmOxM/EZj/byGc=;\n\tb=Pkl5GYJs3aTk3XX645yijSHuvX7OcskB7QoI6sfUcxVHqRZkNCGGjaxKHru4Hh2h9M\n\tL8weTkbiQPh9t6oRNBbyyn7seVGJuXJEjO6FGsl/pBqwjoW0QIOTMi1JiSTqpgKB07RO\n\tl2VaotvO7MlsRRrm9C7X6b+kdYu+YCkDUDCeRTpWy8Bl5zRVGPtI1wxTLdQL3Kjia7Jb\n\t1YkeRSbHDaoaCSgNk/tnvHRu7zK6g7aPuqA3kAv0+xu9JJNE/7o2IRSROA2eQaVrtZmr\n\teY5ZU+PjPQsp8HJeLNm5YYkhPKYlo1Cv2+u/CLU4yG4ngOgSaX4mRC1rhsoPAQ4i4FYB\n\t2X/w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=zUwKuXVahJyp/hQO8G1awzpws5SvESmOxM/EZj/byGc=;\n\tb=jf/jhJVdK2p8dasHlLv0uCn+7BSlJtp2CKHKHmI5cNBwcnXa15DyN/0RPO+5l4uJnn\n\teab8CeOk2LpVKIDjj/J8+wihY+4cQINw75pdnR9AX1OuBAPn1XKkzT8pEeFiRE2qlu3R\n\tBrNT8uZLCTI2/3pvaFlg09jAEbIT2UHea4H01dTSTN3CnC8D+a4ZslfFbeCd35wgRgGF\n\teMbBMWgAr80SOkGHfRV7bcvQXq3QqLO2i4kYArQiUvOVJ2EymO8eZ8RCVwXQQ3T9onZB\n\tgFRb3cZYlOARamMpmxoHYiu4sYqakX5Z+vF72X2WHr0T4gX32LEaYuM/gf5mOcxold7L\n\txuWQ==","X-Gm-Message-State":"AHPjjUhX0u4BZODd2EPTPJ1UZr5mplET5eBqWb+3c1Pn+nJ4+0vRT46y\n\tUYcluPlKIWH43tHo2LwJyA/G1si6Fr+8HZzqeffq9gxs","X-Google-Smtp-Source":"ADKCNb4JWrS97VSqMS2QEWUe23ejiMYaepSKd2jivNbNL47M0M18yRyDyket4tcbbVAZymCmZqMHuLeNyx3k/bR2fdI=","X-Received":"by 10.98.27.8 with SMTP id b8mr31309236pfb.21.1505725892135; Mon,\n\t18 Sep 2017 02:11:32 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170917093906.16325-6-linus.walleij@linaro.org>","References":"<20170917093906.16325-1-linus.walleij@linaro.org>\n\t<20170917093906.16325-6-linus.walleij@linaro.org>","From":"Geert Uytterhoeven <geert@linux-m68k.org>","Date":"Mon, 18 Sep 2017 11:11:31 +0200","X-Google-Sender-Auth":"RVIuqdNp75g_BAqEI6UpH2OTLmE","Message-ID":"<CAMuHMdX=AyJ2JVSBO8YwcfCMxEFAwEHe7Wxd_d4OreZaWFoF=A@mail.gmail.com>","Subject":"Re: [PATCH 5/7] i2c: gpio: Local vars in probe","To":"Linus Walleij <linus.walleij@linaro.org>","Cc":"Wolfram Sang <wsa@the-dreams.de>, Linux I2C <linux-i2c@vger.kernel.org>,\n\t\"linux-arm-kernel@lists.infradead.org\" \n\t<linux-arm-kernel@lists.infradead.org>,\n\tLinux MIPS Mailing List <linux-mips@linux-mips.org>,\n\t\"adi-buildroot-devel@lists.sourceforge.net\" \n\t<adi-buildroot-devel@lists.sourceforge.net>","Content-Type":"text/plain; charset=\"UTF-8\"","Sender":"linux-i2c-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-i2c.vger.kernel.org>","X-Mailing-List":"linux-i2c@vger.kernel.org"}}]