Search Linux Wireless

Re: [PATCH v2] mac80211: fix GCC warning on 64bit platforms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 18 Jul 2007 11:14:40 -0500, Larry Finger wrote:
> > -	local->tx_headroom = max(local->hw.extra_tx_headroom,
> > -				 sizeof(struct ieee80211_tx_status_rtap_hdr));
> > +	local->tx_headroom = max_t(unsigned, local->hw.extra_tx_headroom,
> > +				   sizeof(struct ieee80211_tx_status_rtap_hdr));
> >  
> >  	debugfs_hw_add(local);
> 
> For my info on how to use max_t, not as a critique of this patch.
> (1) Is 'unsigned' enough or should it be 'unsigned int'?

Don't know. For a C compiler, it doesn't matter, but it's fact that
most of the code in the kernel uses "unsigned int".

> (2) Because tx_headroom is an int, why use unsigned at all?

Because hw.extra_tx_headroom is unsigned. tx_headroom should be IMO
unsigned too but that's not just a matter of changing its type as it
would mean a lot of new warnings. We're talking about numbers several
orders less than int, so it's not an issue here anyway.

If you think "int" is more appropriate, fine with me, I don't really
care.

 Jiri

-- 
Jiri Benc
SUSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux