All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Al Viro <viro@ftp.linux.org.uk>,
	Francois Romieu <romieu@fr.zoreil.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] via-velocity: more cleanup
Date: Sat, 29 Sep 2007 01:28:12 -0400	[thread overview]
Message-ID: <46FDE26C.6010000@garzik.org> (raw)
In-Reply-To: <20070824144045.087d41ff@freepuppy.rosehill.hemminger.net>

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@linux-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.


      parent reply	other threads:[~2007-09-29  5:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-24 20:56 [PATCH] via-velocity: use standard VLAN interface (resend) Stephen Hemminger
2007-08-24 21:15 ` Al Viro
2007-08-24 21:40   ` [PATCH] via-velocity: more cleanup Stephen Hemminger
2007-08-25  1:18     ` Al Viro
2007-09-29  5:28     ` Jeff Garzik [this message]

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=46FDE26C.6010000@garzik.org \
    --to=jeff@garzik.org \
    --cc=netdev@vger.kernel.org \
    --cc=romieu@fr.zoreil.com \
    --cc=shemminger@linux-foundation.org \
    --cc=viro@ftp.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.