]> git.baikalelectronics.ru Git - kernel.git/commit
scripts: coccicheck: Correct usage of make coccicheck
authorSumera Priyadarsini <sylphrenadin@gmail.com>
Tue, 24 Nov 2020 20:32:12 +0000 (02:02 +0530)
committerJulia Lawall <Julia.Lawall@inria.fr>
Thu, 24 Dec 2020 11:59:43 +0000 (12:59 +0100)
commitc17ef0211da41fe3871d65f43cfc227d467d99db
treef067df0e5205251202fc7fae956ac92c971c4f47
parentf48647d6f4dc1c2faa5e7c0579dd7ac2a50f7769
scripts: coccicheck: Correct usage of make coccicheck

The command "make coccicheck C=1 CHECK=scripts/coccicheck" results in the
error:
        ./scripts/coccicheck: line 65: -1: shift count out of range

This happens because every time the C variable is specified,
the shell arguments need to be "shifted" in order to take only
the last argument, which is the C file to test. These shell arguments
mostly comprise flags that have been set in the Makefile. However,
when coccicheck is specified in the make command as a rule, the
number of shell arguments is zero, thus passing the invalid value -1
to the shift command, resulting in an error.

Modify coccicheck to print correct usage of make coccicheck so as to
avoid the error.

Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
scripts/coccicheck