From: Joe Perches <joe@perches.com>
To: Roland Vossen <rvossen@broadcom.com>
Cc: gregkh@suse.de, devel@linuxdriverproject.org,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH 12/12] staging: brcm80211: cleaned up softmac srom macro
Date: Fri, 02 Sep 2011 08:49:23 -0700 [thread overview]
Message-ID: <1314978563.1773.13.camel@Joe-Laptop> (raw)
In-Reply-To: <1314972039-27098-13-git-send-email-rvossen@broadcom.com>
On Fri, 2011-09-02 at 16:00 +0200, Roland Vossen wrote:
> Substituted macro.
[]
> diff --git a/drivers/staging/brcm80211/brcmsmac/srom.c b/drivers/staging/brcm80211/brcmsmac/srom.c
[]
> @@ -792,6 +780,14 @@ static const struct brcms_sromvar perpath_pci_sromvars[] = {
>
> static u8 srom_crc8_table[CRC8_TABLE_SIZE];
>
> +static u8 *srom_window_address(struct si_pub *sih, void *curmap)
> +{
> + return sih->ccrev > 31 ?
> + (((sih->cccaps & CC_CAP_SROM) == 0) ? NULL :
> + ((u8 *)curmap + PCI_16KB0_CCREGS_OFFSET + CC_SROM_OTP)) :
> + ((u8 *)curmap + PCI_BAR0_SPROM_OFFSET);
> +}
Please try to make code more readable when
converting to functions too.
Maybe:
static u16 *srom_window_address(struct si_pub *sih, u8 *curmap)
{
if (sih->ccrev < 32)
return (u16 *)(curmap + PCI_BAR0_SPROM_OFFSET);
if (sih->cccaps & CC_CAP_SROM)
return (u16 *)(curmap + PCI_16KB0_CCREGS_OFFSET + CC_SROM_OTP);
return NULL;
}
> @@ -1147,7 +1143,7 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
> if (!srom)
> return -ENOMEM;
>
> - sromwindow = (u16 *) SROM_OFFSET(sih);
> + sromwindow = (u16 *) srom_window_address(sih, curmap);
sromwindow = srom_window_address(sih, curmap)
next prev parent reply other threads:[~2011-09-02 15:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-02 14:00 [PATCH 00/12] staging: brcm80211: 3rd reaction to mainline patch #2 Roland Vossen
2011-09-02 14:00 ` [PATCH 01/12] staging: brcm80211: remove extern keyword from function definition Roland Vossen
2011-09-02 14:00 ` [PATCH 02/12] staging: brcm80211: replace 0 integer with NULL pointer Roland Vossen
2011-09-02 14:00 ` [PATCH 03/12] staging: brcm80211: use address space qualifier in brcmfmac Roland Vossen
2011-09-02 14:00 ` [PATCH 04/12] staging: brcm80211: remove sparse warning from main.c Roland Vossen
2011-09-02 14:00 ` [PATCH 05/12] staging: brcm80211: remove 'default n' from Kconfig Roland Vossen
2011-09-02 14:00 ` [PATCH 06/12] staging: brcm80211: cleaned up softmac phy macro's affecting code flow Roland Vossen
2011-09-02 14:00 ` [PATCH 07/12] staging: brcm80211: cleaned up softmac nicpci.c/nicpci.h macro's Roland Vossen
2011-09-02 14:00 ` [PATCH 08/12] staging: brcm80211: cleaned up more softmac macro's Roland Vossen
2011-09-02 14:00 ` [PATCH 09/12] staging: brcm80211: remove AP related code from softmac Roland Vossen
2011-09-02 14:00 ` [PATCH 10/12] staging: brcm80211: cleaned up softmac pub.h macro's Roland Vossen
2011-09-02 14:00 ` [PATCH 11/12] staging: brcm80211: cleaned up softmac scb.h macro's Roland Vossen
2011-09-02 14:00 ` [PATCH 12/12] staging: brcm80211: cleaned up softmac srom macro Roland Vossen
2011-09-02 15:49 ` Joe Perches [this message]
2011-09-02 20:31 ` Roland Vossen
2011-09-05 8:06 ` Roland Vossen
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=1314978563.1773.13.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@suse.de \
--cc=linux-wireless@vger.kernel.org \
--cc=rvossen@broadcom.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;
as well as URLs for NNTP newsgroup(s).