Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1586053
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Ian Abbott <abbotti@mev.co.uk> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference |
| Date | Wed, 22 Feb 2017 11:40:01 +0100 |
| Message-ID | <tdCuZ-eA-1@gated-at.bofh.it> (permalink) |
| References | <tdmqd-5F2-5@gated-at.bofh.it> |
| X-Original-To | Cheah Kok Cheong <thrust73@gmail.com>, hsweeten@visionengravers.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org |
| X-Session-Marker | 69616E406162626F74742E6F7267 |
| X-Spam-Summary | 50,0,0,,d41d8cd98f00b204,abbotti@mev.co.uk,:::::::::,RULES_HIT:41:355:379:599:800:960:967:973:988:989:1260:1261:1263:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1541:1593:1594:1683:1711:1730:1747:1777:1792:1801:2198:2199:2393:2525:2560:2563:2612:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3000:3022:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:5007:7514:7652:9025:9040:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12048:12438:12555:12740:12760:12895:12986:13069:13255:13311:13357:14093:14097:14181:14571:14685:14721:14764:14777:21080:21451:30021:30054,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none |
| X-He-Tag | fire56_6ae4aa53e4518 |
| X-Filterd-Recvd-Size | 2449 |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 44 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org |
| X-Original-Date | Wed, 22 Feb 2017 10:35:32 +0000 |
| X-Original-Message-ID | <8e25d1fd-9475-48d4-e2b3-dc15b18cbf4e@mev.co.uk> |
| X-Original-References | <1487697908-26927-1-git-send-email-thrust73@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1586053 |
Show key headers only | View raw
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/ )=-
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference Cheah Kok Cheong <thrust73@gmail.com> - 2017-02-21 18:30 +0100 Re: [PATCH v2] Staging: comedi: drivers: comedi_test: Avoid multiple line dereference Ian Abbott <abbotti@mev.co.uk> - 2017-02-22 11:40 +0100
csiph-web