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]
Message-ID: <462E4764.6000107@garzik.org>
Date:	Tue, 24 Apr 2007 14:07:32 -0400
From:	Jeff Garzik <jeff@...zik.org>
To:	Stephen Hemminger <shemminger@...ux-foundation.org>
CC:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] netdev: get rid of casts

Stephen Hemminger wrote:
> The following casts are unnecessary, just passing void * will do.
> 
> Signed-off-by: Stephen Hemminger <shemminger@...ux-foundation.org>
> ---
>  net/core/dev.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 18c51b4..61e9da2 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1981,7 +1981,7 @@ int register_gifconf(unsigned int family, gifconf_func_t * gifconf)
>   *	match.  --pb
>   */
>  
> -static int dev_ifname(struct ifreq __user *arg)
> +static int dev_ifname(void __user *arg)
>  {
>  	struct net_device *dev;
>  	struct ifreq ifr;
> @@ -2014,7 +2014,7 @@ static int dev_ifname(struct ifreq __user *arg)
>   *	Thus we will need a 'compatibility mode'.
>   */
>  
> -static int dev_ifconf(char __user *arg)
> +static int dev_ifconf(void __user *arg)
>  {
>  	struct ifconf ifc;
>  	struct net_device *dev;
> @@ -2778,12 +2778,12 @@ int dev_ioctl(unsigned int cmd, void __user *arg)
>  
>  	if (cmd == SIOCGIFCONF) {
>  		rtnl_lock();
> -		ret = dev_ifconf((char __user *) arg);
> +		ret = dev_ifconf(arg);
>  		rtnl_unlock();
> -		return ret;
>  	}
> +
>  	if (cmd == SIOCGIFNAME)
> -		return dev_ifname((struct ifreq __user *)arg);
> +		return dev_ifname(arg);

Seems like a net loss of information, with your patch.

The casts are adding missing type information, in this case.  Certainly 
it is more for human consumption than compiler consumption, but 
nonetheless...

	Jeff



-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ