summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/pvrusb2
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-02-02 12:53:04 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-03-03 07:19:57 -0300
commit6830733d53a4517588e56227b9c8538633f0c496 (patch)
treefa8a668ea55efabd649c39336b264366dd6abbe4 /drivers/media/usb/pvrusb2
parent8ecc54138aa1fc1be10bac7890248a0c00065427 (diff)
downloadlinux-stable-6830733d53a4517588e56227b9c8538633f0c496.tar.gz
linux-stable-6830733d53a4517588e56227b9c8538633f0c496.tar.bz2
linux-stable-6830733d53a4517588e56227b9c8538633f0c496.zip
[media] pvrusb2: reduce stack usage pvr2_eeprom_analyze()
The driver uses a relatively large data structure on the stack, which showed up on my radar as we get a warning with the "latent entropy" GCC plugin: drivers/media/usb/pvrusb2/pvrusb2-eeprom.c:153:1: error: the frame size of 1376 bytes is larger than 1152 bytes [-Werror=frame-larger-than=] The warning is usually hidden as we raise the warning limit to 2048 when the plugin is enabled, but I'd like to lower that again in the future, and making this function smaller helps to do that without build regressions. Further analysis shows that putting an 'i2c_client' structure on the stack is not really supported, as the embedded 'struct device' is not initialized here, and we are only saved by the fact that the function that is called here does not use the pointer at all. Fixes: d855497edbfb ("V4L/DVB (4228a): pvrusb2 to kernel 2.6.18") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/pvrusb2')
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-eeprom.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c b/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c
index 4af2fb5c85d5..7252f113df2f 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-eeprom.c
@@ -118,15 +118,10 @@ int pvr2_eeprom_analyze(struct pvr2_hdw *hdw)
memset(&tvdata,0,sizeof(tvdata));
eeprom = pvr2_eeprom_fetch(hdw);
- if (!eeprom) return -EINVAL;
-
- {
- struct i2c_client fake_client;
- /* Newer version expects a useless client interface */
- fake_client.addr = hdw->eeprom_addr;
- fake_client.adapter = &hdw->i2c_adap;
- tveeprom_hauppauge_analog(&fake_client,&tvdata,eeprom);
- }
+ if (!eeprom)
+ return -EINVAL;
+
+ tveeprom_hauppauge_analog(NULL, &tvdata, eeprom);
trace_eeprom("eeprom assumed v4l tveeprom module");
trace_eeprom("eeprom direct call results:");