Re: [PATCH -v2 1/7] module: Convert symbol namespace to string literal

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

 



On Mon, Dec 02, 2024 at 04:15:33PM +0100, Peter Zijlstra wrote:
> On Mon, Dec 02, 2024 at 03:59:47PM +0100, Peter Zijlstra wrote:
> > Clean up the existing export namespace code along the same lines of
> > 33def8498fdd ("treewide: Convert macro and uses of __section(foo) to
> > __section("foo")") and for the same reason, it is not desired for the
> > namespace argument to be a macro expansion itself.
> > 
> > git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file;
> > do
> >   awk -i inplace '
> >     /^#define EXPORT_SYMBOL_NS/ {
> >       gsub(/__stringify\(ns\)/, "ns");
> >       print;
> >       next;
> >     }
> >     /^#define MODULE_IMPORT_NS/ {
> >       gsub(/__stringify\(ns\)/, "ns");
> >       print;
> >       next;
> >     }
> >     /MODULE_IMPORT_NS/ {
> >       $0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g");
> >     }
> >     /EXPORT_SYMBOL_NS/ {
> >       if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) {
> > 	if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ &&
> > 	    $0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ &&
> > 	    $0 !~ /^my/) {
> > 	  getline line;
> > 	  gsub(/[[:space:]]*\\$/, "");
> > 	  gsub(/[[:space:]]/, "", line);
> > 	  $0 = $0 " " line;
> > 	}
> > 
> > 	$0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/,
> > 		    "\\1(\\2, \"\\3\")", "g");
> >       }
> >     }
> >     { print }' $file;
> > done
> 
> Perhaps we can ask Linus to run this now, before -next fills up again ?

Yes please!




[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux