diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-11-02 06:52:04 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-11-08 06:45:45 -0500 |
commit | 65e2f1cb3fe0f0630834b9517ba8f631936f325c (patch) | |
tree | f2f93e789f1063659ffc912583289a666d8ffb5c | |
parent | 0065a79a8698a953e4b201c5fce8db8940530578 (diff) |
[media] af9015: Don't use dynamic static allocation
Dynamic static allocation is evil, as Kernel stack is too low, and
compilation complains about it on some archs:
drivers/media/usb/dvb-usb-v2/af9015.c:433:1: warning: 'af9015_eeprom_hash' uses dynamic stack allocation [enabled by default]
In this specific case, it is a gcc bug, as the size is a const, but
it is easy to just change it from const to a #define, getting rid of
the gcc warning.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/af9015.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9015.c b/drivers/media/usb/dvb-usb-v2/af9015.c index d556042cf312..da47d2392f2a 100644 --- a/drivers/media/usb/dvb-usb-v2/af9015.c +++ b/drivers/media/usb/dvb-usb-v2/af9015.c | |||
@@ -397,12 +397,13 @@ error: | |||
397 | return ret; | 397 | return ret; |
398 | } | 398 | } |
399 | 399 | ||
400 | #define AF9015_EEPROM_SIZE 256 | ||
401 | |||
400 | /* hash (and dump) eeprom */ | 402 | /* hash (and dump) eeprom */ |
401 | static int af9015_eeprom_hash(struct dvb_usb_device *d) | 403 | static int af9015_eeprom_hash(struct dvb_usb_device *d) |
402 | { | 404 | { |
403 | struct af9015_state *state = d_to_priv(d); | 405 | struct af9015_state *state = d_to_priv(d); |
404 | int ret, i; | 406 | int ret, i; |
405 | static const unsigned int AF9015_EEPROM_SIZE = 256; | ||
406 | u8 buf[AF9015_EEPROM_SIZE]; | 407 | u8 buf[AF9015_EEPROM_SIZE]; |
407 | struct req_t req = {READ_I2C, AF9015_I2C_EEPROM, 0, 0, 1, 1, NULL}; | 408 | struct req_t req = {READ_I2C, AF9015_I2C_EEPROM, 0, 0, 1, 1, NULL}; |
408 | 409 | ||