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: <20070823010826.6ae3452d@localhost.localdomain>
Date:	Thu, 23 Aug 2007 01:08:26 +0400
From:	Vitaly Bordug <vitb@...nel.crashing.org>
To:	Scott Wood <scottwood@...escale.com>
Cc:	jgarzik@...ox.com, netdev@...r.kernel.org, linuxppc-dev@...abs.org
Subject: Re: [PATCH 4/7] fs_enet: mac-fcc: Eliminate __fcc-* macros.

On Fri, 17 Aug 2007 12:54:02 -0500
Scott Wood wrote:

> These macros accomplish nothing other than defeating type checking.
> 
> This patch also fixes one instance of the wrong register size being
> used that was revealed by enabling type checking.
> 
> Signed-off-by: Scott Wood <scottwood@...escale.com>
> ---
>  drivers/net/fs_enet/mac-fcc.c |   25 ++++++++-----------------
>  1 files changed, 8 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/fs_enet/mac-fcc.c
> b/drivers/net/fs_enet/mac-fcc.c index ad3c5fa..8b30361 100644
> --- a/drivers/net/fs_enet/mac-fcc.c
> +++ b/drivers/net/fs_enet/mac-fcc.c
> @@ -48,28 +48,19 @@
>  
>  /* FCC access macros */
>  
> -#define __fcc_out32(addr, x)	out_be32((unsigned *)addr, x)
> -#define __fcc_out16(addr, x)	out_be16((unsigned short *)addr,
> x) -#define __fcc_out8(addr, x)	out_8((unsigned char *)addr, x)
> -#define __fcc_in32(addr)	in_be32((unsigned *)addr)
> -#define __fcc_in16(addr)	in_be16((unsigned short *)addr)
> -#define __fcc_in8(addr)		in_8((unsigned char *)addr)
> -
> -/* parameter space */
> -
>  /* write, read, set bits, clear bits */
> -#define W32(_p, _m, _v)	__fcc_out32(&(_p)->_m, (_v))
> -#define R32(_p, _m)	__fcc_in32(&(_p)->_m)
> +#define W32(_p, _m, _v)	out_be32(&(_p)->_m, (_v))
> +#define R32(_p, _m)	in_be32(&(_p)->_m)
>  #define S32(_p, _m, _v)	W32(_p, _m, R32(_p, _m) | (_v))
>  #define C32(_p, _m, _v)	W32(_p, _m, R32(_p, _m) & ~(_v))
>  
> -#define W16(_p, _m, _v)	__fcc_out16(&(_p)->_m, (_v))
> -#define R16(_p, _m)	__fcc_in16(&(_p)->_m)
> +#define W16(_p, _m, _v)	out_be16(&(_p)->_m, (_v))
> +#define R16(_p, _m)	in_be16(&(_p)->_m)
>  #define S16(_p, _m, _v)	W16(_p, _m, R16(_p, _m) | (_v))
>  #define C16(_p, _m, _v)	W16(_p, _m, R16(_p, _m) & ~(_v))
>  
> -#define W8(_p, _m, _v)	__fcc_out8(&(_p)->_m, (_v))
> -#define R8(_p, _m)	__fcc_in8(&(_p)->_m)
> +#define W8(_p, _m, _v)	out_8(&(_p)->_m, (_v))
> +#define R8(_p, _m)	in_8(&(_p)->_m)
>  #define S8(_p, _m, _v)	W8(_p, _m, R8(_p, _m) | (_v))
>  #define C8(_p, _m, _v)	W8(_p, _m, R8(_p, _m) & ~(_v))
>  
> @@ -290,7 +281,7 @@ static void restart(struct net_device *dev)
>  
>  	/* clear everything (slow & steady does it) */
>  	for (i = 0; i < sizeof(*ep); i++)
> -		__fcc_out8((char *)ep + i, 0);
> +		out_8((char *)ep + i, 0);
>  
Perhaps W8() here, to keep consistency?


>  	/* get physical address */
>  	rx_bd_base_phys = fep->ring_mem_addr;
> @@ -495,7 +486,7 @@ static void tx_kickstart(struct net_device *dev)
>  	struct fs_enet_private *fep = netdev_priv(dev);
>  	fcc_t *fccp = fep->fcc.fccp;
>  
> -	S32(fccp, fcc_ftodr, 0x80);
> +	S16(fccp, fcc_ftodr, 0x8000);
>  }
>  
>  static u32 get_int_events(struct net_device *dev)


-- 
Sincerely, Vitaly
-
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