[ovs-dev] checkpatch name checking

Ben Pfaff blp at ovn.org
Mon May 8 14:50:43 UTC 2017


On Mon, May 08, 2017 at 10:33:19AM -0400, Aaron Conole wrote:
> Ben Pfaff <blp at ovn.org> writes:
> 
> > Hi Aaron, checkpatch currently tries to ignores files in the "datapath"
> > directories but it's not entirely successful.  I think that's because,
> > in the "parse == 1" case, it doesn't strip a leading "a/" or "b/" from
> > filenames:
> >                 current_file = match.group(2)
> > whereas in the "parse == 2", it does:
> >                 current_file = newfile.group(2)[2:]
> > and the check for "datapath" relies on the / being there:
> >             # Skip files which have /datapath in them, since they are
> >             # linux or windows coding standards
> >             if '/datapath' in current_file:
> >                 continue
> > I'm not sure where the real bug is.  Should the prefix be consistently
> > stripped or not stripped?  Once that's decided, it's easy to fix the
> > problem.
> 
> I think it should be consistently stripped.  The regex matches don't
> care, but when the filename is printed to the screen, it will include b/
> which makes simply opening the file in an editor not work correctly.
> 
> I think given that, the parse==1 case is incorrect, and the datapath
> check is also incorrect.
> 
> Make sense?

Got it.  Thanks!  I sent a patch:
        https://patchwork.ozlabs.org/patch/759661/


More information about the dev mailing list