All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "John Anthony Kazos Jr." <jakj@j-a-k-j.com>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
	"Cameron, Steve" <Steve.Cameron@hp.com>,
	"Miller, Mike (OS Dev)" <Mike.Miller@hp.com>,
	Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>,
	jens.axboe@oracle.com, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org, trivial@kernel.org
Subject: Re: [PATCH] utilities: add helper functions for safe 64-bit integer operations as 32-bit halves
Date: Sat, 21 Apr 2007 03:08:25 -0700	[thread overview]
Message-ID: <20070421030825.bed0b8a9.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.0.98.0704202040150.16687@sigma.j-a-k-j.com>

On Fri, 20 Apr 2007 20:55:49 -0400 (EDT) "John Anthony Kazos Jr." <jakj@j-a-k-j.com> wrote:

> +#define upper_32_bits(n) (sizeof(n) == 8 ? (u64)(n) >> 32 : 0)

It's very unclear what type this returns, in terms of both size and
signedness.  Perhaps it always returns a u64, dunno.  If it does, that will
cause the arithmetic which uses this macro to go 64-bit too.  Casting the
whole return value to u32 would fix all those doubts up.

> +#define lower_32_bits(n) (sizeof(n) == 8 ? (u32)(n) : (n))

n&0xffffffff would be simpler.

Do we actually have any call for this?

  reply	other threads:[~2007-04-21 10:09 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6.0.0.20.2.20070418160231.043f23c8@172.19.0.2>
2007-04-19 15:09 ` [PATCH] cciss: Fix warnings during compilation under 32bit environment Miller, Mike (OS Dev)
2007-04-19 15:09   ` Miller, Mike (OS Dev)
2007-04-19 15:18   ` James Bottomley
2007-04-19 15:18     ` James Bottomley
2007-04-19 16:12     ` Miller, Mike (OS Dev)
2007-04-19 16:12       ` Miller, Mike (OS Dev)
2007-04-19 16:22       ` James Bottomley
2007-04-19 16:26         ` [PATCH] cciss: Fix warnings during compilation under 32bitenvironment Miller, Mike (OS Dev)
2007-04-19 16:26           ` Miller, Mike (OS Dev)
2007-04-19 16:27         ` Cameron, Steve
2007-04-19 16:27           ` Cameron, Steve
2007-04-20  5:20           ` Andrew Morton
2007-04-20  5:20             ` Andrew Morton
2007-04-20 13:10             ` James Bottomley
2007-04-20 13:36               ` Alan Cox
2007-04-20 18:43               ` Andrew Morton
2007-04-20 18:50                 ` James Bottomley
2007-04-20 19:30                   ` Andrew Morton
2007-04-20 20:20                     ` James Bottomley
2007-04-20 21:12                       ` Andrew Morton
2007-04-20 21:39                         ` John Anthony Kazos Jr.
2007-04-21  0:55                           ` [PATCH] utilities: add helper functions for safe 64-bit integer operations as 32-bit halves John Anthony Kazos Jr.
2007-04-21 10:08                             ` Andrew Morton [this message]
2007-04-21 13:06                               ` John Anthony Kazos Jr.
2007-04-21 21:01                               ` Alan Cox
2007-04-21 21:06                                 ` Andrew Morton
2007-04-22  9:18                                   ` Christoph Hellwig
2007-04-22 12:38                                     ` Alan Cox
2007-04-22 12:35                                       ` Christoph Hellwig

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=20070421030825.bed0b8a9.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=Mike.Miller@hp.com \
    --cc=Steve.Cameron@hp.com \
    --cc=hifumi.hisashi@oss.ntt.co.jp \
    --cc=jakj@j-a-k-j.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=trivial@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.