[v3,2/2] net/bnxt: fix format characters for unsigned values

Message ID 20201119101700.3869583-3-conor.walsh@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers
Series build: add Wformat to fix gcc compile warnings and format fixes |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing warning Testing issues

Commit Message

Conor Walsh Nov. 19, 2020, 10:17 a.m. UTC
  &device requires the %u format specifer not the %d specifier, as
&device is unsigned.

Fixes: a46bbb57605b ("net/bnxt: update multi device design")
Cc: michael.wildt@broadcom.com

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
---
 drivers/net/bnxt/tf_core/tf_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Ajit Khaparde Nov. 19, 2020, 11:12 p.m. UTC | #1
On Thu, Nov 19, 2020 at 2:17 AM Conor Walsh <conor.walsh@intel.com> wrote:
>
> &device requires the %u format specifer not the %d specifier, as
> &device is unsigned.
>
> Fixes: a46bbb57605b ("net/bnxt: update multi device design")
> Cc: michael.wildt@broadcom.com
>
> Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

> ---
>  drivers/net/bnxt/tf_core/tf_core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/bnxt/tf_core/tf_core.c b/drivers/net/bnxt/tf_core/tf_core.c
> index 0f49a00256..24d49096a7 100644
> --- a/drivers/net/bnxt/tf_core/tf_core.c
> +++ b/drivers/net/bnxt/tf_core/tf_core.c
> @@ -44,7 +44,7 @@ tf_open_session(struct tf *tfp,
>
>         /* Verify control channel and build the beginning of session_id */
>         rc = sscanf(parms->ctrl_chan_name,
> -                   "%x:%x:%x.%d",
> +                   "%x:%x:%x.%u",
>                     &domain,
>                     &bus,
>                     &slot,
> @@ -57,7 +57,7 @@ tf_open_session(struct tf *tfp,
>
>                 /* Check parsing of bus/slot/device */
>                 rc = sscanf(parms->ctrl_chan_name,
> -                           "%x:%x.%d",
> +                           "%x:%x.%u",
>                             &bus,
>                             &slot,
>                             &device);
> @@ -102,7 +102,7 @@ tf_attach_session(struct tf *tfp,
>
>         /* Verify control channel */
>         rc = sscanf(parms->ctrl_chan_name,
> -                   "%x:%x:%x.%d",
> +                   "%x:%x:%x.%u",
>                     &domain,
>                     &bus,
>                     &slot,
> @@ -115,7 +115,7 @@ tf_attach_session(struct tf *tfp,
>
>         /* Verify 'attach' channel */
>         rc = sscanf(parms->attach_chan_name,
> -                   "%x:%x:%x.%d",
> +                   "%x:%x:%x.%u",
>                     &domain,
>                     &bus,
>                     &slot,
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/net/bnxt/tf_core/tf_core.c b/drivers/net/bnxt/tf_core/tf_core.c
index 0f49a00256..24d49096a7 100644
--- a/drivers/net/bnxt/tf_core/tf_core.c
+++ b/drivers/net/bnxt/tf_core/tf_core.c
@@ -44,7 +44,7 @@  tf_open_session(struct tf *tfp,
 
 	/* Verify control channel and build the beginning of session_id */
 	rc = sscanf(parms->ctrl_chan_name,
-		    "%x:%x:%x.%d",
+		    "%x:%x:%x.%u",
 		    &domain,
 		    &bus,
 		    &slot,
@@ -57,7 +57,7 @@  tf_open_session(struct tf *tfp,
 
 		/* Check parsing of bus/slot/device */
 		rc = sscanf(parms->ctrl_chan_name,
-			    "%x:%x.%d",
+			    "%x:%x.%u",
 			    &bus,
 			    &slot,
 			    &device);
@@ -102,7 +102,7 @@  tf_attach_session(struct tf *tfp,
 
 	/* Verify control channel */
 	rc = sscanf(parms->ctrl_chan_name,
-		    "%x:%x:%x.%d",
+		    "%x:%x:%x.%u",
 		    &domain,
 		    &bus,
 		    &slot,
@@ -115,7 +115,7 @@  tf_attach_session(struct tf *tfp,
 
 	/* Verify 'attach' channel */
 	rc = sscanf(parms->attach_chan_name,
-		    "%x:%x:%x.%d",
+		    "%x:%x:%x.%u",
 		    &domain,
 		    &bus,
 		    &slot,