From: Ian Abbott <abbotti@mev.co.uk>
To: Cheah Kok Cheong <thrust73@gmail.com>,
hsweeten@visionengravers.com, gregkh@linuxfoundation.org,
devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference
Date: Wed, 22 Feb 2017 10:35:32 +0000 [thread overview]
Message-ID: <8e25d1fd-9475-48d4-e2b3-dc15b18cbf4e@mev.co.uk> (raw)
In-Reply-To: <1487697908-26927-1-git-send-email-thrust73@gmail.com>
On 21/02/17 17:25, Cheah Kok Cheong wrote:
> Fix checkpatch warning "Avoid multiple line dereference"
> using a pointer variable to avoid line wrap.
>
> Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
> ---
>
> V2:
> -Use pointer instead of normal variable - Ian
> -Variable is to be used as "write destination" and
> not as "read source" - Ian
>
> drivers/staging/comedi/drivers/comedi_test.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c
> index 2a063f0..ccfd642 100644
> --- a/drivers/staging/comedi/drivers/comedi_test.c
> +++ b/drivers/staging/comedi/drivers/comedi_test.c
> @@ -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;
>
Looks good, thanks!
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-
prev parent reply other threads:[~2017-02-22 10:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 17:25 Cheah Kok Cheong
2017-02-22 10:35 ` Ian Abbott [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8e25d1fd-9475-48d4-e2b3-dc15b18cbf4e@mev.co.uk \
--to=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thrust73@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®