linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Kilroy <kilroyd@googlemail.com>
To: Andrea Merello <andrea.merello@gmail.com>,
	dan.carpenter@oracle.com, linville@tuxdriver.com
Cc: johannes@sipsolutions.net, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] rtl8180: don't use weird trick to access "far" registers
Date: Wed, 02 Apr 2014 20:24:06 +0100	[thread overview]
Message-ID: <533C63D6.5000109@gmail.com> (raw)
In-Reply-To: <1396026868-5622-1-git-send-email-andrea.merello@gmail.com>

On 28/03/2014 17:14, Andrea Merello wrote:
> @@ -340,9 +334,9 @@ struct rtl818x_csr {
>    * I don't like to introduce a ton of "reserved"..
>    * They are for RTL8187SE
>    */
> -#define REG_ADDR1(addr)	((u8 __iomem *)(&priv->map->offset1[(addr)]))
> -#define REG_ADDR2(addr)	((__le16 __iomem *)(&priv->map->offset2[((addr) >> 1)]))
> -#define REG_ADDR4(addr)	((__le32 __iomem *)(&priv->map->offset4[((addr) >> 2)]))
> +#define REG_ADDR1(addr)	((u8 __iomem *)priv->map + addr)
> +#define REG_ADDR2(addr)	((__le16 __iomem *)priv->map + (addr >> 1))
> +#define REG_ADDR4(addr)	((__le32 __iomem *)priv->map + (addr >> 2))
>   
>   #define FEMR_SE		REG_ADDR2(0x1D4)
>   #define ARFR		REG_ADDR2(0x1E0)
I suggest parenthesizing the use of addr in your macros (as the original 
code does), to avoid any issues with operator precedence wrt >>.

If the removal was intentional and you've verified there's no issues, 
you should probably mention it in the commit message.


Dave.

  reply	other threads:[~2014-04-02 19:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140328093038.GD7045@mwanda>
2014-03-28 17:14 ` [PATCH 2/2] rtl8180: don't use weird trick to access "far" registers Andrea Merello
2014-04-02 19:24   ` Dave Kilroy [this message]
2014-04-04 16:24     ` [PATCH 3/4] rtl8180: add parentheses to REG_ADDR macros Andrea Merello

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=533C63D6.5000109@gmail.com \
    --to=kilroyd@googlemail.com \
    --cc=andrea.merello@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).