lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 Jul 2007 18:27:40 +0200
From:	Jiri Benc <jbenc@...e.cz>
To:	Larry Finger <larry.finger@...inger.net>
Cc:	David Miller <davem@...emloft.net>, linville@...driver.com,
	linux-wireless@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v2] mac80211: fix GCC warning on 64bit platforms

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 netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists