public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference
@ 2017-02-20  8:28 Cheah Kok Cheong
  2017-02-20 10:03 ` Ian Abbott
  0 siblings, 1 reply; 10+ messages in thread
From: Cheah Kok Cheong @ 2017-02-20  8:28 UTC (permalink / raw)
  To: abbotti, hsweeten, gregkh, devel; +Cc: linux-kernel, Cheah Kok Cheong

Fix checkpatch warning "Avoid multiple line dereference"
using a local variable to avoid line wrap.

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
---
 drivers/staging/comedi/drivers/comedi_test.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c
index 2a063f0..fde83e0 100644
--- a/drivers/staging/comedi/drivers/comedi_test.c
+++ b/drivers/staging/comedi/drivers/comedi_test.c
@@ -480,11 +480,9 @@ 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 d = devpriv->ao_loopbacks[chan];
 
-				if (comedi_buf_read_samples(s,
-							    &devpriv->
-							     ao_loopbacks[chan],
-							    1) == 0) {
+				if (!comedi_buf_read_samples(s, &d, 1)) {
 					/* unexpected underrun! (cancelled?) */
 					async->events |= COMEDI_CB_OVERFLOW;
 					goto underrun;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-22  8:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-20  8:28 [PATCH] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference Cheah Kok Cheong
2017-02-20 10:03 ` Ian Abbott
2017-02-20 16:02   ` Cheah Kok Cheong
2017-02-20 17:36     ` Ian Abbott
2017-02-21  9:33       ` Cheah Kok Cheong
2017-02-21 10:12         ` Ian Abbott
2017-02-21 10:20           ` Valentin Rothberg
2017-02-21 16:31             ` Cheah Kok Cheong
2017-02-21 17:22               ` Joe Perches
2017-02-22  8:30                 ` Valentin Rothberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox