Re: [PATCH 2/2] mmc: fix integer assignments to pointer

Chris Ball
2011-08-23T17:36:58Z

Hi,

On Tue, Aug 23 2011, Sam Ravnborg wrote:
>> So we're not assigning 0 to a pointer, or whatever sparse thinks we're
>> doing -- we're initializing every member of the struct with 0, which is
>> a good and safe way to initialize it.
>>
>> Sparse folks, any comment?
>
> The struct looks like this:
> struct mmc_request {
> struct mmc_command *sbc; /* SET_BLOCK_COUNT for multiblock */
> struct mmc_command *cmd;
> struct mmc_data *data;
> struct mmc_command *stop;
>
> struct completion completion;
> void (*done)(struct mmc_request *);/* completion function */
> };
>
>
> So you assing '0' to sbc - which is a pointer.
> So sparse warning is correct.

Oops, thanks Sam, I should have realized this was the complaint --
sorry for wasting your time.

- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child