public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Ioana Antoche <ioana.antoche@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] driver core: fix several coding style warnings
Date: Mon, 09 Mar 2015 11:27:43 -0700	[thread overview]
Message-ID: <1425925663.5428.43.camel@perches.com> (raw)
In-Reply-To: <1425924536-8583-1-git-send-email-ioana.antoche@gmail.com>

On Mon, 2015-03-09 at 20:08 +0200, Ioana Antoche wrote:
> Fix checkpatch.pl warnings such as:
> * missing blank line after declarations
> * line over 80 characters
> 
> Signed-off-by: Ioana Antoche <ioana.antoche@gmail.com>
> ---
> * undo changes related to "ERROR: that open brace { should be on the previous line".

Not quite.

> diff --git a/drivers/base/bus.c b/drivers/base/bus.c

> @@ -298,8 +299,7 @@ static struct device *next_device(struct klist_iter *i)
>   * count in the supplied callback.
>   */
>  int bus_for_each_dev(struct bus_type *bus, struct device *start,
> -		     void *data, int (*fn)(struct device *, void *))
> -{
> +		     void *data, int (*fn)(struct device *, void *)) {

Don't want this change here.

> @@ -395,7 +395,8 @@ struct device *subsys_find_device_by_id(struct bus_type *subsys, unsigned int id
>  		return NULL;
>  
>  	if (hint) {
> -		klist_iter_init_node(&subsys->p->klist_devices, &i, &hint->p->knode_bus);
> +		klist_iter_init_node(&subsys->p->klist_devices, &i,
> +			&hint->p->knode_bus);

Please run your patches though checkpatch --strict.

This second line should be aligned to the open parenthesis like:

		klist_iter_init_node(&subsys->p->klist_devices, &i,
				     &hint->p->knode_bus);


> @@ -448,8 +449,7 @@ static struct device_driver *next_driver(struct klist_iter *i)
>   * so it doesn't disappear before returning to the caller.
>   */
>  int bus_for_each_drv(struct bus_type *bus, struct device_driver *start,
> -		     void *data, int (*fn)(struct device_driver *, void *))
> -{
> +		     void *data, int (*fn)(struct device_driver *, void *)) {

Maybe you re-sent your original patch?

> @@ -1092,7 +1095,8 @@ struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter)
>  		knode = klist_next(&iter->ki);
>  		if (!knode)
>  			return NULL;
> -		dev = container_of(knode, struct device_private, knode_bus)->device;
> +		dev = container_of(knode, struct device_private, knode_bus)
> +				  ->device;

That's not nice to read.
If it exceeds 80 columns, just leave it alone
or if it really bothers you, use a temporary
for container_of then dereference that.




  reply	other threads:[~2015-03-09 18:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 18:08 [PATCH v2] driver core: fix several coding style warnings Ioana Antoche
2015-03-09 18:27 ` Joe Perches [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-03-08 21:28 Ioana Antoche
2015-03-08 21:46 ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425925663.5428.43.camel@perches.com \
    --to=joe@perches.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ioana.antoche@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox