linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: sfr@canb.auug.org.au, netdev@vger.kernel.org,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	gregkh@suse.de
Subject: Re: linux-next: build warning after merge of the net tree
Date: Wed, 07 Jul 2010 21:13:42 -0700	[thread overview]
Message-ID: <1278562423.1712.43.camel@Joe-Laptop> (raw)
In-Reply-To: <20100707.181847.62350965.davem@davemloft.net>

On Wed, 2010-07-07 at 18:18 -0700, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Wed, 07 Jul 2010 17:45:22 -0700 (PDT)
> > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > Date: Tue, 6 Jul 2010 14:25:42 +1000
> >> After merging the net tree, today's linux-next build (powerpc
> >> ppc64_defconfig) produced these warnings:
> >> drivers/scsi/sym53c8xx_2/sym_hipd.c: In function 'sym_print_msg':
> >> drivers/scsi/sym53c8xx_2/sym_hipd.c:78: warning: zero-length gnu_printf format string
> > Thanks Stephen I'll look into this.
> Yeah this is a bit ugly.
> 
> It used to be that the dev_*() format string was CPP pasted to whatever
> format string the user gave.  So if the user gave an empty string it
> still looked like a non-empty printf string.
> 
> But that no longer happens because we hide the implementation, and thus
> the top-level printf format string, in the external functions.
> 
> It seems the construction:
> 
> /*
>  * Stupid hackaround for existing uses of non-printk uses dev_info
>  *
>  * Note that the definition of dev_info below is actually _dev_info
>  * and a macro is used to avoid redefining dev_info
>  */
> 
> #define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
> 
> added to linux/device.h was meant to handle these cases, but as we see
> it doesn't.

Nope, the _dev_info/dev_info is meant to handle the
current uses of dev_info as a variable like this one:

$ grep dev_info drivers/net/pcmcia/pcnet_cs.c
static dev_info_t dev_info = "pcnet_cs";
    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev);

Without the _dev_info and dev_info as a macro,
the function is redefined as a variable.

> It looks like there are just a hand-ful of cases, so maybe we can tweak
> them by hand.  For example, in the sym53c8xx_2 driver bits we can replace
> the NULL labels passed to sym_print_msg() with a real string and therefore
> remove the "" case.
> 
> Joe, any better ideas?

You're right there are just a few cases where dev_info
is uses as a preface for a hex_dump style display.

Maybe it'd be OK to simply add a trailing space to the
preface and remove any leading spaces from the subsequent
initial printks.

dev_info(dev, " ");

  reply	other threads:[~2010-07-08  4:13 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-06  4:25 linux-next: build warning after merge of the net tree Stephen Rothwell
2010-07-08  0:45 ` David Miller
2010-07-08  1:18   ` David Miller
2010-07-08  4:13     ` Joe Perches [this message]
2010-07-11  2:52       ` David Miller
2010-07-11  5:08         ` [PATCH net-next] drivers/scsi: Remove warnings after vsprintf %pV introduction Joe Perches
2010-07-11  6:10           ` David Miller
2010-07-12  8:27             ` James Bottomley
2010-07-13  3:37               ` David Miller
2010-07-27 13:12           ` James Bottomley
2010-08-31  2:57 ` linux-next: build warning after merge of the net tree Stephen Rothwell
2010-08-31  3:14   ` Joe Perches
2010-08-31  3:58     ` Stephen Rothwell
2010-08-31  4:03       ` Joe Perches
2010-08-31  4:46         ` David Miller
2010-08-31  4:45       ` David Miller
2010-08-31  4:42   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2019-12-04 21:44 Stephen Rothwell
2019-12-05 22:57 ` David Miller
2019-12-05 23:48   ` Stephen Rothwell
2019-01-14  4:15 Stephen Rothwell
2018-08-21 22:04 Stephen Rothwell
2018-08-22 19:26 ` Cong Wang
2017-08-22 23:34 Stephen Rothwell
2017-06-13 11:08 Stephen Rothwell
2017-06-13 11:31 ` Ashwanth Goli
2017-01-18 22:56 Stephen Rothwell
2017-01-19  8:26 ` Tariq Toukan
2014-09-18  0:32 Stephen Rothwell
2014-09-18  0:35 ` Randy Dunlap
2014-09-23 14:59   ` Michal Marek
2014-09-23 21:23     ` Stephen Rothwell
2014-09-24  0:36       ` Stephen Rothwell
2014-09-24  1:58       ` David Miller
2011-05-13  1:41 Stephen Rothwell
2011-05-13  3:04 ` David Miller
2011-05-09  3:46 Stephen Rothwell
2011-05-09  4:13 ` David Miller
2010-07-22  2:11 Stephen Rothwell
2010-07-22  4:09 ` David Miller
2010-07-07  4:30 Stephen Rothwell
2010-07-08  1:23 ` David Miller
2010-03-01  5:47 Stephen Rothwell
2010-03-01  7:02 ` David Miller
2010-02-15  3:32 Stephen Rothwell
2010-02-15  6:21 ` David Miller
2010-02-15  6:51 ` David Miller
2010-02-15  9:36   ` Jiri Pirko

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=1278562423.1712.43.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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).