lkml.org 
[lkml]   [2014]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: comedi: drivers: pcl812.c: fixed a coding style issue
On Fri, Apr 04, 2014 at 06:17:56PM +0300, Kumar Amit Mehta wrote:
> On Fri, Apr 04, 2014 at 04:26:51PM +0300, Dan Carpenter wrote:
> > On Fri, Apr 04, 2014 at 02:48:52PM +0300, Kumar Amit Mehta wrote:
> > > On Fri, Apr 04, 2014 at 02:07:07PM +0300, Dan Carpenter wrote:
> > > > On Fri, Apr 04, 2014 at 01:05:29PM +0300, Kumar Amit Mehta wrote:
> > > > > Fixed a coding style issue. Reported by checkpatch.pl
> > > > >
> > > >
> > > > It's better if the commit messages are more specific than this.
> > >
> > > So, should I resend the patch with a more appropriate commit message ?
> >
> > [PATCH] staging: comedi: drivers: pcl812.c: add curly braces for checkpatch
> >
> > Kernel style is that if one side of the if else statement gets has curly
> > braces then both side should have them.
>
> Dan,
>
> What Walter mentioned also makes sense, So shouldn't it be something
> like this:
>
> [amit@localhost linux-next]$ git diff
> diff --git a/drivers/staging/comedi/drivers/pcl812.c
> b/drivers/staging/comedi/drivers/pcl812.c
> index 160eac8..552b696 100644
> --- a/drivers/staging/comedi/drivers/pcl812.c
> +++ b/drivers/staging/comedi/drivers/pcl812.c
> @@ -803,16 +803,14 @@ static int pcl812_ai_cmd(struct comedi_device
> *dev, struct comedi_subdevice *s)
>
> pcl812_ai_set_chan_range(dev, cmd->chanlist[0], 1);
>
> + devpriv->ai_dma = 0;
> if (devpriv->dma) { /* check if we can use DMA transfer */
> devpriv->ai_dma = 1;
> for (i = 1; i < cmd->chanlist_len; i++)
> if (cmd->chanlist[0] != cmd->chanlist[i]) {
> /* we cann't use DMA :-( */
> - devpriv->ai_dma = 0;

You'd still want this assignment.

> break;
> }
> - } else
> - devpriv->ai_dma = 0;

regards,
dan carpenter



\
 
 \ /
  Last update: 2014-04-04 18:21    [W:0.739 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site