Re: [PATCH] scripts/kernel-doc: support EXPORT_SYMBOL_NS_GPL() with -export

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 08, 2022 at 05:13:28PM +0000, Matthew Wilcox wrote:
> On Tue, Nov 08, 2022 at 12:21:17PM -0400, Jason Gunthorpe wrote:
> > On Tue, Nov 08, 2022 at 03:25:10PM +0000, Matthew Wilcox wrote:
> > > On Tue, Nov 08, 2022 at 11:02:35AM -0400, Jason Gunthorpe wrote:
> > > > (I don't know perl at all so happy to replace this with something more elegant)
> > > >  my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;';
> > > > +my $export_symbol_ns = '^\s*EXPORT_SYMBOL_NS(_GPL)?\s*\(\s*(\w+)\s*,\s*\w+\)\s*;';
> > > 
> > > How about:
> > > 
> > > -my $export_symbol = '^\s*EXPORT_SYMBOL(_GPL)?\s*\(\s*(\w+)\s*\)\s*;';
> > > +my $export_symbol = '^\s*EXPORT_SYMBOL(_NS)?(_GPL)?\s*\(\s*(\w+)\s*\)\s*;';
> > > 
> > > Not them i'm a perlite either, but this is just a regexp.
> > 
> > I started like that, but the target text looks like this:
> > 
> > EXPORT_SYMBOL_NS_GPL(iommufd_access_destroy, IOMMUFD);
> > 
> > And the (\w+) capture should only pick "iommufd_access_destroy", so
> > the ideal regex does the ",\s*\w+)" part only if _NS was matched
> > earlier.
> 
> Oh, right, I missed that part of the regex difference.  How about
> terminating the match with [,)]?  ie:
> 
> +my $export_symbol = '^\s*EXPORT_SYMBOL(_NS)?(_GPL)?\s*\(\s*(\w+[,)]\s*\)\s*;';

Ah, I came up with this ugly thing:

^\s*EXPORT_SYMBOL(_NS)?(_GPL)?\s*\(\s*(\w+?)(\s*,\s*\w+)?\s*\)\s*;

As there is still some trailing \w that the \s won't match.

Jason



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux