lkml.org 
[lkml]   [2009]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Checkpatch false positive?
On Tue 27-01-09 08:19:54, Arjan van de Ven wrote:
> On Tue, 27 Jan 2009 16:49:05 +0100
> Jan Kara <jack@suse.cz> wrote:
>
> > Hi,
> >
> > I've used checkpatch.pl to verify one of my patches. It complains:
> >
> > ERROR: trailing statements should be on next line
> > #167: FILE: fs/quota/quota_tree.c:249:
> > + for (i = 0, ddquot = buf + sizeof(struct qt_disk_dqdbheader);
> > [...]
> > i++, ddquot += info->dqi_entry_size);
> >
> > But the code looks like:
> > for (i = 0, ddquot = buf + sizeof(struct qt_disk_dqdbheader);
> > i < qtree_dqstr_in_blk(info)
> > && !qtree_entry_unused(info, ddquot); i++, ddquot +=
> > info->dqi_entry_size);
> >
>
> while tihs might be correct C... don't you think it would be much
> better to actually have a statement here rather than cramming
> everything into the for ?
This is an old code and I was just wrapping lines to fit into 80 chars...
But you're right, I can rewrite the loop into more readable form when I'm
at it.

Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR


\
 
 \ /
  Last update: 2009-01-27 17:35    [from the cache]
©2003-2011 Jasper Spaans