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] [day] [month] [year] [list]
Message-ID: <46FDE26C.6010000@garzik.org>
Date:	Sat, 29 Sep 2007 01:28:12 -0400
From:	Jeff Garzik <jeff@...zik.org>
To:	Stephen Hemminger <shemminger@...ux-foundation.org>
CC:	Al Viro <viro@....linux.org.uk>,
	Francois Romieu <romieu@...zoreil.com>, netdev@...r.kernel.org
Subject: Re: [PATCH] via-velocity: more cleanup

Stephen Hemminger wrote:
> Per Al's suggestion, get rid of the stupid stuff:
> Remove cam_type switch,
> And deinline things that aren't important for speed.
> And make big macro and inline.
> And remove some dead/unused code.
> And use const char * for chip name.
> 
> Signed-off-by: Stephen Hemminger <shemminger@...ux-foundation.org>
> 
> 
> --- a/drivers/net/via-velocity.c	2007-08-24 13:49:17.000000000 -0700
> +++ b/drivers/net/via-velocity.c	2007-08-24 14:39:14.000000000 -0700
> @@ -85,6 +85,163 @@
>  static int velocity_nics = 0;
>  static int msglevel = MSG_LEVEL_INFO;
>  
> +/**
> + *	mac_get_cam_mask	-	Read a CAM mask
> + *	@regs: register block for this velocity
> + *	@mask: buffer to store mask
> + *
> + *	Fetch the mask bits of the selected CAM and store them into the
> + *	provided mask buffer.
> + */
> +
> +static void mac_get_cam_mask(struct mac_regs __iomem * regs, u8 * mask)
> +{
> +	int i;
> +
> +	/* Select CAM mask */
> +	BYTE_REG_BITS_SET(CAMCR_PS_CAM_MASK, CAMCR_PS1 | CAMCR_PS0, &regs->CAMCR);
> +
> +	writeb(0, &regs->CAMADDR);
> +
> +	/* read mask */
> +	for (i = 0; i < 8; i++)
> +		*mask++ = readb(&(regs->MARCAM[i]));
> +
> +	/* disable CAMEN */
> +	writeb(0, &regs->CAMADDR);
> +
> +	/* Select mar */
> +	BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, &regs->CAMCR);
> +
> +}
> +
> +
> +/**
> + *	mac_set_cam_mask	-	Set a CAM mask
> + *	@regs: register block for this velocity
> + *	@mask: CAM mask to load
> + *
> + *	Store a new mask into a CAM
> + */
> +
> +static void mac_set_cam_mask(struct mac_regs __iomem * regs, u8 * mask)
> +{
> +	int i;
> +	/* Select CAM mask */
> +	BYTE_REG_BITS_SET(CAMCR_PS_CAM_MASK, CAMCR_PS1 | CAMCR_PS0, &regs->CAMCR);
> +
> +	writeb(CAMADDR_CAMEN, &regs->CAMADDR);
> +
> +	for (i = 0; i < 8; i++) {
> +		writeb(*mask++, &(regs->MARCAM[i]));
> +	}
> +	/* disable CAMEN */
> +	writeb(0, &regs->CAMADDR);
> +
> +	/* Select mar */
> +	BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, &regs->CAMCR);
> +}


I applied both your via-velocity cleanups.  For future patches, please 
always separate code movement into a separate patch from other cleanups.

-
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