* [PATCH] fix format mismatch in drivers/net/ethernet/intel/i40e/i40e_debugfs.c
@ 2014-05-19 12:04 Toralf Förster
2014-05-20 0:08 ` Jeff Kirsher
0 siblings, 1 reply; 3+ messages in thread
From: Toralf Förster @ 2014-05-19 12:04 UTC (permalink / raw)
To: shannon.nelson, jesse.brandeburg; +Cc: e1000-devel, netdev, Toralf Förster
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(-)
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;
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,
--
1.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] fix format mismatch in drivers/net/ethernet/intel/i40e/i40e_debugfs.c
2014-05-19 12:04 [PATCH] fix format mismatch in drivers/net/ethernet/intel/i40e/i40e_debugfs.c Toralf Förster
@ 2014-05-20 0:08 ` Jeff Kirsher
2014-05-20 0:17 ` Nelson, Shannon
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Kirsher @ 2014-05-20 0:08 UTC (permalink / raw)
To: Toralf Förster; +Cc: e1000-devel, netdev, jesse.brandeburg
[-- Attachment #1.1: Type: text/plain, Size: 1261 bytes --]
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...
>
> 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,
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 385 bytes --]
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
[-- Attachment #3: Type: text/plain, Size: 257 bytes --]
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] fix format mismatch in drivers/net/ethernet/intel/i40e/i40e_debugfs.c
2014-05-20 0:08 ` Jeff Kirsher
@ 2014-05-20 0:17 ` Nelson, Shannon
0 siblings, 0 replies; 3+ messages in thread
From: Nelson, Shannon @ 2014-05-20 0:17 UTC (permalink / raw)
To: Kirsher, Jeffrey T, Toralf Förster
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
Brandeburg, Jesse
> 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,
>
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-20 0:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-19 12:04 [PATCH] fix format mismatch in drivers/net/ethernet/intel/i40e/i40e_debugfs.c Toralf Förster
2014-05-20 0:08 ` Jeff Kirsher
2014-05-20 0:17 ` Nelson, Shannon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox