lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140801140121.GB373@ulmo.nvidia.com>
Date:	Fri, 1 Aug 2014 16:01:23 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	Antoine Ténart 
	<antoine.tenart@...e-electrons.com>, linux-ide@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ata: libahci: Make host flags unsigned long

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@...dia.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

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ