From: "Toralf Förster" <toralf.foerster@gmx.de>
To: linux-s390@vger.kernel.org
Subject: Fwd: RE: [E1000-devel] [PATCH] fix format mismatch in drivers/net/ethernet/intel/i40e/i40e_debugfs.c
Date: Tue, 20 May 2014 09:19:45 +0000 [thread overview]
Message-ID: <537B1E31.1030206@gmx.de> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2147 bytes --]
Ursuly,
related to the usage of u8 versus int/unsigned I forward here an comment from Jeffrey:
-------- Original Message --------
Subject: RE: [E1000-devel] [PATCH] fix format mismatch in drivers/net/ethernet/intel/i40e/i40e_debugfs.c
Date: Tue, 20 May 2014 00:17:07 +0000
From: Nelson, Shannon <shannon.nelson@intel.com>
To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>, Toralf F�rster <toralf.foerster@gmx.de>
CC: Brandeburg, Jesse <jesse.brandeburg@intel.com>, e1000-devel@lists.sourceforge.net <e1000-devel@lists.sourceforge.net>, netdev@vger.kernel.org <netdev@vger.kernel.org>
> From: Kirsher, Jeffrey T
>
> On Mon, 2014-05-19 at 14:04 +0200, Toralf F�rster wrote:
> > spotted by cppcheck
> >
> > Signed-off-by: Toralf F�rster <toralf.foerster@gmx.de>
> > ---
> > drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> I will add your patch to my queue and will hold off on making my
> suggested change below until Shannon and Jesse have had time to review
> your patch.
>
> >
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> > index 3c37386..1bc35a2 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> > @@ -1239,7 +1239,7 @@ static ssize_t i40e_dbg_command_write(struct
> file *filp,
> > } else if (strncmp(cmd_buf, "add pvid", 8) == 0) {
> > i40e_status ret;
> > u16 vid;
> > - int v;
> > + unsigned int v;
>
> Maybe u16 instead...
sscanf() can be a tricksie little beastie, and I'm more comfortable with giving it an int of some sort rather than a u16, otherwise this would have just used vid from the start. I can live with Toralf's suggestion.
sln
>
> >
> > cnt = sscanf(&cmd_buf[8], "%i %u", &vsi_seid, &v);
> > if (cnt != 2) {
> > @@ -1255,7 +1255,7 @@ static ssize_t i40e_dbg_command_write(struct
> file *filp,
> > goto command_write_done;
> > }
> >
> > - vid = (unsigned)v;
> > + vid = v;
> > ret = i40e_vsi_add_pvid(vsi, vid);
> > if (!ret)
> > dev_info(&pf->pdev->dev,
>
reply other threads:[~2014-05-20 9:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=537B1E31.1030206@gmx.de \
--to=toralf.foerster@gmx.de \
--cc=linux-s390@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.