lkml.org 
[lkml]   [2012]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regulator: core: Add intermediate cast to uintptr_t before casting to pointer
On Mon, Aug 06, 2012 at 12:10:33AM +0800, Axel Lin wrote:

> Either is ok to me.
> But the double case looks better to me because the intention is clear.
> It seems uintptr_t is less commonly used in drivers code.
> Maybe just use (void *)(unsigned long)best_val is better in readability.

Two casts just looks terrible to me to be honest, it'll set off alarm
bells any time I glance at the code just from the visual pattern.


\
 
 \ /
  Last update: 2012-08-06 17:41    [W:0.041 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site