From: "Rustad, Mark D" <mark.d.rustad@intel.com>
To: Joe Perches <joe@perches.com>
Cc: "Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
David Miller <davem@davemloft.net>,
"<netdev@vger.kernel.org>" <netdev@vger.kernel.org>,
"gospo@redhat.com" <gospo@redhat.com>,
"sassmann@redhat.com" <sassmann@redhat.com>
Subject: Re: [net-next v2 03/11] ixgbe: Use static inlines instead of macros
Date: Fri, 3 Jan 2014 18:31:38 +0000 [thread overview]
Message-ID: <F2605A6D-0AC1-4507-9E85-AB89599C36BB@intel.com> (raw)
In-Reply-To: <1388726884.2527.4.camel@joe-AO722>
[-- Attachment #1: Type: text/plain, Size: 1697 bytes --]
On Jan 2, 2014, at 9:28 PM, Joe Perches <joe@perches.com> wrote:
> On Thu, 2014-01-02 at 21:18 -0800, Jeff Kirsher wrote:
>> From: Mark Rustad <mark.d.rustad@intel.com>
> []
>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
> []
>> @@ -124,22 +124,31 @@ s32 ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw);
>> #ifndef writeq
>> #define writeq(val, addr) writel((u32) (val), addr); \
>> writel((u32) (val >> 32), (addr + 4));
>> #endif
>
> This is unchanged, but it would be nicer with a do {} while.
Yes, it is definitely a trap for a macro to directly generate two statements like this. The #ifdef check seemed a little dubious to me when I first saw it, but at the time I chose to stick to what I had to do and then forgot to revisit this.
> #ifndef writeq
> #define writeq(val, addr) \
> do { \
> writel((u32)(val), addr); \
> writel((u32)((val) >> 32), (addr + 4)); \
> } while (0)
Now that I have looked into it, I only fear becoming a "mucking foron" by touching it at all! :-) (grep the alpha arch code) Lacking an ARCH_HAS macro for detecting writeq, it does appear that this check is currently the way to do it, though it probably makes no sense whatsoever to compile this driver for any architecture that is not defining writeq. I wonder how many of these sequences were added in support of randconfig?
> Even then, this could be nicer as an inline too.
It does appear that the other places checking for writeq are being implemented with static inlines, so that should be the preferred method here as well.
--
Mark Rustad, Networking Division, Intel Corporation
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 841 bytes --]
next prev parent reply other threads:[~2014-01-03 18:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-03 5:18 [net-next v2 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 01/11] ixbge: Protect ixgbe_down with __IXGBE_DOWN bit Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 02/11] ixgbe: Indicate removal state explicitly Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 03/11] ixgbe: Use static inlines instead of macros Jeff Kirsher
2014-01-03 5:28 ` Joe Perches
2014-01-03 18:31 ` Rustad, Mark D [this message]
2014-01-03 5:18 ` [net-next v2 04/11] ixgbe: Make ethtool register test use accessors Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 05/11] ixgbe: Check register reads for adapter removal Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 06/11] ixgbe: Check for adapter removal on register writes Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 07/11] ixgbe: Additional adapter removal checks Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 08/11] ixgbe: Add Live Error Recovery configuration option Jeff Kirsher
2014-01-04 1:43 ` David Miller
2014-01-03 5:18 ` [net-next v2 09/11] net: e1000e calls skb_set_hash Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 10/11] net: igb " Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 11/11] igb: make local functions static and remove dead code Jeff Kirsher
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=F2605A6D-0AC1-4507-9E85-AB89599C36BB@intel.com \
--to=mark.d.rustad@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=joe@perches.com \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.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