Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8976375ybi; Tue, 23 Jul 2019 19:17:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFKrVvySQG69oJ0+RAGtzCUY0d4xfptgsg2xWD+oKqqw1bbP73Ary1Pv51jUEENtKbbgh1 X-Received: by 2002:a63:ec03:: with SMTP id j3mr53235109pgh.325.1563934663732; Tue, 23 Jul 2019 19:17:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563934663; cv=none; d=google.com; s=arc-20160816; b=EsNcD/wPImTtNFW7285wnoPaavKTccOjnxaW8mNP+qdf2bJlX/A1evGTMknXgWK61t hzQuP4+aTER8zwVjNGKF6XfhOwXNzZBjRB0lYI9xtd47TdiTf4mxQzOGrHWjpxoVyWMb c63ZkRx0pDzPIRw4bM8EGNqurdm8ZUN3Bq/XAOhhFVW/n3wA36e411Oua6c6IxHQBdCb FSfk86d9fX2dQsLQu0hdM9K56OK7IWpnsWWubn+hN8fcPXtLskZuMvAFM8CQOqiNoURz fN9L028wcNwF32nuOzsf33ONXi1mV+epzNYSTh58ghYkacCQKG5EGwCz6wwX3Z55bQov jrzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Q1RW+7WTKu2ChwwqlFBnnA2Rj8nJVJpbRqrmrkf5EEQ=; b=S/UU4SONvGrqMTONIQwfnq0OP/5uS2GHnpGXi7NhqhgaGUyWPWF15o6gmeEI7vszK7 fQbq8yodkQE8UX2W4r7PGrdsjBIs9sEkqwj9WVfyUyKSix/yiPtVkISEYAxEtMWyyGvr zCkNx3BmuWKEsooSHlIn9kU9EhvvDR+9NGUpypAGgyWeWU3dYzcLTP1XxcsZlip7+Rfq /04oBAkXCidN5W00DB6pEACOofAW6ew5q8M7cEhAK7G715Q+utGnZfgKj+ce6MrSpOBA FdkG0bXCA6L9Qj8JKzOA1bI4FXIMwJDfsgdI2SAxIrjdgmcqw8mhf1wFI29+TeUBXJiu qkVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xSEXxIxO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 77si16194171pge.315.2019.07.23.19.17.27; Tue, 23 Jul 2019 19:17:43 -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; dkim=pass header.i=@linaro.org header.s=google header.b=xSEXxIxO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390335AbfGWNk1 (ORCPT + 99 others); Tue, 23 Jul 2019 09:40:27 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40467 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390327AbfGWNk0 (ORCPT ); Tue, 23 Jul 2019 09:40:26 -0400 Received: by mail-wr1-f66.google.com with SMTP id r1so43223975wrl.7 for ; Tue, 23 Jul 2019 06:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Q1RW+7WTKu2ChwwqlFBnnA2Rj8nJVJpbRqrmrkf5EEQ=; b=xSEXxIxOiTmnZaxDi2fXZ05ccWC0CcWv2io5iEuiF/kxgFafmrBskcJ0h5jC8TuAVF pODCm3Ynf3hm8QkPNsqA8fwzxfZMcVTUwD8RoGVe0v5DaZtH7eJkjddS0AKJqjFk+Zj1 AkxlNEOLi/k9ofvfjsK+9fj9xHvr7n4zkrgRgv64P1yGjW95DtNGDjDiNd2JzM0XQTl9 h7B9hueKxSZboqqPCJ4Ob7/7JYEzCwKeLC7sGB2BM5xX4rq6LEGkbihHBsdPZnzhD/8W LqMWpc8mjNbbY4R4SGpVezj56ly0mfqoMWD4zJc+XIfvsmzGqN3sB7vw/PDoUFnYg6rI x++g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Q1RW+7WTKu2ChwwqlFBnnA2Rj8nJVJpbRqrmrkf5EEQ=; b=K6RpCm5koNlsUIz+h6xEAraujrSytGpiYoO+BYcSnrNAiDBgZgxVmL9L/uBghEDGdo cxIxRR3qx3S/uvEOSEioaR3jeVtmGSWR4appv9mQCo1jUkeXVtVQVsc3vpW4eK3hDTjD NJYEszkc1LMM4zc84/FejToDXi3YMS+zBOw5XQKSJfMtQG7AQfEtiYk2Q4x+Tgfs2pws Wru1MB/a+TXx24VVL/L9ty8MRyf6U3AIk4EOeBnwSkT4CTYGGIZR55O10Ju/fZy2lFti 7xwOBDz+9N6uDH+914TTbI8/REhgNjCkUdAp4Cu+mXhjrQCQsovKrnOxa9EN/5haU7Xf SNyw== X-Gm-Message-State: APjAAAVM8vpq9vmeWxc6WwxANvUdZKJ4U0xN7KUfM7oRbYxoe/Ylpu7D hIix3jO4s469EWN7pjgEb2/LTw== X-Received: by 2002:adf:ed04:: with SMTP id a4mr75709129wro.86.1563889224613; Tue, 23 Jul 2019 06:40:24 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id q10sm43171756wrf.32.2019.07.23.06.40.23 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 06:40:24 -0700 (PDT) Date: Tue, 23 Jul 2019 14:40:22 +0100 From: Daniel Thompson To: Bartosz Golaszewski Cc: Andy Shevchenko , Yoshinori Sato , Rich Felker , Lee Jones , 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: <20190723134022.s74giqi3aq7v3djz@holly.lan> 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: User-Agent: NeoMutt/20180716 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. There is no requirement for reverse christmas tree layout for this area of the kernel (and especially not where RCTL is used as a justification to avoid initializers). I have a weak personal preference for initializers although it is sufficiently weak I was happy to put a reviewed by on the original patch without comment. Daniel.