Re: [patch] removes casting of (void*) private structure members

From: Sam Ravnborg
Date: Thu May 29 2008 - 14:24:40 EST


On Thu, May 29, 2008 at 07:33:54PM +0200, Philipp Marek wrote:
> Hello everybody,
>
> here's another trivial patch, against v2.6.26-rc3-243-gd40ace0.

Sample from your patch:
static int geode_rng_data_read(struct hwrng *rng, u32 *data)
{
- void __iomem *mem = (void __iomem *)rng->priv;
+ void __iomem *mem = rng->priv;

And from hw_random.h:
struct hwrng {
const char *name;
int (*init)(struct hwrng *rng);
void (*cleanup)(struct hwrng *rng);
int (*data_present)(struct hwrng *rng, int wait);
int (*data_read)(struct hwrng *rng, u32 *data);
unsigned long priv;

/* internal. */
struct list_head list;
};


So rng->priv is unsigend long.
Therefore the cast is legitimate.

And I expect gcc to emit:
warning: assignment makes pointer from integer without a cast


Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/