]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Staging: comedi: drivers: comedi_test: Avoid multiple line dereference
authorCheah Kok Cheong <thrust73@gmail.com>
Tue, 21 Feb 2017 17:25:08 +0000 (01:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Mar 2017 08:16:58 +0000 (09:16 +0100)
Fix checkpatch warning "Avoid multiple line dereference"
using a pointer variable to avoid line wrap.

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/comedi_test.c

index 2a063f07fe7bca6ad9159e6b4c8df04d5a49e994..ccfd642998be69386dca7385022451e609e1900a 100644 (file)
@@ -480,11 +480,11 @@ static void waveform_ao_timer(unsigned long arg)
                        /* output the last scan */
                        for (i = 0; i < cmd->scan_end_arg; i++) {
                                unsigned int chan = CR_CHAN(cmd->chanlist[i]);
+                               unsigned short *pd;
 
-                               if (comedi_buf_read_samples(s,
-                                                           &devpriv->
-                                                            ao_loopbacks[chan],
-                                                           1) == 0) {
+                               pd = &devpriv->ao_loopbacks[chan];
+
+                               if (!comedi_buf_read_samples(s, pd, 1)) {
                                        /* unexpected underrun! (cancelled?) */
                                        async->events |= COMEDI_CB_OVERFLOW;
                                        goto underrun;