Commit d9bdf772 authored by Tobias Klauser's avatar Tobias Klauser Committed by Mauro Carvalho Chehab

V4L/DVB (5011): DVB: Remove unneeded void * casts in ttpci/av7110

The patch removes unneeded void * casts for the following (void *) pointers:
- struct file: private_data
- struct dvb_device: priv
- struct dvb_demux: priv
- struct dvb_adapter: priv
The patch also contains some whitespace and coding style cleanups in the
relevant areas.
Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 9d85d776
...@@ -695,8 +695,8 @@ static void gpioirq(unsigned long data) ...@@ -695,8 +695,8 @@ static void gpioirq(unsigned long data)
static int dvb_osd_ioctl(struct inode *inode, struct file *file, static int dvb_osd_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *parg) unsigned int cmd, void *parg)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
dprintk(4, "%p\n", av7110); dprintk(4, "%p\n", av7110);
...@@ -786,7 +786,7 @@ int ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid, ...@@ -786,7 +786,7 @@ int ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
static int StartHWFilter(struct dvb_demux_filter *dvbdmxfilter) static int StartHWFilter(struct dvb_demux_filter *dvbdmxfilter)
{ {
struct dvb_demux_feed *dvbdmxfeed = dvbdmxfilter->feed; struct dvb_demux_feed *dvbdmxfeed = dvbdmxfilter->feed;
struct av7110 *av7110 = (struct av7110 *) dvbdmxfeed->demux->priv; struct av7110 *av7110 = dvbdmxfeed->demux->priv;
u16 buf[20]; u16 buf[20];
int ret, i; int ret, i;
u16 handle; u16 handle;
...@@ -835,7 +835,7 @@ static int StartHWFilter(struct dvb_demux_filter *dvbdmxfilter) ...@@ -835,7 +835,7 @@ static int StartHWFilter(struct dvb_demux_filter *dvbdmxfilter)
static int StopHWFilter(struct dvb_demux_filter *dvbdmxfilter) static int StopHWFilter(struct dvb_demux_filter *dvbdmxfilter)
{ {
struct av7110 *av7110 = (struct av7110 *) dvbdmxfilter->feed->demux->priv; struct av7110 *av7110 = dvbdmxfilter->feed->demux->priv;
u16 buf[3]; u16 buf[3];
u16 answ[2]; u16 answ[2];
int ret; int ret;
...@@ -871,7 +871,7 @@ static int StopHWFilter(struct dvb_demux_filter *dvbdmxfilter) ...@@ -871,7 +871,7 @@ static int StopHWFilter(struct dvb_demux_filter *dvbdmxfilter)
static int dvb_feed_start_pid(struct dvb_demux_feed *dvbdmxfeed) static int dvb_feed_start_pid(struct dvb_demux_feed *dvbdmxfeed)
{ {
struct dvb_demux *dvbdmx = dvbdmxfeed->demux; struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
struct av7110 *av7110 = (struct av7110 *) dvbdmx->priv; struct av7110 *av7110 = dvbdmx->priv;
u16 *pid = dvbdmx->pids, npids[5]; u16 *pid = dvbdmx->pids, npids[5];
int i; int i;
int ret = 0; int ret = 0;
...@@ -914,7 +914,7 @@ static int dvb_feed_start_pid(struct dvb_demux_feed *dvbdmxfeed) ...@@ -914,7 +914,7 @@ static int dvb_feed_start_pid(struct dvb_demux_feed *dvbdmxfeed)
static int dvb_feed_stop_pid(struct dvb_demux_feed *dvbdmxfeed) static int dvb_feed_stop_pid(struct dvb_demux_feed *dvbdmxfeed)
{ {
struct dvb_demux *dvbdmx = dvbdmxfeed->demux; struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
struct av7110 *av7110 = (struct av7110 *) dvbdmx->priv; struct av7110 *av7110 = dvbdmx->priv;
u16 *pid = dvbdmx->pids, npids[5]; u16 *pid = dvbdmx->pids, npids[5];
int i; int i;
...@@ -1103,9 +1103,9 @@ static int dvb_get_stc(struct dmx_demux *demux, unsigned int num, ...@@ -1103,9 +1103,9 @@ static int dvb_get_stc(struct dmx_demux *demux, unsigned int num,
/* pointer casting paranoia... */ /* pointer casting paranoia... */
BUG_ON(!demux); BUG_ON(!demux);
dvbdemux = (struct dvb_demux *) demux->priv; dvbdemux = demux->priv;
BUG_ON(!dvbdemux); BUG_ON(!dvbdemux);
av7110 = (struct av7110 *) dvbdemux->priv; av7110 = dvbdemux->priv;
dprintk(4, "%p\n", av7110); dprintk(4, "%p\n", av7110);
...@@ -1137,7 +1137,7 @@ static int dvb_get_stc(struct dmx_demux *demux, unsigned int num, ...@@ -1137,7 +1137,7 @@ static int dvb_get_stc(struct dmx_demux *demux, unsigned int num,
static int av7110_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) static int av7110_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
{ {
struct av7110* av7110 = (struct av7110*) fe->dvb->priv; struct av7110* av7110 = fe->dvb->priv;
switch (tone) { switch (tone) {
case SEC_TONE_ON: case SEC_TONE_ON:
...@@ -1197,7 +1197,7 @@ static int start_ts_capture(struct av7110 *budget) ...@@ -1197,7 +1197,7 @@ static int start_ts_capture(struct av7110 *budget)
static int budget_start_feed(struct dvb_demux_feed *feed) static int budget_start_feed(struct dvb_demux_feed *feed)
{ {
struct dvb_demux *demux = feed->demux; struct dvb_demux *demux = feed->demux;
struct av7110 *budget = (struct av7110 *) demux->priv; struct av7110 *budget = demux->priv;
int status; int status;
dprintk(2, "av7110: %p\n", budget); dprintk(2, "av7110: %p\n", budget);
...@@ -1212,7 +1212,7 @@ static int budget_start_feed(struct dvb_demux_feed *feed) ...@@ -1212,7 +1212,7 @@ static int budget_start_feed(struct dvb_demux_feed *feed)
static int budget_stop_feed(struct dvb_demux_feed *feed) static int budget_stop_feed(struct dvb_demux_feed *feed)
{ {
struct dvb_demux *demux = feed->demux; struct dvb_demux *demux = feed->demux;
struct av7110 *budget = (struct av7110 *) demux->priv; struct av7110 *budget = demux->priv;
int status; int status;
dprintk(2, "budget: %p\n", budget); dprintk(2, "budget: %p\n", budget);
...@@ -1551,7 +1551,7 @@ static int get_firmware(struct av7110* av7110) ...@@ -1551,7 +1551,7 @@ static int get_firmware(struct av7110* av7110)
static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params) static int alps_bsrv2_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{ {
struct av7110* av7110 = (struct av7110*) fe->dvb->priv; struct av7110* av7110 = fe->dvb->priv;
u8 pwr = 0; u8 pwr = 0;
u8 buf[4]; u8 buf[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) }; struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) };
...@@ -1702,7 +1702,7 @@ static int alps_tdlb7_tuner_set_params(struct dvb_frontend* fe, struct dvb_front ...@@ -1702,7 +1702,7 @@ static int alps_tdlb7_tuner_set_params(struct dvb_frontend* fe, struct dvb_front
static int alps_tdlb7_request_firmware(struct dvb_frontend* fe, const struct firmware **fw, char* name) static int alps_tdlb7_request_firmware(struct dvb_frontend* fe, const struct firmware **fw, char* name)
{ {
#if defined(CONFIG_DVB_SP8870) || defined(CONFIG_DVB_SP8870_MODULE) #if defined(CONFIG_DVB_SP8870) || defined(CONFIG_DVB_SP8870_MODULE)
struct av7110* av7110 = (struct av7110*) fe->dvb->priv; struct av7110* av7110 = fe->dvb->priv;
return request_firmware(fw, name, &av7110->dev->pci->dev); return request_firmware(fw, name, &av7110->dev->pci->dev);
#else #else
...@@ -1867,7 +1867,7 @@ static struct stv0297_config nexusca_stv0297_config = { ...@@ -1867,7 +1867,7 @@ static struct stv0297_config nexusca_stv0297_config = {
static int grundig_29504_401_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params) static int grundig_29504_401_tuner_set_params(struct dvb_frontend* fe, struct dvb_frontend_parameters *params)
{ {
struct av7110* av7110 = (struct av7110*) fe->dvb->priv; struct av7110* av7110 = fe->dvb->priv;
u32 div; u32 div;
u8 cfg, cpump, band_select; u8 cfg, cpump, band_select;
u8 data[4]; u8 data[4];
......
...@@ -880,8 +880,8 @@ static int dvb_video_get_event (struct av7110 *av7110, struct video_event *event ...@@ -880,8 +880,8 @@ static int dvb_video_get_event (struct av7110 *av7110, struct video_event *event
static unsigned int dvb_video_poll(struct file *file, poll_table *wait) static unsigned int dvb_video_poll(struct file *file, poll_table *wait)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
unsigned int mask = 0; unsigned int mask = 0;
dprintk(2, "av7110:%p, \n", av7110); dprintk(2, "av7110:%p, \n", av7110);
...@@ -908,8 +908,8 @@ static unsigned int dvb_video_poll(struct file *file, poll_table *wait) ...@@ -908,8 +908,8 @@ static unsigned int dvb_video_poll(struct file *file, poll_table *wait)
static ssize_t dvb_video_write(struct file *file, const char __user *buf, static ssize_t dvb_video_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
dprintk(2, "av7110:%p, \n", av7110); dprintk(2, "av7110:%p, \n", av7110);
...@@ -924,8 +924,8 @@ static ssize_t dvb_video_write(struct file *file, const char __user *buf, ...@@ -924,8 +924,8 @@ static ssize_t dvb_video_write(struct file *file, const char __user *buf,
static unsigned int dvb_audio_poll(struct file *file, poll_table *wait) static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
unsigned int mask = 0; unsigned int mask = 0;
dprintk(2, "av7110:%p, \n", av7110); dprintk(2, "av7110:%p, \n", av7110);
...@@ -944,8 +944,8 @@ static unsigned int dvb_audio_poll(struct file *file, poll_table *wait) ...@@ -944,8 +944,8 @@ static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
static ssize_t dvb_audio_write(struct file *file, const char __user *buf, static ssize_t dvb_audio_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
dprintk(2, "av7110:%p, \n", av7110); dprintk(2, "av7110:%p, \n", av7110);
...@@ -989,8 +989,8 @@ static int play_iframe(struct av7110 *av7110, u8 __user *buf, unsigned int len, ...@@ -989,8 +989,8 @@ static int play_iframe(struct av7110 *av7110, u8 __user *buf, unsigned int len,
static int dvb_video_ioctl(struct inode *inode, struct file *file, static int dvb_video_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *parg) unsigned int cmd, void *parg)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
unsigned long arg = (unsigned long) parg; unsigned long arg = (unsigned long) parg;
int ret = 0; int ret = 0;
...@@ -1203,8 +1203,8 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, ...@@ -1203,8 +1203,8 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
static int dvb_audio_ioctl(struct inode *inode, struct file *file, static int dvb_audio_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *parg) unsigned int cmd, void *parg)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
unsigned long arg = (unsigned long) parg; unsigned long arg = (unsigned long) parg;
int ret = 0; int ret = 0;
...@@ -1349,8 +1349,8 @@ static int dvb_audio_ioctl(struct inode *inode, struct file *file, ...@@ -1349,8 +1349,8 @@ static int dvb_audio_ioctl(struct inode *inode, struct file *file,
static int dvb_video_open(struct inode *inode, struct file *file) static int dvb_video_open(struct inode *inode, struct file *file)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
int err; int err;
dprintk(2, "av7110:%p, \n", av7110); dprintk(2, "av7110:%p, \n", av7110);
...@@ -1374,8 +1374,8 @@ static int dvb_video_open(struct inode *inode, struct file *file) ...@@ -1374,8 +1374,8 @@ static int dvb_video_open(struct inode *inode, struct file *file)
static int dvb_video_release(struct inode *inode, struct file *file) static int dvb_video_release(struct inode *inode, struct file *file)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
dprintk(2, "av7110:%p, \n", av7110); dprintk(2, "av7110:%p, \n", av7110);
...@@ -1388,9 +1388,9 @@ static int dvb_video_release(struct inode *inode, struct file *file) ...@@ -1388,9 +1388,9 @@ static int dvb_video_release(struct inode *inode, struct file *file)
static int dvb_audio_open(struct inode *inode, struct file *file) static int dvb_audio_open(struct inode *inode, struct file *file)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
int err=dvb_generic_open(inode, file); int err = dvb_generic_open(inode, file);
dprintk(2, "av7110:%p, \n", av7110); dprintk(2, "av7110:%p, \n", av7110);
...@@ -1403,8 +1403,8 @@ static int dvb_audio_open(struct inode *inode, struct file *file) ...@@ -1403,8 +1403,8 @@ static int dvb_audio_open(struct inode *inode, struct file *file)
static int dvb_audio_release(struct inode *inode, struct file *file) static int dvb_audio_release(struct inode *inode, struct file *file)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
dprintk(2, "av7110:%p, \n", av7110); dprintk(2, "av7110:%p, \n", av7110);
......
...@@ -214,8 +214,8 @@ static ssize_t ci_ll_read(struct dvb_ringbuffer *cibuf, struct file *file, ...@@ -214,8 +214,8 @@ static ssize_t ci_ll_read(struct dvb_ringbuffer *cibuf, struct file *file,
static int dvb_ca_open(struct inode *inode, struct file *file) static int dvb_ca_open(struct inode *inode, struct file *file)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
int err = dvb_generic_open(inode, file); int err = dvb_generic_open(inode, file);
dprintk(8, "av7110:%p\n",av7110); dprintk(8, "av7110:%p\n",av7110);
...@@ -228,8 +228,8 @@ static int dvb_ca_open(struct inode *inode, struct file *file) ...@@ -228,8 +228,8 @@ static int dvb_ca_open(struct inode *inode, struct file *file)
static unsigned int dvb_ca_poll (struct file *file, poll_table *wait) static unsigned int dvb_ca_poll (struct file *file, poll_table *wait)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
struct dvb_ringbuffer *rbuf = &av7110->ci_rbuffer; struct dvb_ringbuffer *rbuf = &av7110->ci_rbuffer;
struct dvb_ringbuffer *wbuf = &av7110->ci_wbuffer; struct dvb_ringbuffer *wbuf = &av7110->ci_wbuffer;
unsigned int mask = 0; unsigned int mask = 0;
...@@ -251,8 +251,8 @@ static unsigned int dvb_ca_poll (struct file *file, poll_table *wait) ...@@ -251,8 +251,8 @@ static unsigned int dvb_ca_poll (struct file *file, poll_table *wait)
static int dvb_ca_ioctl(struct inode *inode, struct file *file, static int dvb_ca_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *parg) unsigned int cmd, void *parg)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
unsigned long arg = (unsigned long) parg; unsigned long arg = (unsigned long) parg;
dprintk(8, "av7110:%p\n",av7110); dprintk(8, "av7110:%p\n",av7110);
...@@ -329,8 +329,8 @@ static int dvb_ca_ioctl(struct inode *inode, struct file *file, ...@@ -329,8 +329,8 @@ static int dvb_ca_ioctl(struct inode *inode, struct file *file,
static ssize_t dvb_ca_write(struct file *file, const char __user *buf, static ssize_t dvb_ca_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
dprintk(8, "av7110:%p\n",av7110); dprintk(8, "av7110:%p\n",av7110);
return ci_ll_write(&av7110->ci_wbuffer, file, buf, count, ppos); return ci_ll_write(&av7110->ci_wbuffer, file, buf, count, ppos);
...@@ -339,15 +339,13 @@ static ssize_t dvb_ca_write(struct file *file, const char __user *buf, ...@@ -339,15 +339,13 @@ static ssize_t dvb_ca_write(struct file *file, const char __user *buf,
static ssize_t dvb_ca_read(struct file *file, char __user *buf, static ssize_t dvb_ca_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv; struct av7110 *av7110 = dvbdev->priv;
dprintk(8, "av7110:%p\n",av7110); dprintk(8, "av7110:%p\n",av7110);
return ci_ll_read(&av7110->ci_rbuffer, file, buf, count, ppos); return ci_ll_read(&av7110->ci_rbuffer, file, buf, count, ppos);
} }
static struct file_operations dvb_ca_fops = { static struct file_operations dvb_ca_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.read = dvb_ca_read, .read = dvb_ca_read,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment