upstream: [media] saa7115: Don't use a dynamic array
authorMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 21 May 2013 14:36:30 +0000 (11:36 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:47:59 +0000 (11:47 +0900)
commit4d9e0e3b84d5a10b3e861b3d79180cb41888aac4
tree8a75c06cc3f6cb0d2fe046bdd790e89a00ad177d
parentccf7c3abe80b4925027673a0003be4c0fcad2797
upstream: [media] saa7115: Don't use a dynamic array

At least on s390, gcc complains about that:
    drivers/media/i2c/saa7115.c: In function 'saa711x_detect_chip.constprop.2':
    drivers/media/i2c/saa7115.c:1647:1: warning: 'saa711x_detect_chip.constprop.2' uses dynamic stack allocation [enabled by default]

While for me the above report seems utterly bogus, as the
compiler should be optimizing saa711x_detect_chip, merging
it with saa711x_detect_chip and changing:
char chip_ver[size - 1];
to
char chip_ver[16];

because this function is only called on this code snippet:
char name[17];
...
ident = saa711x_detect_chip(client, id, name, sizeof(name));

It seems that gcc is not optimizing it, at least on s390.

As getting rid of it is easy, let's do it.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/i2c/saa7115.c