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: <20120802180051.GI4537@opensource.wolfsonmicro.com>
Date:	Thu, 2 Aug 2012 19:00:51 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Axel Lin <axel.lin@...il.com>
Cc:	Liam Girdwood <lrg@...com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] regulator: core: Add intermediate cast to uintptr_t
 before casting to pointer

On Wed, Aug 01, 2012 at 12:08:08AM +0800, Axel Lin wrote:
> 於 二,2012-07-31 於 16:41 +0100,Mark Brown 提到:

> > So the above cast probably isn't right...  you shouldn't need a double
> > cast here.

> The issue of original warning is: ( I compile the kernel on x86_64 )
>         warning: cast to pointer from integer of different size

> What this patch does is:
> cast best_val to uintptr_t, which is an unsigned integer large enough to
> hold a void* pointer.

> And then cast it to (void *).

> Thus I did (void *)(uintptr_t)best_val.

Perhaps we need a temporary variable here.  The double cast just looks
too horrible.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ