[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080529182510.GA15712@uranus.ravnborg.org>
Date: Thu, 29 May 2008 20:25:10 +0200
From: Sam Ravnborg <sam@...nborg.org>
To: Philipp Marek <philipp@...ek.priv.at>
Cc: linux-trivial@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [patch] removes casting of (void*) private structure members
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@...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