Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4084194yba; Wed, 17 Apr 2019 04:22:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAyfWGbQgYpzEMuQRHYkCm3KvyhCU3csZ7478N2DVnhpBkPfNuO+TxwYxFKnka1ra4Z3t7 X-Received: by 2002:a62:6807:: with SMTP id d7mr86582303pfc.75.1555500138868; Wed, 17 Apr 2019 04:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555500138; cv=none; d=google.com; s=arc-20160816; b=URxTWyBydJ4+Jjdqzx3zbP9RKOfjEBCr26yEm2PLrpRfGQ08geIlozteBQnolo+LZF HivGo7kwh/JCyq6efQTHjjE+qkYWVqJj6ImB9gXYfkxzNVyJnZ1wxOs60IpZoG4KkjEA UnZdZeoTPv0UIJE3hssxHqslzzOj/cLcdmSus5OacdEPQ5XyodDx+FdMBL1ueWIk7mM1 9nW7QIbDdcUnvgtpLJwCgVRTia7gD7vIHZFaBLugH8Yb3vrslPuh/BZUlr3nBOwmkTT1 LkgHhw+/cW0WelkqDsKfQWWtKq8HPcwcTSz2EFo2OBaBvuKVIC51IIGeFdUzEPr0Laf7 L/fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=zL3ujD0ba0NC1sL8I7Ofi1ph8V1pWVw7w8Ags394cdI=; b=jp7ixJV1CDNSiFErkeJuJ0KHyXOFF6GmMqHW/T8AS1l5hmFH3EjUCdnG+GImQd3g+Z gWa+l0Lq67BKN53QvEqnJXbZDsh6uJ2owmFR3eS26kbYnBQN4s88bSxqYKnrvF7dS6tG 8TDZXsO0MxCgZQYZ10ht2VpPnqtR+SGAvoDxm4HJuaHusGEsKGxY5JoZSQGJaoba0Jch OKkoJACZsj8VHfsaggZtDz0k9AtXC4uGFNNuQIiZ0H1T6Z5ybBYuHQFdXv9wSL/GKf/N YauW3gbJHy/fyY+Ai2Ltn5r0omR8UfcTSRAIaMyUK4tH9NCFSlwikJxv6BHBz/uobGIe vRgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="x/O9UniV"; 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 k5si49692059plt.179.2019.04.17.04.22.03; Wed, 17 Apr 2019 04:22:18 -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="x/O9UniV"; 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 S1731717AbfDQLTx (ORCPT + 99 others); Wed, 17 Apr 2019 07:19:53 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:54494 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731116AbfDQLTw (ORCPT ); Wed, 17 Apr 2019 07:19:52 -0400 Received: by mail-it1-f194.google.com with SMTP id a190so3894502ite.4 for ; Wed, 17 Apr 2019 04:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zL3ujD0ba0NC1sL8I7Ofi1ph8V1pWVw7w8Ags394cdI=; b=x/O9UniVSSUtV1C/i+CeTfikdv66X/F6q8nW1mlhkl/cd8eNhhI9CjXopkedEcnW3z P9ObRkDE8oxHHscuI+MI9ALhKyeiFESQ5kfEV5DmRJJ79zk7qaXLq7shg3Mf9AGZRVGV /rQPrqx/GEGEQ+5krSnVODvbykedcXIa857zYlr1HeJH3y4yQse0SM00lIK0xEx83wSo qHavaCrjj5DWeSe7F4o5bsDs/lSIvQsn5FF/0DbWUKzYqhsQz0I6rSeNAjZ/lTz72JoP ILjokNbwUYG7jRVQ/HB8XOOlg3JhqqgLxQbecentR5F++5murvdn0KAJ5jQfJsRp5WrC KF6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zL3ujD0ba0NC1sL8I7Ofi1ph8V1pWVw7w8Ags394cdI=; b=kv9gigjZrYp3b33nz4LcSctEyGy9zIqK+oBite6KmRMuWB8JKJ2mHeVWThVPvNNedx jY43+FqgVOwJWQZ+dn9BqmLndXiBy9x7fQb9BVLQ4PHvnBdt/RSBo/xWwos12bYpLVD4 WSW1SjRsz3vk4VGn+ihhWsDnCkpbfcWcfkt76pAyYrP94NdAy/R4Na8mbqBopTJlfi1u JftUQrXhbD+eJb88Udqq844Y70WLUpueLi3afnHtHb+gVCw7BkKshhQcjdybQ1eR8skm j3kE9lMrDuUDguJdCLntYKGruYxszIXhmyvUIipjN3DQJFT0clZ7qDFqByRbzpM5H573 fBNQ== X-Gm-Message-State: APjAAAVAtGVogDLnemb38S/NaVQA/UMfvcqUe4UK3ghag7zL9dpegebQ S5cWBjoAxtjSSWnkU5DcvIkJD0rLjas= X-Received: by 2002:a02:658b:: with SMTP id u133mr53582582jab.17.1555499991568; Wed, 17 Apr 2019 04:19:51 -0700 (PDT) Received: from [172.22.22.26] (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.googlemail.com with ESMTPSA id r74sm1098436ita.7.2019.04.17.04.19.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 04:19:51 -0700 (PDT) Subject: Re: [greybus-dev] [PATCH v2] Staging: greybus: Cleanup in greybus driver To: Greg KH , Madhumitha Prabakaran Cc: devel@driverdev.osuosl.org, greybus-dev@lists.linaro.org, elder@kernel.org, johan@kernel.org, linux-kernel@vger.kernel.org References: <20190416221318.21161-1-madhumithabiw@gmail.com> <20190417062518.GA23076@kroah.com> From: Alex Elder Message-ID: Date: Wed, 17 Apr 2019 06:19:50 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190417062518.GA23076@kroah.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/17/19 1:25 AM, Greg KH wrote: > On Tue, Apr 16, 2019 at 05:13:18PM -0500, Madhumitha Prabakaran wrote: >> Fix a blank line after structure declarations. Also, convert >> macros into inline functions in order to maintain Linux kernel >> coding style based on which the inline function is >> preferable over the macro. >> >> Blank line fixes are suggested by checkpatch.pl >> >> Signed-off-by: Madhumitha Prabakaran >> >> Changes in v2: >> - To maintain consistency in driver greybus, all the instances of macro >> with container_of are fixed in a single patch. >> --- >> drivers/staging/greybus/bundle.h | 6 +++++- >> drivers/staging/greybus/control.h | 6 +++++- >> drivers/staging/greybus/gbphy.h | 12 ++++++++++-- >> drivers/staging/greybus/greybus.h | 6 +++++- >> drivers/staging/greybus/hd.h | 6 +++++- >> drivers/staging/greybus/interface.h | 6 +++++- >> drivers/staging/greybus/module.h | 6 +++++- >> drivers/staging/greybus/svc.h | 6 +++++- >> 8 files changed, 45 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/staging/greybus/bundle.h b/drivers/staging/greybus/bundle.h >> index 8734d2055657..84956eedb1c4 100644 >> --- a/drivers/staging/greybus/bundle.h >> +++ b/drivers/staging/greybus/bundle.h >> @@ -31,7 +31,11 @@ struct gb_bundle { >> >> struct list_head links; /* interface->bundles */ >> }; >> -#define to_gb_bundle(d) container_of(d, struct gb_bundle, dev) >> + >> +static inline struct gb_bundle *to_gb_bundle(struct device *d) >> +{ >> + return container_of(d, struct gb_bundle, dev); >> +} > > Why are we changing this to an inline function? The #define is fine, > and how we "normally" do this type of container_of conversion. I'm not completely sure about the inline function, but on the no blank lines thing (and many other minor issues) "checkpatch.pl" is to blame. There are lots of examples of issues that checkpatch points out that are matters of opinion and not hardened kernel style rules. We try to encourage people to get involved with kernel development by fixing minor problems, and we tell them a good way to find them is by running checkpatch and "fixing" what it reports. Unfortunately, it is often things of this type, and reviewers balk and say "no, please leave it," and the poor new person has a bad first experience. I *like* "checkpatch.pl". And the fact that it can point out some of these sorts of things is great. But it would be nice if certain types of problems (like multiple blank lines, or lines that are 81 characters wide for example) would only be reported when a "--strict" option or something were supplied. -Alex > I understand the objection of the "no blank line", but this was the > "original" style that we used to create these #defines from the very > beginning of the driver model work a decade ago. Changing that > muscle-memory is going to be hard for some of us. Look at > drivers/base/base.h for other examples of this. > > thanks, > > greg k-h > _______________________________________________ > greybus-dev mailing list > greybus-dev@lists.linaro.org > https://lists.linaro.org/mailman/listinfo/greybus-dev >