linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tony Cho <tony.cho@atmel.com>
Cc: devel@driverdev.osuosl.org, rachel.kim@atmel.com,
	chris.park@atmel.com, austin.shin@atmel.com,
	linux-wireless@vger.kernel.org, johnny.kim@atmel.com,
	Nicolas.FERRE@atmel.com, robin.hwang@atmel.com,
	jude.lee@atmel.com, leo.kim@atmel.com
Subject: Re: [PATCH 24/28] staging: wilc1000: fix cast from pointer to integer warning
Date: Fri, 31 Jul 2015 13:51:23 -0700	[thread overview]
Message-ID: <20150731205123.GD1650@kroah.com> (raw)
In-Reply-To: <1438328316-30197-25-git-send-email-tony.cho@atmel.com>

On Fri, Jul 31, 2015 at 04:38:32PM +0900, Tony Cho wrote:
> From: glen lee <glen.lee@atmel.com>
> 
> To use a pointer as as integer in arithmetic operation, cast type to uintptr_t
> as the data type.
> This patch changes casting (unsigned int) with (uintptr_t) to do arithmetic operation
> 
> Here is build warning.
> drivers/staging/wilc1000/linux_wlan.c:2385:20: warning: cast from pointer to
> integer of different size [-Wpointer-to-int-cast]
>    skb_reserve(skb, (unsigned int)skb->data & 0x3);
> 
> Signed-off-by: glen lee <glen.lee@atmel.com>
> Signed-off-by: Tony Cho <tony.cho@atmel.com>
> ---
>  drivers/staging/wilc1000/linux_wlan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
> index 5dcb30c..ec80849 100644
> --- a/drivers/staging/wilc1000/linux_wlan.c
> +++ b/drivers/staging/wilc1000/linux_wlan.c
> @@ -2382,7 +2382,7 @@ void frmw_to_linux(uint8_t *buff, uint32_t size, uint32_t pkt_offset)
>  			return;
>  		}
>  
> -		skb_reserve(skb, (unsigned int)skb->data & 0x3);
> +		skb_reserve(skb, (uintptr_t)skb->data & 0x3);

Why is a cast needed at all here?

And again, don't use uintptr_t, it is not a kernel type.

I've stopped reviewing here, sorry, please fix up the series and resend.

thanks,

greg k-h

  reply	other threads:[~2015-07-31 20:51 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31  7:38 [PATCH 00/28] removing the compile warnings for 64-bit Tony Cho
2015-07-31  7:38 ` [PATCH 01/28] staging: wilc1000: change type of driver handler in host interface msg Tony Cho
2015-07-31 20:46   ` Greg KH
2015-07-31  7:38 ` [PATCH 02/28] staging: wilc1000: change void type of argument with WILC_WFIDrvHandle Tony Cho
2015-07-31 20:46   ` Greg KH
2015-07-31  7:38 ` [PATCH 03/28] staging: wilc1000: move structure WILC_WFIDrvHandle into wilc_wlan_if.h Tony Cho
2015-07-31  7:38 ` [PATCH 04/28] staging: wilc1000: change type of argument 5 in SendConfigPkt Tony Cho
2015-07-31  7:38 ` [PATCH 05/28] staging: wilc1000: remove unnecessary type cast Tony Cho
2015-07-31  7:38 ` [PATCH 06/28] staging: wilc1000: chage driver handler variable in SendConfigPkt Tony Cho
2015-07-31  7:38 ` [PATCH 07/28] staging: wilc1000: remove unused variables Tony Cho
2015-07-31  7:38 ` [PATCH 08/28] staging: wilc1000: change drvHandler type in wlan_cfg_get Tony Cho
2015-07-31  7:38 ` [PATCH 09/28] staging: wilc1000: change drvHandler type in wlan_cfg_set Tony Cho
2015-07-31  7:38 ` [PATCH 10/28] staging: wilc1000: change driver handle variable Tony Cho
2015-07-31  7:38 ` [PATCH 11/28] staging: wilc1000: fix incompatible type in assignment warning Tony Cho
2015-07-31  7:38 ` [PATCH 12/28] staging: wilc1000: change type of driver handler in tstrInterfaceInfo Tony Cho
2015-07-31  7:38 ` [PATCH 13/28] staging: wilc1000: change type of argument in host_int_set_wfi_drv_handler Tony Cho
2015-07-31  7:38 ` [PATCH 14/28] staging: wilc1000: remove unnecessary type cast " Tony Cho
2015-07-31  7:38 ` [PATCH 15/28] staging: wilc1000: fix cast from pointer to integer warning Tony Cho
2015-07-31  7:38 ` [PATCH 16/28] staging: wilc1000: change type of variable Tony Cho
2015-07-31  7:38 ` [PATCH 17/28] staging: wilc1000: fix comparison between different type warning Tony Cho
2015-07-31  7:38 ` [PATCH 18/28] staging: wilc1000: change pstrWFIDrv with drvHandler Tony Cho
2015-07-31  7:38 ` [PATCH 19/28] staging: wilc1000: change type of variable in tstrHostIfSetDrvHandler Tony Cho
2015-07-31  7:38 ` [PATCH 20/28] staging: wilc1000: remove unnecessary type case Tony Cho
2015-07-31  7:38 ` [PATCH 21/28] staging: wilc1000: remove unwanted type cast Tony Cho
2015-07-31  7:38 ` [PATCH 22/28] staging: wilc1000: fix passing argument from incompatible type warning Tony Cho
2015-07-31  7:38 ` [PATCH 23/28] staging: wilc1000: change type of parameter in wilc_wlan_cfg_commit Tony Cho
2015-07-31  7:38 ` [PATCH 24/28] staging: wilc1000: fix cast from pointer to integer warning Tony Cho
2015-07-31 20:51   ` Greg KH [this message]
2015-07-31  7:38 ` [PATCH 25/28] staging: wilc1000: change cast type from pointer to uintptr_t Tony Cho
2015-07-31 20:50   ` Greg KH
2015-07-31  7:38 ` [PATCH 26/28] staging: wilc1000: remove unused variable Tony Cho
2015-07-31  7:38 ` [PATCH 27/28] staging: wilc1000: fix casting build warning Tony Cho
2015-07-31  7:38 ` [PATCH 28/28] staging: wilc1000: change data type of variable Tony Cho
2015-07-31 20:48   ` Greg KH
2015-07-31 12:49 ` [PATCH 00/28] removing the compile warnings for 64-bit Sudip Mukherjee

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=20150731205123.GD1650@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Nicolas.FERRE@atmel.com \
    --cc=austin.shin@atmel.com \
    --cc=chris.park@atmel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=johnny.kim@atmel.com \
    --cc=jude.lee@atmel.com \
    --cc=leo.kim@atmel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=rachel.kim@atmel.com \
    --cc=robin.hwang@atmel.com \
    --cc=tony.cho@atmel.com \
    /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).