linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: wilc1000: fix warning while printing
@ 2015-06-02  7:56 Sudip Mukherjee
  2015-06-02  8:29 ` Konrad Zapalowicz
  0 siblings, 1 reply; 5+ messages in thread
From: Sudip Mukherjee @ 2015-06-02  7:56 UTC (permalink / raw)
  To: Johnny Kim, Rachel Kim, Dean Lee, Chris Park, Greg Kroah-Hartman
  Cc: linux-wireless, devel, linux-kernel, Sudip Mukherjee

size_t should print using %zu, but here it was using %d and hence we
were getting warning while printing.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

I think it will be easy to remove the other warnings if all the typedefs
are removed first.

 drivers/staging/wilc1000/wilc_spi.c               | 2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
index d0e7610..6d854fd 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -404,7 +404,7 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
 #undef NUM_DUMMY_BYTES
 
 	if (len2 > (sizeof(wb) / sizeof(wb[0]))) {
-		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%d)\n",
+		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%lu)\n",
 			 len2, (sizeof(wb) / sizeof(wb[0])));
 		result = N_FAIL;
 		return result;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index e9ab2cb..6fdb0d6 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -638,7 +638,7 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
 		}
 
 
-		PRINT_D(CFG80211_DBG, "Association request info elements length = %d\n", pstrConnectInfo->ReqIEsLen);
+		PRINT_D(CFG80211_DBG, "Association request info elements length = %zu\n", pstrConnectInfo->ReqIEsLen);
 
 		PRINT_D(CFG80211_DBG, "Association response info elements length = %d\n", pstrConnectInfo->u16RespIEsLen);
 
@@ -778,7 +778,7 @@ static int WILC_WFI_CfgScan(struct wiphy *wiphy, struct cfg80211_scan_request *r
 		}
 
 		PRINT_D(CFG80211_DBG, "Requested num of scan channel %d\n", request->n_channels);
-		PRINT_D(CFG80211_DBG, "Scan Request IE len =  %d\n", request->ie_len);
+		PRINT_D(CFG80211_DBG, "Scan Request IE len =  %zu\n", request->ie_len);
 
 		PRINT_D(CFG80211_DBG, "Number of SSIDs %d\n", request->n_ssids);
 
@@ -3316,7 +3316,7 @@ static int WILC_WFI_start_ap(struct wiphy *wiphy, struct net_device *dev,
 	priv = wiphy_priv(wiphy);
 	PRINT_D(HOSTAPD_DBG, "Starting ap\n");
 
-	PRINT_D(HOSTAPD_DBG, "Interval = %d \n DTIM period = %d\n Head length = %d Tail length = %d\n",
+	PRINT_D(HOSTAPD_DBG, "Interval = %d \n DTIM period = %d\n Head length = %zu Tail length = %zu\n",
 		settings->beacon_interval, settings->dtim_period, beacon->head_len, beacon->tail_len);
 
 	s32Error = WILC_WFI_CfgSetChannel(wiphy, &settings->chandef);
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: wilc1000: fix warning while printing
  2015-06-02  7:56 [PATCH] staging: wilc1000: fix warning while printing Sudip Mukherjee
@ 2015-06-02  8:29 ` Konrad Zapalowicz
  2015-06-02  8:35   ` Sudip Mukherjee
  0 siblings, 1 reply; 5+ messages in thread
From: Konrad Zapalowicz @ 2015-06-02  8:29 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Johnny Kim, Rachel Kim, Dean Lee, Chris Park, Greg Kroah-Hartman,
	devel, linux-wireless, linux-kernel

On 06/02, Sudip Mukherjee wrote:
> size_t should print using %zu, but here it was using %d and hence we
> were getting warning while printing.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
> 
> I think it will be easy to remove the other warnings if all the typedefs
> are removed first.
> 
>  drivers/staging/wilc1000/wilc_spi.c               | 2 +-
>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
> index d0e7610..6d854fd 100644
> --- a/drivers/staging/wilc1000/wilc_spi.c
> +++ b/drivers/staging/wilc1000/wilc_spi.c
> @@ -404,7 +404,7 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
>  #undef NUM_DUMMY_BYTES
>  
>  	if (len2 > (sizeof(wb) / sizeof(wb[0]))) {
> -		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%d)\n",
> +		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%lu)\n",

Hi, it seems that the above line should use %zu too. Am I correct or I'm
missing something?

 - konrad

>  			 len2, (sizeof(wb) / sizeof(wb[0])));
>  		result = N_FAIL;
>  		return result;
> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> index e9ab2cb..6fdb0d6 100644
> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> @@ -638,7 +638,7 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
>  		}
>  
>  
> -		PRINT_D(CFG80211_DBG, "Association request info elements length = %d\n", pstrConnectInfo->ReqIEsLen);
> +		PRINT_D(CFG80211_DBG, "Association request info elements length = %zu\n", pstrConnectInfo->ReqIEsLen);
>  
>  		PRINT_D(CFG80211_DBG, "Association response info elements length = %d\n", pstrConnectInfo->u16RespIEsLen);
>  
> @@ -778,7 +778,7 @@ static int WILC_WFI_CfgScan(struct wiphy *wiphy, struct cfg80211_scan_request *r
>  		}
>  
>  		PRINT_D(CFG80211_DBG, "Requested num of scan channel %d\n", request->n_channels);
> -		PRINT_D(CFG80211_DBG, "Scan Request IE len =  %d\n", request->ie_len);
> +		PRINT_D(CFG80211_DBG, "Scan Request IE len =  %zu\n", request->ie_len);
>  
>  		PRINT_D(CFG80211_DBG, "Number of SSIDs %d\n", request->n_ssids);
>  
> @@ -3316,7 +3316,7 @@ static int WILC_WFI_start_ap(struct wiphy *wiphy, struct net_device *dev,
>  	priv = wiphy_priv(wiphy);
>  	PRINT_D(HOSTAPD_DBG, "Starting ap\n");
>  
> -	PRINT_D(HOSTAPD_DBG, "Interval = %d \n DTIM period = %d\n Head length = %d Tail length = %d\n",
> +	PRINT_D(HOSTAPD_DBG, "Interval = %d \n DTIM period = %d\n Head length = %zu Tail length = %zu\n",
>  		settings->beacon_interval, settings->dtim_period, beacon->head_len, beacon->tail_len);
>  
>  	s32Error = WILC_WFI_CfgSetChannel(wiphy, &settings->chandef);
> -- 
> 1.8.1.2
> 
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: wilc1000: fix warning while printing
  2015-06-02  8:29 ` Konrad Zapalowicz
@ 2015-06-02  8:35   ` Sudip Mukherjee
  2015-06-02  8:58     ` Konrad Zapalowicz
  0 siblings, 1 reply; 5+ messages in thread
From: Sudip Mukherjee @ 2015-06-02  8:35 UTC (permalink / raw)
  To: Konrad Zapalowicz
  Cc: Johnny Kim, Rachel Kim, Dean Lee, Chris Park, Greg Kroah-Hartman,
	devel, linux-wireless, linux-kernel

On Tue, Jun 02, 2015 at 10:29:17AM +0200, Konrad Zapalowicz wrote:
> On 06/02, Sudip Mukherjee wrote:
> > size_t should print using %zu, but here it was using %d and hence we
> > were getting warning while printing.
> > 
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > ---
> > 
> > I think it will be easy to remove the other warnings if all the typedefs
> > are removed first.
> > 
> >  drivers/staging/wilc1000/wilc_spi.c               | 2 +-
> >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
> >  2 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
> > index d0e7610..6d854fd 100644
> > --- a/drivers/staging/wilc1000/wilc_spi.c
> > +++ b/drivers/staging/wilc1000/wilc_spi.c
> > @@ -404,7 +404,7 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
> >  #undef NUM_DUMMY_BYTES
> >  
> >  	if (len2 > (sizeof(wb) / sizeof(wb[0]))) {
> > -		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%d)\n",
> > +		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%lu)\n",
> 
> Hi, it seems that the above line should use %zu too. Am I correct or I'm
> missing something?
oops. my mistake. %lu is correct but i missed mentioning the warning
about long unsigned int in the commit message.

regards
sudip

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: wilc1000: fix warning while printing
  2015-06-02  8:35   ` Sudip Mukherjee
@ 2015-06-02  8:58     ` Konrad Zapalowicz
  2015-06-02  9:01       ` Sudip Mukherjee
  0 siblings, 1 reply; 5+ messages in thread
From: Konrad Zapalowicz @ 2015-06-02  8:58 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Johnny Kim, Rachel Kim, Dean Lee, Chris Park, Greg Kroah-Hartman,
	devel, linux-wireless, linux-kernel

On 06/02, Sudip Mukherjee wrote:
> On Tue, Jun 02, 2015 at 10:29:17AM +0200, Konrad Zapalowicz wrote:
> > On 06/02, Sudip Mukherjee wrote:
> > > size_t should print using %zu, but here it was using %d and hence we
> > > were getting warning while printing.
> > > 
> > > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > > ---
> > > 
> > > I think it will be easy to remove the other warnings if all the typedefs
> > > are removed first.
> > > 
> > >  drivers/staging/wilc1000/wilc_spi.c               | 2 +-
> > >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
> > >  2 files changed, 4 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
> > > index d0e7610..6d854fd 100644
> > > --- a/drivers/staging/wilc1000/wilc_spi.c
> > > +++ b/drivers/staging/wilc1000/wilc_spi.c
> > > @@ -404,7 +404,7 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
> > >  #undef NUM_DUMMY_BYTES
> > >  
> > >  	if (len2 > (sizeof(wb) / sizeof(wb[0]))) {
> > > -		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%d)\n",
> > > +		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%lu)\n",
> > 
> > Hi, it seems that the above line should use %zu too. Am I correct or I'm
> > missing something?
> oops. my mistake. %lu is correct but i missed mentioning the warning
> about long unsigned int in the commit message.

Why %lu here and %zu in other places? I mean that it is the same size_t
or I'm missing something?

 - konrad

> regards
> sudip

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] staging: wilc1000: fix warning while printing
  2015-06-02  8:58     ` Konrad Zapalowicz
@ 2015-06-02  9:01       ` Sudip Mukherjee
  0 siblings, 0 replies; 5+ messages in thread
From: Sudip Mukherjee @ 2015-06-02  9:01 UTC (permalink / raw)
  To: Konrad Zapalowicz
  Cc: Johnny Kim, Rachel Kim, Dean Lee, Chris Park, Greg Kroah-Hartman,
	devel, linux-wireless, linux-kernel

On Tue, Jun 02, 2015 at 10:58:40AM +0200, Konrad Zapalowicz wrote:
> On 06/02, Sudip Mukherjee wrote:
> > On Tue, Jun 02, 2015 at 10:29:17AM +0200, Konrad Zapalowicz wrote:
> > > On 06/02, Sudip Mukherjee wrote:
> > > > size_t should print using %zu, but here it was using %d and hence we
> > > > were getting warning while printing.
> > > > 
> > > > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > > > ---
> > > > 
> > > > I think it will be easy to remove the other warnings if all the typedefs
> > > > are removed first.
> > > > 
> > > >  drivers/staging/wilc1000/wilc_spi.c               | 2 +-
> > > >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
> > > >  2 files changed, 4 insertions(+), 4 deletions(-)
> > > > 
> > > > diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
> > > > index d0e7610..6d854fd 100644
> > > > --- a/drivers/staging/wilc1000/wilc_spi.c
> > > > +++ b/drivers/staging/wilc1000/wilc_spi.c
> > > > @@ -404,7 +404,7 @@ static int spi_cmd_complete(uint8_t cmd, uint32_t adr, uint8_t *b, uint32_t sz,
> > > >  #undef NUM_DUMMY_BYTES
> > > >  
> > > >  	if (len2 > (sizeof(wb) / sizeof(wb[0]))) {
> > > > -		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%d)\n",
> > > > +		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%lu)\n",
> > > 
> > > Hi, it seems that the above line should use %zu too. Am I correct or I'm
> > > missing something?
> > oops. my mistake. %lu is correct but i missed mentioning the warning
> > about long unsigned int in the commit message.
> 
> Why %lu here and %zu in other places? I mean that it is the same size_t
> or I'm missing something?
no, this is unsigned long int.
The warning here was:
drivers/staging/wilc1000/wilc_spi.c:407:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long unsigned int’ [-Wformat]

so size_t used %zu and unsigned long int should use %lu

regards
sudip
> 
>  - konrad
> 
> > regards
> > sudip

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-02  9:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-02  7:56 [PATCH] staging: wilc1000: fix warning while printing Sudip Mukherjee
2015-06-02  8:29 ` Konrad Zapalowicz
2015-06-02  8:35   ` Sudip Mukherjee
2015-06-02  8:58     ` Konrad Zapalowicz
2015-06-02  9:01       ` Sudip Mukherjee

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).