linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: dmg <dmg@turingmachine.org>
Cc: linux-usb@vger.kernel.org
Subject: Re: [usb:usb-testing 46/46] drivers/usb//misc/adutux.c:375:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}'
Date: Fri, 21 Jun 2019 08:16:13 +0200	[thread overview]
Message-ID: <20190621061613.GA29018@kroah.com> (raw)
In-Reply-To: <87wohgs3lh.fsf@mn.cs.uvic.ca>

On Thu, Jun 20, 2019 at 08:01:30AM -0700, dmg wrote:
> 
> kbuild test robot <lkp@intel.com> writes:
> 
> [...]
> >
> > All warnings (new ones prefixed by >>):
> >
> >    In file included from include/linux/printk.h:332:0,
> >                     from include/linux/kernel.h:15,
> >                     from drivers/usb//misc/adutux.c:19:
> >    drivers/usb//misc/adutux.c: In function 'adu_read':
> >>> drivers/usb//misc/adutux.c:375:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Wformat=]
> >        "%s : while, data_in_secondary=%lu, status=%d\n",
> 
> I am not sure what is the best way to address this warning.
> 
> size_t seems to be architecture dependent. On my computer (intel64)
> size_t is long unsigned int, but in this test it is int unsigned.
> 
> Are there any suggestions on what is the best way to deal with this?
> 
> casting size_t to long unsigned int will work, but it sounds kind of
> ugly.

As others have pointed out, there's a printk modifier for this.

I'll go drop your patch from my testing branch now, please fix up your
patch and resend.

thanks,

greg k-h

      parent reply	other threads:[~2019-06-21  6:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 14:45 [usb:usb-testing 46/46] drivers/usb//misc/adutux.c:375:4: warning: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' kbuild test robot
2019-06-20 15:01 ` dmg
2019-06-20 15:40   ` Johan Hovold
2019-06-20 15:45   ` Alan Stern
2019-06-21  6:16   ` Greg Kroah-Hartman [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=20190621061613.GA29018@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dmg@turingmachine.org \
    --cc=linux-usb@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).