Re: [PATCH 3/3] V4L: stk11xx, add static to tables

From: Andrew Morton
Date: Fri Aug 31 2007 - 14:41:15 EST


On Tue, 28 Aug 2007 01:18:34 -0700
Jiri Slaby <jirislaby@xxxxxxxxx> wrote:

> stk11xx, add static to tables
>
> ensure, that the compiler will put all the tables in static storage
>
> Signed-off-by: Jiri Slaby <jirislaby@xxxxxxxxx>
>
> ...
>
> diff --git a/drivers/media/video/stk1125.c b/drivers/media/video/stk1125.c
> index f12030d..d79c196 100644
> --- a/drivers/media/video/stk1125.c
> +++ b/drivers/media/video/stk1125.c
> @@ -26,7 +26,7 @@ static int stk1125_load_microcode(struct stk11xx *dev)
> int retok;
>
> /* From 80x60 to 640x480 */
> - const u8 values_1_204[] = {
> + static const u8 values_1_204[] = {
> 0x12, 0x11, 0x3b, 0x6a, 0x13, 0x10, 0x00, 0x01, 0x02, 0x13,
> 0x39, 0x38, 0x37, 0x35, 0x0e, 0x12, 0x04, 0x0c, 0x0d, 0x17,

I think you'll find that the compiler is already putting this array into
static storage. But yes, I think the change is useful for commentary and
peace-of-mind reasons.


-
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/