From: Thierry Reding <thierry.reding@gmail.com>
To: Tejun Heo <tj@kernel.org>
Cc: "Antoine Ténart" <antoine.tenart@free-electrons.com>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ata: libahci: Make host flags unsigned long
Date: Fri, 1 Aug 2014 16:01:23 +0200 [thread overview]
Message-ID: <20140801140121.GB373@ulmo.nvidia.com> (raw)
In-Reply-To: <20140801125206.GB21624@htj.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 1439 bytes --]
On Fri, Aug 01, 2014 at 08:52:06AM -0400, Tejun Heo wrote:
> On Fri, Aug 01, 2014 at 01:39:41PM +0200, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > Commit 725c7b570fda (ata: libahci_platform: move port_map parameters
> > into the AHCI structure) moves flags into the struct ahci_host_priv's
> > .flags field, which causes compiler warnings on 64-bit builds when that
> > value is cast to a void * pointer. Rather than adding additional casting
> > to silence the warning, turn the flags field into a unsigned long.
>
> Unless we're talking about a lot of places where such casting is
> necessary, I'd actually prefer to keep the flags uint and use explicit
> casting. How many are we talking about?
I think there's just one occurrence. Turning the flags into an unsigned
long seems like a much more natural thing to do, though Besides it being
what many other parts of the kernel use for flags it gives us natural
alignment within struct ahci_host_priv. The structure currently looks
like this:
struct ahci_host_priv {
unsigned int flags;
u32 force_port_map;
u32 mask_port_map;
void __iomem *mmio;
...
};
On 64-bit that unsigned int will be 32-bit and cause additional padding
to be inserted between mask_port_map and mmio to align the 64-bit
pointer.
It's not like the alignment is that *hugely* important, but it's still,
you know, pretty.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-08-01 14:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-01 11:39 [PATCH] ata: libahci: Make host flags unsigned long Thierry Reding
2014-08-01 12:52 ` Tejun Heo
2014-08-01 14:01 ` Thierry Reding [this message]
2014-08-01 14:09 ` Tejun Heo
2014-08-01 14:11 ` Thierry Reding
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=20140801140121.GB373@ulmo.nvidia.com \
--to=thierry.reding@gmail.com \
--cc=antoine.tenart@free-electrons.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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