Thread (1 message) 1 message, 1 author, 2007-07-18

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

From: Jiri Benc <hidden>
Date: 2007-07-18 16:27:40
Also in: linux-wireless

On Wed, 18 Jul 2007 11:14:40 -0500, Larry Finger wrote:
quoted
-	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help