Skip to content

Commit cee32ed

Browse files
Colin Ian Kingmchehab
authored andcommitted
media: cxusb: pass buf as a const u8 * pointer and make buf static const
Don't populate the read-only u8 array buf on the stack at run time but instead make it static const; makes object code smaller saving over 480 bytes: Before: text data bss dec hex filename 33030 65936 192 99158 18356 drivers/media/usb/dvb-usb/cxusb.o After: text data bss dec hex filename 32446 66032 192 98670 1816e drivers/media/usb/dvb-usb/cxusb.o Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent d259f91 commit cee32ed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/media/usb/dvb-usb/cxusb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
5656
#define deb_i2c(args...) dprintk(dvb_usb_cxusb_debug, 0x02, args)
5757

5858
static int cxusb_ctrl_msg(struct dvb_usb_device *d,
59-
u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen)
59+
u8 cmd, const u8 *wbuf, int wlen, u8 *rbuf, int rlen)
6060
{
6161
struct cxusb_state *st = d->priv;
6262
int ret;
@@ -290,7 +290,8 @@ static int cxusb_aver_power_ctrl(struct dvb_usb_device *d, int onoff)
290290
/* FIXME: We don't know why, but we need to configure the
291291
* lgdt3303 with the register settings below on resume */
292292
int i;
293-
u8 buf, bufs[] = {
293+
u8 buf;
294+
static const u8 bufs[] = {
294295
0x0e, 0x2, 0x00, 0x7f,
295296
0x0e, 0x2, 0x02, 0xfe,
296297
0x0e, 0x2, 0x02, 0x01,

0 commit comments

Comments
 (0)