mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'Joe Perches'" <joe@perches.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [RFC PATCH] intel: Use upper_32_bits and lower_32_bits
Date: Mon, 9 Jan 2017 12:55:43 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DB025AC14@AcuExch.aculab.com> (raw)
In-Reply-To: <7a5cfe63cad3ef4badc30cbc2185a5bfb9250fd8.1483813334.git.joe@perches.com>

From: Joe Perches
> Sent: 07 January 2017 18:33
> Shifting and masking various types can be made a bit
> simpler to read by using the available kernel macros.
...
> -		ew32(TDBAH, (tdba >> 32));
> -		ew32(TDBAL, (tdba & 0x00000000ffffffffULL));
> +		ew32(TDBAH, upper_32_bits(tdba));
> +		ew32(TDBAL, lower_32_bits(tdba));

Personally I find the original code easier to understand
since I don't have to look up another silly macro.

I'd normally not even explicitly mask the low bits
relying on the implicit truncation of the assignment.

At least modern compilers aren't stupid enough to add two
'mask with 0xff' instructions for:
	*uchar_ptr = (unsigned char)(foo & 0xff);

	David

  parent reply	other threads:[~2017-01-09 12:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-07 18:32 Joe Perches
2017-01-07 22:20 ` Julia Lawall
2017-01-09 12:55 ` David Laight [this message]
2017-01-09 13:33   ` Joe Perches

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=063D6719AE5E284EB5DD2968C1650D6DB025AC14@AcuExch.aculab.com \
    --to=david.laight@aculab.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=joe@perches.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®