Linux wireless drivers development
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	b43-dev@lists.infradead.org
Subject: Re: [PATCH] bcma: extract revision and TX power IDs from SPROM
Date: Mon, 12 Dec 2011 12:06:04 -0800	[thread overview]
Message-ID: <1323720364.19538.11.camel@joe2Laptop> (raw)
In-Reply-To: <1323721992-3941-1-git-send-email-zajec5@gmail.com>

On Mon, 2011-12-12 at 21:33 +0100, Rafał Miłecki wrote:

Hi Rafał.

> diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c
[]
> @@ -136,6 +139,42 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom)
>  
>  	bus->sprom.board_rev = sprom[SPOFF(SSB_SPROM8_BOARDREV)];
>  
> +	bus->sprom.txpid2g[0] = (sprom[SPOFF(SSB_SPROM4_TXPID2G01)] &
> +	     SSB_SPROM4_TXPID2G0) >> SSB_SPROM4_TXPID2G0_SHIFT;

This is a bit "wall of uppercase text" for my taste.

Perhaps a macro like:

#define GET_SPROM(val, mask, shift)					\
	(sprom[SPOFF(SSB_SPROM4_TXPID##val)] & SSB_SPROM4_TXPID##mask) >>\
	SSB_SPROM4_TXPID##shift##_SHIFT;


So these become:

> +	bus->sprom.txpid2g[1] = (sprom[SPOFF(SSB_SPROM4_TXPID2G01)] &
> +	     SSB_SPROM4_TXPID2G1) >> SSB_SPROM4_TXPID2G1_SHIFT;
	bus->sprom.txpid2g[1] = GET_SPROM(2G01, 2G1, 2G1);

> +	bus->sprom.txpid2g[2] = (sprom[SPOFF(SSB_SPROM4_TXPID2G23)] &
> +	     SSB_SPROM4_TXPID2G2) >> SSB_SPROM4_TXPID2G2_SHIFT;

	bus->sprom.tpid2g[2] = GET_SPROM(2G23, 2G2, 2G2);

> +	bus->sprom.txpid2g[3] = (sprom[SPOFF(SSB_SPROM4_TXPID2G23)] &
> +	     SSB_SPROM4_TXPID2G3) >> SSB_SPROM4_TXPID2G3_SHIFT;

etc.



      reply	other threads:[~2011-12-12 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12 20:33 [PATCH] bcma: extract revision and TX power IDs from SPROM Rafał Miłecki
2011-12-12 20:06 ` Joe Perches [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=1323720364.19538.11.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=b43-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=zajec5@gmail.com \
    /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