[PATCH 01/22] staging: comedi: remove redundant pointer dereference in comedi_poll()

Ian Abbott abbotti at mev.co.uk
Fri May 2 12:50:13 UTC 2014


`s->async->subdevice` in `comedi_poll()` points to the same `struct
comedi_subdevice` as `s`, so the double pointer reference is redundant.
Just use `s`.

(`s->async->subdevice` is initialized by
`__comedi_device_postconfig_async()` in
"drivers/staging/comedi/drivers.c" and doesn't change.)

Signed-off-by: Ian Abbott <abbotti at mev.co.uk>
---
 drivers/staging/comedi/comedi_fops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 70545e6..90ea380 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2034,7 +2034,7 @@ static unsigned int comedi_poll(struct file *file, poll_table *wait)
 
 	s = comedi_write_subdevice(dev, minor);
 	if (s && s->async) {
-		unsigned int bps = bytes_per_sample(s->async->subdevice);
+		unsigned int bps = bytes_per_sample(s);
 
 		poll_wait(file, &s->async->wait_head, wait);
 		comedi_buf_write_alloc(s->async, s->async->prealloc_bufsz);
-- 
1.9.2



More information about the devel mailing list