lkml.org 
[lkml]   [2021]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: checkpatch warns a symbolic link has not a newline
Date
Hi Joe,

The following is a demonstrated patch which creates a symbolic link
pointing to a existed file.

diff --git a/tools/gpio/dummy.h b/tools/gpio/dummy.h
new file mode 120000
index 000000000000..ace4df60bac6
--- /dev/null
+++ b/tools/gpio/dummy.h
@@ -0,0 +1 @@
+gpio-utils.h
\ No newline at end of file

tools/gpio/dummy.h is created by command 'ln -s gpio-utils.h dummy.h'.
scripts/checkpatch.pl returned a warning likes that:

WARNING: adding a line without newline at end of file
#22: FILE: tools/gpio/dummy.h:1:
+gpio-utils.h

command 'ln -s' creates a symbolic link which has no newline at end of
file. For a symbolic link created by 'ln -s' always get the warning.

If symbolic links are allowed, it should not be warned, is it?

Best Regards,
Michael Wu

> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Wednesday, November 10, 2021 4:09 PM
> To: Michael.Wu(吳忠益)
> Subject: Re: checkpatch warns a symbolic link has not a newline
>
> On Wed, 2021-11-10 at 06:39 +0000, Michael.Wu@vatics.com wrote:
> > Hi Andy & Joe,
> >
> > I have a commit that contains a newly created symbolic link pointing to a
> certain file. I used ./scripts/checkpatch.pl to check this commit and then I got a
> WARNING: adding a line without newline at end of file. The symbolic link was
> created by ln -s.
> >
> > I'm confused why it returned such a warning. Is the content of the patch not
> allowed to contain symbolic links? If it is allowed, I think checkpatch.pl can
> make some improvements, so that symbolic links will not be treated a
> warnings because of missing newline at end of file.
> >
> > Best Regards,
> > Michael Wu
>
> Send me an email that contains the patch that produces this message please.
>

\
 
 \ /
  Last update: 2021-11-10 09:53    [W:0.097 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site