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  linux-cve-announce  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 11:14:40 -0500
From:	Larry Finger <larry.finger@...inger.net>
To:	Jiri Benc <jbenc@...e.cz>
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

Jiri Benc wrote:
> net/mac80211/ieee80211.c: In function ieee80211_register_hw:
> net/mac80211/ieee80211.c:4989: warning: comparison of distinct pointer types lacks a cast
> 
> Size of ieee80211_tx_status_rtap_hdr structure will never be greater than
> unsigned int.
> 
> Signed-off-by: Jiri Benc <jbenc@...e.cz>
> 
> ---
> 
> On Mon, 16 Jul 2007 14:53:58 -0700 (PDT), David Miller wrote:
>> The macro "max_t" exists for these kinds of situations, please
>> use it. :-)
> 
> Ok.
> 
> ---
>  net/mac80211/ieee80211.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- mac80211-2.6.orig/net/mac80211/ieee80211.c
> +++ mac80211-2.6/net/mac80211/ieee80211.c
> @@ -4986,8 +4986,8 @@ int ieee80211_register_hw(struct ieee802
>  	 * and we need some headroom for passing the frame to monitor
>  	 * interfaces, but never both at the same time.
>  	 */
> -	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'? (2) Because tx_headroom is an int, why use unsigned at all?

Larry
-
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