Solving checkpatch error with lex

karthik nayak karthik.188 at gmail.com
Wed Dec 17 13:34:48 EST 2014


Hello,
was trying to fix the checkpatch error of not using c99 comments in the 
file
drivers/staging/rtl8192u/r8192U_dm.c
so I wrote a lex program to do so since there were way too many to do it 
manually.
Could anyone have a look at my lex code and tell me if I need to change it.
I have attached the lex code.
As per my testing it works perfectly, would love a second opinion.
Thanks,
Karthik
-------------- next part --------------
%{
#include <stdio.h>	
%}

%%
"//".* {fprintf(yyout, "/*%s*/", yytext + 2);}
(.|\n) {fprintf(yyout, "%s", yytext);}
%%

main()
{
	yyin = fopen("tmp.c", "r");
	yyout = fopen("aaa.c", "w");
	yylex();
	fclose(yyin);
	fclose(yyout);
}

yywrap()
{
	return 1;
}


More information about the Kernelnewbies mailing list