netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH] netdev: get rid of casts
Date: Tue, 24 Apr 2007 14:07:32 -0400	[thread overview]
Message-ID: <462E4764.6000107@garzik.org> (raw)
In-Reply-To: <20070424104650.3523479d@dxpl.pdx.osdl.net>

Stephen Hemminger wrote:
> The following casts are unnecessary, just passing void * will do.
> 
> Signed-off-by: Stephen Hemminger <shemminger@linux-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




  reply	other threads:[~2007-04-24 18:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-24 17:46 [PATCH] netdev: get rid of casts Stephen Hemminger
2007-04-24 18:07 ` Jeff Garzik [this message]
2007-04-24 21:53   ` David Miller
2007-04-25  0:56   ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=462E4764.6000107@garzik.org \
    --to=jeff@garzik.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).