linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Luciano Coelho <coelho@ti.com>
Cc: linux-kernel@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH wireless-next 18/20] ti: Use pr_<level>
Date: Fri, 15 Jun 2012 03:42:11 -0700	[thread overview]
Message-ID: <1339756931.24527.16.camel@joe2Laptop> (raw)
In-Reply-To: <1339749374.4502.80.camel@cumari.coelho.fi>

On Fri, 2012-06-15 at 11:36 +0300, Luciano Coelho wrote:
> Hi Joe,

Hi Luciano.

> As Johannes already mentioned, I have to also ask why do you need to do
> this?

To use a more consistent logging style.
To minimize unnecessary changes when adding
similar drivers based on this code.

>  I see the point, slightly, with the wl1251 code, because it is
> still using printks, but with wlcore and friends, there's no functional
> change.

Using a consistent logging style minimizes defects.

> As mentioned above, this change here is acceptable, but removing the \n
> from the macro and adding it at the end of each and every call is
> useless and will just skew git-blame and make it harder to do rebase or
> apply patches because of conflicts.

In practice, the merging won't be much of an issue.
Neither will git blame.

> > -#define wl1271_warning(fmt, arg...) \
> > -	pr_warning(DRIVER_PREFIX "WARNING " fmt "\n", ##arg)
> > +#define wl1271_warn(fmt, arg...)				\
> > +	pr_warn(DRIVER_PREFIX "WARNING " fmt, ##arg)
> 
> Using pr_warn instead of pr_warning is pointless.  pr_warning is the
> main definition, actually, and pr_warn is just a "mirror".

I expect one day to reverse the definitions.

The kernel is moving, albeit slowly to prefer
pr_warn to mirror dev_warn, netdev_warn, etc.

Most of these uses will eventually become netdev_warn.
netdev_warn still uses a \n.

> Again, moving the \n from the macro definition and changing all the
> callers is an unnecessary, intrusive change.
> 
> We have wanted to change "wl1271" to "wl12xx" for a long time, but we
> don't do it exactly because this means we need to change the calls
> everywhere.

Nothing in ever _needed_, no child will go
hungry or fed here.  This is a consistency change.

There are a couple of instances where \n is
currently used unnecessarily that are fixed in
the conversion.

$ git grep -E  "\bwl12[0-9]+_[a-z]+\s*\(.*\\\\n\"" drivers/net/wireless/ti
drivers/net/wireless/ti/wl12xx/cmd.c:   wl1271_debug(DEBUG_CMD, "FEM autodetect: %s, manufacturer: %d\n",
drivers/net/wireless/ti/wl12xx/cmd.c:   wl1271_debug(DEBUG_CMD, "FEM autodetect: %s, manufacturer: %d\n",
drivers/net/wireless/ti/wlcore/main.c:          wl1271_error("Incorrect ampdu action id=%x\n", action);

People make these mistakes because the more
common and adjacent dev_<level> code _use_
a newline.  Using a consistent style minimzes
these defects.

cheers, Joe


  reply	other threads:[~2012-06-15 10:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15  5:53 [PATCH wireless-next 00/20] Use pr_<level> Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 01/20] adm8211: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 02/20] airo_cs: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 03/20] at76c50x-usb: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 04/20] atmel: atmel_cs: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 05/20] b43: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 06/20] b43legacy: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 07/20] hostap: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 08/20] ipw2x00: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 09/20] libertas: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 10/20] libertas_tf: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 11/20] mac80211_hwsim: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 12/20] mwl8k: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 13/20] orinoco: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 14/20] p54: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 15/20] prism54: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 16/20] ray_cs: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 17/20] rtl818x: " Joe Perches
2012-06-15  5:53 ` [PATCH wireless-next 18/20] ti: " Joe Perches
2012-06-15  8:36   ` Luciano Coelho
2012-06-15 10:42     ` Joe Perches [this message]
2012-06-15  5:53 ` [PATCH wireless-next 19/20] wl3501_cs: " Joe Perches
2012-06-15  5:54 ` [PATCH wireless-next 20/20] zd_usb: " Joe Perches
2012-06-15  7:36 ` [PATCH wireless-next 00/20] " Johannes Berg
2012-06-15 10:48   ` Joe Perches
2012-06-15 22:50     ` Ted Ts'o
2012-06-15 23:37       ` 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=1339756931.24527.16.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=coelho@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).