netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: roel.kluin@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: fix SONIC_READ definition
Date: Sun, 04 Jan 2009 22:42:39 -0800 (PST)	[thread overview]
Message-ID: <20090104.224239.64637126.davem@davemloft.net> (raw)
In-Reply-To: <495FB1CC.5090506@gmail.com>

From: Roel Kluin <roel.kluin@gmail.com>
Date: Sat, 03 Jan 2009 19:43:24 +0100

> drivers/net/jazzsonic.c:56:
> #define SONIC_READ(reg) (*((volatile unsigned int *)dev->base_addr+reg))
> 
> drivers/net/sonic.h:53:
> #define SONIC_CAP0             0x24
> 
> so drivers/net/jazzsonic.c:143:
> val = SONIC_READ(SONIC_CAP0-i);
> 
> becomes
> 
> val = (*((volatile unsigned int *)dev->base_addr+0x24-i));
> 
> That is wrong, isn't it?

The expression, both with and without the parentheses around "reg",
evaluate to the same final pointer value.

Compile a test program and look at the assembler output if you
don't believe me :-)

      reply	other threads:[~2009-01-05  6:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-03 18:43 [PATCH] net: fix SONIC_READ definition Roel Kluin
2009-01-05  6:42 ` David Miller [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=20090104.224239.64637126.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=roel.kluin@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;
as well as URLs for NNTP newsgroup(s).