Skip to content

Commit

Permalink
V4L/DVB (8906): v4l-dvb: fix assorted sparse warnings
Browse files Browse the repository at this point in the history
Fix sparse warnings. None are serious, but cutting down on these helps find
future serious sparse warnings/errors.

Redid the av7710.c patch based on a suggestion by Oliver Endriss.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent 2bb87c2 commit d45b9b8
Show file tree
Hide file tree
Showing 39 changed files with 108 additions and 111 deletions.
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/af9005-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
#include "af9005.h"
/* debug */
int dvb_usb_af9005_remote_debug;
static int dvb_usb_af9005_remote_debug;
module_param_named(debug, dvb_usb_af9005_remote_debug, int, 0644);
MODULE_PARM_DESC(debug,
"enable (1) or disable (0) debug messages."
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-usb/af9005-script.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ typedef struct {
u8 val;
} RegDesc;

RegDesc script[] = {
static RegDesc script[] = {
{0xa180, 0x0, 0x8, 0xa},
{0xa181, 0x0, 0x8, 0xd7},
{0xa182, 0x0, 0x8, 0xa3},
Expand Down
23 changes: 9 additions & 14 deletions drivers/media/dvb/dvb-usb/af9005.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ module_param_named(led, dvb_usb_af9005_led, bool, 0644);
MODULE_PARM_DESC(led, "enable led (default: 1).");

/* eeprom dump */
int dvb_usb_af9005_dump_eeprom = 0;
static int dvb_usb_af9005_dump_eeprom;
module_param_named(dump_eeprom, dvb_usb_af9005_dump_eeprom, int, 0);
MODULE_PARM_DESC(dump_eeprom, "dump contents of the eeprom.");

DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);

/* remote control decoder */
int (*rc_decode) (struct dvb_usb_device * d, u8 * data, int len, u32 * event,
int *state);
void *rc_keys;
int *rc_keys_size;
static int (*rc_decode) (struct dvb_usb_device *d, u8 *data, int len,
u32 *event, int *state);
static void *rc_keys;
static int *rc_keys_size;

u8 regmask[8] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };

Expand All @@ -54,8 +54,8 @@ struct af9005_device_state {
int led_state;
};

int af9005_usb_generic_rw(struct dvb_usb_device *d, u8 * wbuf, u16 wlen,
u8 * rbuf, u16 rlen, int delay_ms)
static int af9005_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen,
u8 *rbuf, u16 rlen, int delay_ms)
{
int actlen, ret = -ENOMEM;

Expand Down Expand Up @@ -98,12 +98,7 @@ int af9005_usb_generic_rw(struct dvb_usb_device *d, u8 * wbuf, u16 wlen,
return ret;
}

int af9005_usb_generic_write(struct dvb_usb_device *d, u8 * buf, u16 len)
{
return af9005_usb_generic_rw(d, buf, len, NULL, 0, 0);
}

int af9005_generic_read_write(struct dvb_usb_device *d, u16 reg,
static int af9005_generic_read_write(struct dvb_usb_device *d, u16 reg,
int readwrite, int type, u8 * values, int len)
{
struct af9005_device_state *st = d->priv;
Expand Down Expand Up @@ -765,7 +760,7 @@ static int af9005_boot_packet(struct usb_device *udev, int type, u8 * reply)
return 0;
}

int af9005_download_firmware(struct usb_device *udev, const struct firmware *fw)
static int af9005_download_firmware(struct usb_device *udev, const struct firmware *fw)
{
int i, packets, ret, act_len;

Expand Down
15 changes: 10 additions & 5 deletions drivers/media/dvb/frontends/cx24110.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,17 @@ struct cx24110_config
u8 demod_address;
};

static inline int cx24110_pll_write(struct dvb_frontend *fe, u32 val) {
int r = 0;
u8 buf[] = {(u8) (val>>24), (u8) (val>>16), (u8) (val>>8)};
static inline int cx24110_pll_write(struct dvb_frontend *fe, u32 val)
{
u8 buf[] = {
(u8)((val >> 24) & 0xff),
(u8)((val >> 16) & 0xff),
(u8)((val >> 8) & 0xff)
};

if (fe->ops.write)
r = fe->ops.write(fe, buf, 3);
return r;
return fe->ops.write(fe, buf, 3);
return 0;
}

#if defined(CONFIG_DVB_CX24110) || (defined(CONFIG_DVB_CX24110_MODULE) && defined(MODULE))
Expand Down
3 changes: 2 additions & 1 deletion drivers/media/dvb/frontends/dib7000m.c
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,8 @@ struct i2c_adapter * dib7000m_get_i2c_master(struct dvb_frontend *demod, enum di
}
EXPORT_SYMBOL(dib7000m_get_i2c_master);

int dib7000m_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods, u8 default_addr, struct dib7000m_config cfg[])
static int dib7000m_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods,
u8 default_addr, struct dib7000m_config cfg[])
{
struct dib7000m_state st = { .i2c_adap = i2c };
int k = 0;
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/dvb/frontends/dvb_dummy_fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void)

static struct dvb_frontend_ops dvb_dummy_fe_qpsk_ops;

struct dvb_frontend* dvb_dummy_fe_qpsk_attach()
struct dvb_frontend *dvb_dummy_fe_qpsk_attach(void)
{
struct dvb_dummy_fe_state* state = NULL;

Expand All @@ -152,7 +152,7 @@ struct dvb_frontend* dvb_dummy_fe_qpsk_attach()

static struct dvb_frontend_ops dvb_dummy_fe_qam_ops;

struct dvb_frontend* dvb_dummy_fe_qam_attach()
struct dvb_frontend *dvb_dummy_fe_qam_attach(void)
{
struct dvb_dummy_fe_state* state = NULL;

Expand Down
3 changes: 2 additions & 1 deletion drivers/media/dvb/frontends/sp887x.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe,
struct dvb_frontend_parameters *p)
{
struct sp887x_state* state = fe->demodulator_priv;
int actual_freq, err;
unsigned actual_freq;
int err;
u16 val, reg0xc05;

if (p->u.ofdm.bandwidth != BANDWIDTH_8_MHZ &&
Expand Down
12 changes: 6 additions & 6 deletions drivers/media/dvb/ttpci/av7110.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ static inline void start_debi_dma(struct av7110 *av7110, int dir,
irdebi(av7110, DEBISWAB, addr, 0, len);
}

static void debiirq(unsigned long data)
static void debiirq(unsigned long cookie)
{
struct av7110 *av7110 = (struct av7110 *) data;
struct av7110 *av7110 = (struct av7110 *)cookie;
int type = av7110->debitype;
int handle = (type >> 8) & 0x1f;
unsigned int xfer = 0;
Expand Down Expand Up @@ -492,9 +492,9 @@ static void debiirq(unsigned long data)
}

/* irq from av7110 firmware writing the mailbox register in the DPRAM */
static void gpioirq(unsigned long data)
static void gpioirq(unsigned long cookie)
{
struct av7110 *av7110 = (struct av7110 *) data;
struct av7110 *av7110 = (struct av7110 *)cookie;
u32 rxbuf, txbuf;
int len;

Expand Down Expand Up @@ -1260,9 +1260,9 @@ static int budget_stop_feed(struct dvb_demux_feed *feed)
return status;
}

static void vpeirq(unsigned long data)
static void vpeirq(unsigned long cookie)
{
struct av7110 *budget = (struct av7110 *) data;
struct av7110 *budget = (struct av7110 *)cookie;
u8 *mem = (u8 *) (budget->grabbing);
u32 olddma = budget->ttbp;
u32 newdma = saa7146_read(budget->dev, PCI_VDP3);
Expand Down
10 changes: 5 additions & 5 deletions drivers/media/video/cpia2/cpia2_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ static int config_sensor_500(struct camera_data *cam,
*
* This sets all user changeable properties to the values in cam->params.
*****************************************************************************/
int set_all_properties(struct camera_data *cam)
static int set_all_properties(struct camera_data *cam)
{
/**
* Don't set target_kb here, it will be set later.
Expand Down Expand Up @@ -1588,7 +1588,7 @@ void cpia2_save_camera_state(struct camera_data *cam)
* get_color_params
*
*****************************************************************************/
void get_color_params(struct camera_data *cam)
static void get_color_params(struct camera_data *cam)
{
cpia2_do_command(cam, CPIA2_CMD_GET_VP_BRIGHTNESS, TRANSFER_READ, 0);
cpia2_do_command(cam, CPIA2_CMD_GET_VP_SATURATION, TRANSFER_READ, 0);
Expand Down Expand Up @@ -1881,7 +1881,7 @@ void cpia2_set_saturation(struct camera_data *cam, unsigned char value)
* wake_system
*
*****************************************************************************/
void wake_system(struct camera_data *cam)
static void wake_system(struct camera_data *cam)
{
cpia2_do_command(cam, CPIA2_CMD_SET_WAKEUP, TRANSFER_WRITE, 0);
}
Expand All @@ -1892,7 +1892,7 @@ void wake_system(struct camera_data *cam)
*
* Valid for STV500 sensor only
*****************************************************************************/
void set_lowlight_boost(struct camera_data *cam)
static void set_lowlight_boost(struct camera_data *cam)
{
struct cpia2_command cmd;

Expand Down Expand Up @@ -2169,7 +2169,7 @@ void cpia2_dbg_dump_registers(struct camera_data *cam)
*
* Sets all values to the defaults
*****************************************************************************/
void reset_camera_struct(struct camera_data *cam)
static void reset_camera_struct(struct camera_data *cam)
{
/***
* The following parameter values are the defaults from the register map.
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/cpia2/cpia2_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ int cpia2_usb_change_streaming_alternate(struct camera_data *cam,
* set_alternate
*
*****************************************************************************/
int set_alternate(struct camera_data *cam, unsigned int alt)
static int set_alternate(struct camera_data *cam, unsigned int alt)
{
int ret = 0;

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/cx23885/cx23885-417.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ int mc417_memory_read(struct cx23885_dev *dev, u32 address, u32 *value)
/* ------------------------------------------------------------------ */

/* MPEG encoder API */
char *cmd_to_str(int cmd)
static char *cmd_to_str(int cmd)
{
switch (cmd) {
case CX2341X_ENC_PING_FW:
Expand Down
12 changes: 1 addition & 11 deletions drivers/media/video/cx23885/cx23885-vbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,8 @@ static int cx23885_start_vbi_dma(struct cx23885_dev *dev,
return 0;
}

int cx23885_stop_vbi_dma(struct cx23885_dev *dev)
{
/* stop dma */
cx_clear(VID_A_DMA_CTL, 0x00000022);

/* disable irqs */
cx_clear(PCI_INT_MSK, 0x000001);
cx_clear(VID_A_INT_MSK, 0x00000022);
return 0;
}

int cx23885_restart_vbi_queue(struct cx23885_dev *dev,
static int cx23885_restart_vbi_queue(struct cx23885_dev *dev,
struct cx23885_dmaqueue *q)
{
struct cx23885_buffer *buf;
Expand Down
29 changes: 11 additions & 18 deletions drivers/media/video/cx23885/cx23885-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static struct cx23885_ctrl cx23885_ctls[] = {
};
static const int CX23885_CTLS = ARRAY_SIZE(cx23885_ctls);

const u32 cx23885_user_ctrls[] = {
static const u32 cx23885_user_ctrls[] = {
V4L2_CID_USER_CLASS,
V4L2_CID_BRIGHTNESS,
V4L2_CID_CONTRAST,
Expand All @@ -254,14 +254,13 @@ const u32 cx23885_user_ctrls[] = {
V4L2_CID_AUDIO_MUTE,
0
};
EXPORT_SYMBOL(cx23885_user_ctrls);

static const u32 *ctrl_classes[] = {
cx23885_user_ctrls,
NULL
};

void cx23885_video_wakeup(struct cx23885_dev *dev,
static void cx23885_video_wakeup(struct cx23885_dev *dev,
struct cx23885_dmaqueue *q, u32 count)
{
struct cx23885_buffer *buf;
Expand Down Expand Up @@ -296,7 +295,7 @@ void cx23885_video_wakeup(struct cx23885_dev *dev,
__func__, bc);
}

int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm)
static int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm)
{
dprintk(1, "%s(norm = 0x%08x) name: [%s]\n",
__func__,
Expand All @@ -314,7 +313,7 @@ int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm)
return 0;
}

struct video_device *cx23885_vdev_init(struct cx23885_dev *dev,
static struct video_device *cx23885_vdev_init(struct cx23885_dev *dev,
struct pci_dev *pci,
struct video_device *template,
char *type)
Expand All @@ -334,7 +333,7 @@ struct video_device *cx23885_vdev_init(struct cx23885_dev *dev,
return vfd;
}

int cx23885_ctrl_query(struct v4l2_queryctrl *qctrl)
static int cx23885_ctrl_query(struct v4l2_queryctrl *qctrl)
{
int i;

Expand All @@ -351,7 +350,6 @@ int cx23885_ctrl_query(struct v4l2_queryctrl *qctrl)
*qctrl = cx23885_ctls[i].v;
return 0;
}
EXPORT_SYMBOL(cx23885_ctrl_query);

/* ------------------------------------------------------------------- */
/* resource management */
Expand Down Expand Up @@ -402,7 +400,7 @@ static void res_free(struct cx23885_dev *dev, struct cx23885_fh *fh,
mutex_unlock(&dev->lock);
}

int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input)
static int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input)
{
struct v4l2_routing route;
memset(&route, 0, sizeof(route));
Expand All @@ -422,10 +420,9 @@ int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input)

return 0;
}
EXPORT_SYMBOL(cx23885_video_mux);

/* ------------------------------------------------------------------ */
int cx23885_set_scale(struct cx23885_dev *dev, unsigned int width,
static int cx23885_set_scale(struct cx23885_dev *dev, unsigned int width,
unsigned int height, enum v4l2_field field)
{
dprintk(1, "%s()\n", __func__);
Expand Down Expand Up @@ -890,21 +887,19 @@ static int video_mmap(struct file *file, struct vm_area_struct *vma)
/* ------------------------------------------------------------------ */
/* VIDEO CTRL IOCTLS */

int cx23885_get_control(struct cx23885_dev *dev, struct v4l2_control *ctl)
static int cx23885_get_control(struct cx23885_dev *dev, struct v4l2_control *ctl)
{
dprintk(1, "%s() calling cx25840(VIDIOC_G_CTRL)\n", __func__);
cx23885_call_i2c_clients(&dev->i2c_bus[2], VIDIOC_G_CTRL, ctl);
return 0;
}
EXPORT_SYMBOL(cx23885_get_control);

int cx23885_set_control(struct cx23885_dev *dev, struct v4l2_control *ctl)
static int cx23885_set_control(struct cx23885_dev *dev, struct v4l2_control *ctl)
{
dprintk(1, "%s() calling cx25840(VIDIOC_S_CTRL)"
" (disabled - no action)\n", __func__);
return 0;
}
EXPORT_SYMBOL(cx23885_set_control);

static void init_controls(struct cx23885_dev *dev)
{
Expand Down Expand Up @@ -1152,7 +1147,7 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *tvnorms)
return 0;
}

int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i)
static int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i)
{
static const char *iname[] = {
[CX23885_VMUX_COMPOSITE1] = "Composite1",
Expand Down Expand Up @@ -1185,7 +1180,6 @@ int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i)
i->std = CX23885_NORMS;
return 0;
}
EXPORT_SYMBOL(cx23885_enum_input);

static int vidioc_enum_input(struct file *file, void *priv,
struct v4l2_input *i)
Expand Down Expand Up @@ -1294,7 +1288,7 @@ static int vidioc_g_frequency(struct file *file, void *priv,
return 0;
}

int cx23885_set_freq(struct cx23885_dev *dev, struct v4l2_frequency *f)
static int cx23885_set_freq(struct cx23885_dev *dev, struct v4l2_frequency *f)
{
if (unlikely(UNSET == dev->tuner_type))
return -EINVAL;
Expand All @@ -1313,7 +1307,6 @@ int cx23885_set_freq(struct cx23885_dev *dev, struct v4l2_frequency *f)

return 0;
}
EXPORT_SYMBOL(cx23885_set_freq);

static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
Expand Down
Loading

0 comments on commit d45b9b8

Please sign in to comment.