Re: [PATCH 1/1] kernel/sched.c: Fix array initialization typo

From: Jean Sacren
Date: Sun Jun 12 2011 - 20:52:41 EST


From: Andy Isaacson <adi@xxxxxxxxxxxxx>
Date: Sun, 12 Jun 2011 16:09:01 -0700
>
> It is a standard C idiom for defining array contents. If you write
> int x[] = {
> 1,
> 2,
> 3
> };
>
> then when I add a fourth element to your array, I have to modify two
> lines, and the diff will say
> - 3
> + 3,
> + 4
> };
>
> whereas if you wrote "3," as the last line of the initializer, the diff
> would be one line long.

I don't know how to thank you for this. Apparently the patch is bogus.
>
> Furthermore, spot the error in this diff:
>
> @@ -3,4 +3,5 @@ char *x[] = {
> "quick",
> "brown",
> "fox"
> + "jumped"
> };
>
> HTH, HAND,
> -andy

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