Linux wireless drivers development
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jason Dreisbach <jtdreisb@gmail.com>
Cc: jt@hp1.hp.com, gregkh@suse.de--to, jpirko@redhat.com,
	linville@tuxdriver.com, jtdreisb@gmail.com--cc,
	linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] staging: wavelan: fix coding style of first 1000 lines in wavelan.c
Date: Mon, 08 Mar 2010 08:54:39 -0800	[thread overview]
Message-ID: <1268067279.1925.41.camel@Joe-Laptop.home> (raw)
In-Reply-To: <1268043630-5893-1-git-send-email-jtdreisb@gmail.com>

On Mon, 2010-03-08 at 02:20 -0800, Jason Dreisbach wrote:
> From: Jason <jtdreisb@gmail.com>
> diff --git a/drivers/staging/wavelan/wavelan.c b/drivers/staging/wavelan/wavelan.c
> index 54ca631..37ede43 100644
> --- a/drivers/staging/wavelan/wavelan.c
> +++ b/drivers/staging/wavelan/wavelan.c
[]
> @@ -279,7 +285,8 @@ static void update_psa_checksum(struct net_device * dev, unsigned long ioaddr, u
>  
>  	if (crc != 0)
>  		printk(KERN_WARNING
> -		       "%s: update_psa_checksum(): CRC does not agree with PSA data (even after recalculating)\n",
> +		       "%s: update_psa_checksum(): CRC does not \
> +		       agree with PSA data (even after recalculating)\n",
>  		       dev->name);
>  #endif				/* DEBUG_IOCTL_INFO */
>  #endif				/* SET_PSA_CRC */

Hi Jason.

What you've done here actually adds a defect.

Breaking up a string using line continuations adds the
initial spaces on the next line to the string.

Ignore the checkpatch error for long format lines.
They are not an error and are actually the preferred style.

One thing you could do is to change the logging form from:
	printk(KERN_<level> "%s: fmt...", dev->name, args);
to
	netdev_<level>(dev, "fmt...", args);

as this may now be a preferred style.
It gives a bit more information in the logs.

When dev is a struct device *, the conversion should be from:
	printk(KERN_<level> "%s: fmt...", dev->name, args);
to:
	dev_<level>(dev, "fmt...", args);

Another thing you could do would be to take the
embedded function name out of the format string
and use "%s() ...", __func__ as this can save
some text space when there's more than 1 use of
the function name and if the function is renamed
or refactored, the right function name is used.

So this gets converted from:
		printk(KERN_WARNING
		       "%s: update_psa_checksum(): CRC does not agree with PSA data (even after recalculating)\n",
		       dev->name);
to:
		netdev_warn(dev, "%s(): CRC does not agree with PSA data (even after recalculating)\n",
			    __func__);



      parent reply	other threads:[~2010-03-08 16:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08 10:20 [PATCH] staging: wavelan: fix coding style of first 1000 lines in wavelan.c Jason Dreisbach
2010-03-08 16:02 ` Dan Carpenter
2010-03-08 16:54 ` Joe Perches [this message]

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=1268067279.1925.41.camel@Joe-Laptop.home \
    --to=joe@perches.com \
    --cc=gregkh@suse.de--to \
    --cc=jpirko@redhat.com \
    --cc=jt@hp1.hp.com \
    --cc=jtdreisb@gmail.com \
    --cc=jtdreisb@gmail.com--cc \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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