All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Dietsche <gregory.dietsche@cuw.edu>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: gregkh@suse.de, mfuzzey@gmail.com, tom.leiming@gmail.com,
	ak@linux.intel.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: fix warning in usbtest module
Date: Sun, 08 May 2011 14:12:59 -0500	[thread overview]
Message-ID: <4DC6EB3B.8070604@cuw.edu> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1105081033140.30441-100000@netrider.rowland.org>

On 05/08/2011 09:37 AM, Alan Stern wrote:
> On Sat, 7 May 2011, Greg Dietsche wrote:
>
>    
>> On amd64 unsigned is not as wide as pointer and this causes
>> a compiler warning. Switching to uintptr_t fixes the problem
>> in an arch independent manner.
>>      
> People tend to prefer to see non-typedef'ed type names, whenever
> possible.  In this case, it would be enough to change the type to
> unsigned long.
>
> Lots of code throughout the kernel stores pointer values in unsigned
> long variables.  I've never heard any recommendation for using
> uintptr_t instead.
>
>    
I was leaning towards unsigned long at first too, but a several things 
made me reconsider:
1) uintptr_t adapts correctly to the size of a pointer on all 
architectures per C99
2) I greped the kernel source and found a number of instances where 
uintptr_t is used
3) unsigned long is technically too wide (though this is better than too 
small...) for some architectures

If the general consensus is that unsigned long is a better choice for 
the kernel, I will update my patch. I do, however think that uintptr_t 
is the best choice from a technical perspective and prefer it over 
unsigned long.

Thanks,
Greg


  reply	other threads:[~2011-05-08 19:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-08  3:27 [PATCH] usb: fix warning in usbtest module Greg Dietsche
2011-05-08 14:37 ` Alan Stern
2011-05-08 19:12   ` Greg Dietsche [this message]
2011-05-08 22:58     ` Greg KH
2011-05-09  3:51       ` [PATCH] usb: fix warning in usbtest module v2 Greg Dietsche
2011-05-09  4:02       ` [PATCH] usb: fix warning in usbtest module Greg Dietsche

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=4DC6EB3B.8070604@cuw.edu \
    --to=gregory.dietsche@cuw.edu \
    --cc=ak@linux.intel.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mfuzzey@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --cc=tom.leiming@gmail.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 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.