Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3892197yba; Tue, 16 Apr 2019 23:26:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3PVSVjPJadD0PcxU5RMJ8/mjzitky/aRrkqWtzPDF/cIql6DpOTUdK/n0D1FCtL5cIaZo X-Received: by 2002:a63:4b21:: with SMTP id y33mr82124667pga.37.1555482410291; Tue, 16 Apr 2019 23:26:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555482410; cv=none; d=google.com; s=arc-20160816; b=hR4CepPmIMd6CZn4wI6F57JaRnquCM+WF7JxJfJPfo5xEVd8g9cgepKj1pnKsZ+Csp MYaT6NUg9hq4W6GmfnodQXvz21xmfIWcFExieNZKwmS3o9pUKnDB84aFaBlUtC0xWVTV 0UTV/3MkNZTPzA13qWnTVzFsJ8FhZa4HxEOOKbH7hTuHeIbup3x9Ng+oTO4yQr0KIbf0 mvJ/ymJdec/1j0MD0Ew8yPtAwXYaYfJdO1853+BsASNh5o7A0exZUPw7aF8idsm+lnQg uMj0CLBUPqhfb7PwefmxK+60YccLbFhSpI+F5CA4DkGU/wzWmI3j3IHLkk4yqa9PY7w6 gIAA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TwJ7cext+Lrg2AlqK2AEMAHty1967QPZPqLvYKpFvNI=; b=nOKiud9cfgY7rxvt7do/06UlgspKlRzARnazRTpqoapAe6gYDohvBBtCiTpwhYZUts 8Jo0AhzKIBN+FO6yNNmn+3ZmmsVcrgsXm83m13h6D1OomjTxtupmY1TF6/hpRVPM2beM 7Mn4XUhf1BB194iAnk3b3APovkzvhQlLHfkr9xmLBb8bKrkBkfxcQz37wdOvApHKvPmw 8+MLK6/jgEErjE6WH8uc3JZ6pVj/lPLrXbwF/RpEVcbFnO6qwVk0Uc7CEOav1aay2Do0 vU+4vt3PHyo3ipSNh0Ftcc0DltJQAaMAmohFFxUQ8y/y+p1i+Bo5A1DzycuncTinL1e8 /tSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i+Hhq9Ni; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2si40472260pgr.41.2019.04.16.23.26.35; Tue, 16 Apr 2019 23:26:50 -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=@kernel.org header.s=default header.b=i+Hhq9Ni; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730592AbfDQGZW (ORCPT + 99 others); Wed, 17 Apr 2019 02:25:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:35934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726837AbfDQGZV (ORCPT ); Wed, 17 Apr 2019 02:25:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D2CED20675; Wed, 17 Apr 2019 06:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555482321; bh=sJBUKC1YKU2VXUbKeuzPParCLxNe2/Q4zGC2ajENzxw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i+Hhq9Niz7jhQHAmPdqi3Zxa/ecvzGGx0F84dqaVvmjpkYGnFC7yPQoPjKizeK88i BwQ4m9c8avpRulHsQCfnxahI1goX0gCAAVWIWIWe8YNFoiv6i/Mg+aYBhlhkMPvX3W gMTatJGVLjwdUxVEzaLJRUgWM7zBdeQzNykV45Wc= Date: Wed, 17 Apr 2019 08:25:18 +0200 From: Greg KH To: Madhumitha Prabakaran Cc: johan@kernel.org, elder@kernel.org, greybus-dev@lists.linaro.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Staging: greybus: Cleanup in greybus driver Message-ID: <20190417062518.GA23076@kroah.com> References: <20190416221318.21161-1-madhumithabiw@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190416221318.21161-1-madhumithabiw@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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