Re: [PATCH] set dock_station->flags to zero during dock_add

From: Alex Chiang
Date: Mon Feb 01 2010 - 12:57:56 EST


* Chris Mason <chris.mason@xxxxxxxxxx>:
> On Mon, Feb 01, 2010 at 10:35:18AM -0700, Alex Chiang wrote:
> > Hi Chris,
> >
> > Thanks for catching this. Seems better to just memset the stack
> > variable before we kmemdup it in platform_deivce_register_data().
> >
> > How about this instead?
>
> [ memset instead of explicitly setting flags to zero ]
>
> I didn't do the memset because lower down we init every other field, but
> zeros are zeros really.

Sure, zeros are zeros. I chose memset in case the struct grows in
the future and someone else forgets to initialize members to
zero.

I'll let Len decide which patch to take, it doesn't much matter
to me.

If he takes yours...

Acked-by: Alex Chiang <achiang@xxxxxx>

> Looking at platform_device_register_data, you could even make
> ds static...now that is sure to break in small and subtle ways
> later on ;)

Ha, those are bugs that I don't have to have to fix in the
future. :)

cheers,
/ac
--
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/