Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8900794ybi; Tue, 23 Jul 2019 17:41:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJLopZYlvwwmXivIe81hXGgZRWL5l2m+k1tMtTB4vnuKFAC1qy9b9K+7xUJr28ycvJRuMA X-Received: by 2002:a65:6709:: with SMTP id u9mr50880382pgf.58.1563928901747; Tue, 23 Jul 2019 17:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563928901; cv=none; d=google.com; s=arc-20160816; b=NOjJkF1sbwTOReVwNiZdGqENhjjrXlLK3oeMbakQ8+EkHf3n4bURFvMWJu1guo4Oxf aTv1Q+bx0FLT4LRdj1vyU5m9kSBN63KSh8C2pIOepwrER1OuW5wAuuTgn54hUN5Ox3g/ trAytP61jTEa9QhWFMcIHmKRTIalKzy2RQHfzxVYp0exzbMUDx5Uua2hwt+M5qzIQZaA P9k0kMy9q2+HpzlCezineArpK/2wlPs+rC3L3SJhSTZzhtMqsjIEF54E/KUvNJOZIuhE ZMxezy9XZov3xVl9VzAYAlFAlpmTmXueqw0+jjeLMne4yS1NUeGma9pqATLPB+8HSVgH ta8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=2tWOsJsUy2VVvlyuL88p8QMAaD2FIKBr9f3dH4QPJkM=; b=tEIiWz5wNreVx7v7FnbVsk+qToEswrffVGqbnRdJ1+8TzbFVcmepSyi5sLz5UtvyFd Q1gIXVXpj6O+dwzBpeAUMcJiiFsqWQ/Lmj1syeYW0Lvkwmixi9wnbx0bBoehr208fODj dcMb87vo/hYDvGm4iFXlda/QQQapGOJi1bP5sY09vrmWcusiPd/kP6zEwCdivUl0oREO 9kt0FsXE9azyr3gUSdAPq8x2llEys6knkv6lVGkeye3+Kf9u8d6M4z5EK0P+RLXxAy6k If3/kjG0Q4OSQwcPmF+GQOkQCv8WkQ/GNNnEzdA8nAQUOgo0clyIu5Zah4C/qknAqelP stpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f131si11927035pgc.265.2019.07.23.17.41.26; Tue, 23 Jul 2019 17:41:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387608AbfGWPec (ORCPT + 99 others); Tue, 23 Jul 2019 11:34:32 -0400 Received: from mga11.intel.com ([192.55.52.93]:23892 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbfGWPec (ORCPT ); Tue, 23 Jul 2019 11:34:32 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jul 2019 08:34:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,299,1559545200"; d="scan'208";a="174578077" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.145]) by orsmga006.jf.intel.com with ESMTP; 23 Jul 2019 08:34:28 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1hpwo6-0004It-9g; Tue, 23 Jul 2019 18:34:26 +0300 Date: Tue, 23 Jul 2019 18:34:26 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Yoshinori Sato , Rich Felker , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Linus Walleij , linux-sh@vger.kernel.org, Linux Kernel Mailing List , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v2 7/7] backlight: gpio: use a helper variable for &pdev->dev Message-ID: <20190723153426.GL9224@smile.fi.intel.com> References: <20190722150302.29526-1-brgl@bgdev.pl> <20190722150302.29526-8-brgl@bgdev.pl> <20190722160908.GZ9224@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 23, 2019 at 08:29:52AM +0200, Bartosz Golaszewski wrote: > pon., 22 lip 2019 o 18:09 Andy Shevchenko > napisaƂ(a): > > > > On Mon, Jul 22, 2019 at 05:03:02PM +0200, Bartosz Golaszewski wrote: > > > From: Bartosz Golaszewski > > > > > > Instead of dereferencing pdev each time, use a helper variable for > > > the associated device pointer. > > > > > static int gpio_backlight_probe(struct platform_device *pdev) > > > { > > > - struct gpio_backlight_platform_data *pdata = > > > - dev_get_platdata(&pdev->dev); > > > + struct gpio_backlight_platform_data *pdata; > > > struct backlight_properties props; > > > struct backlight_device *bl; > > > struct gpio_backlight *gbl; > > > enum gpiod_flags flags; > > > + struct device *dev; > > > > Can't we do > > > > struct device dev = &pdev->dev; > > struct gpio_backlight_platform_data *pdata = dev_get_platdata(dev); > > > > ? It fits 80 nicely. > > > > IMO it's more readable like that with the reverse christmas tree layout. It makes more churn in the original code and for initializers the order is defined by its nature. -- With Best Regards, Andy Shevchenko