From 9b71f79f6e349251e529ef25f2d3bf8aa6168d26 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Wed, 19 Oct 2022 15:28:43 -0500 Subject: checkpatch: add warning for non-lore mailing list URLs The lkml.org, marc.info, spinics.net, etc archives are not quite as useful as lore.kernel.org because they use different styles, add advertising, and may disappear in the future. The lore archives are more consistent and more likely to stick around, so prefer https://lore.kernel.org URLs when they exist. [bhelgaas@google.com: only warn if we see "http" before the archive hostname] Link: https://lkml.kernel.org/r/20221114224315.GA939630@bhelgaas Link: https://lkml.kernel.org/r/20221019202843.40810-1-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Peter Collingbourne Cc: Andy Whitcroft Cc: Dwaipayan Ray Cc: Kees Cook Cc: Lukas Bulwahn Cc: Randy Dunlap # build-tested Cc: Joe Perches Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'scripts') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1e5e66ae5a52..bd1b9d7a1647 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -702,6 +702,17 @@ sub find_standard_signature { return ""; } +our $obsolete_archives = qr{(?xi: + \Qfreedesktop.org/archives/dri-devel\E | + \Qlists.infradead.org\E | + \Qlkml.org\E | + \Qmail-archive.com\E | + \Qmailman.alsa-project.org/pipermail\E | + \Qmarc.info\E | + \Qozlabs.org/pipermail\E | + \Qspinics.net\E +)}; + our @typeListMisordered = ( qr{char\s+(?:un)?signed}, qr{int\s+(?:(?:un)?signed\s+)?short\s}, @@ -3324,6 +3335,12 @@ sub process { $last_git_commit_id_linenr = $linenr if ($line =~ /\bcommit\s*$/i); } +# Check for mailing list archives other than lore.kernel.org + if ($rawline =~ m{http.*\b$obsolete_archives}) { + WARN("PREFER_LORE_ARCHIVE", + "Use lore.kernel.org archive links when possible - see https://lore.kernel.org/lists.html\n" . $herecurr); + } + # Check for added, moved or deleted files if (!$reported_maintainer_file && !$in_commit_log && ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ || -- cgit v1.2.3-70-g09d2 From dc3f4dee81cd85b039d07b8d75cfbae4668a15d2 Mon Sep 17 00:00:00 2001 From: Stanislaw Gruszka Date: Thu, 27 Oct 2022 15:43:34 +0200 Subject: scripts: checkpatch: allow "case" macros Do not report errors like below: ./scripts/checkpatch.pl -f drivers/net/wireless/ath/ath10k/wmi.h ERROR: Macros with complex values should be enclosed in parentheses +#define C2S(x) case x: return #x since many "case ..." macros are already used by some in-kernel drivers. Link: https://lkml.kernel.org/r/20221027134334.164301-1-stf_xl@wp.pl Signed-off-by: Stanislaw Gruszka Acked-by: Joe Perches Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index bd1b9d7a1647..29517897baa1 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5918,6 +5918,7 @@ sub process { $dstat !~ /$exceptions/ && $dstat !~ /^\.$Ident\s*=/ && # .foo = $dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo + $dstat !~ /^case\b/ && # case ... $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...) $dstat !~ /^while\s*$Constant\s*$Constant\s*$/ && # while (...) {...} $dstat !~ /^for\s*$Constant$/ && # for (...) -- cgit v1.2.3-70-g09d2 From 7b9cbc7701d562e60ae0836dbad27ea9cf7e0f8d Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 8 Nov 2022 11:07:12 +0000 Subject: scripts/spelling.txt: add more spellings to spelling.txt Some of the more common spelling mistakes and typos that I've found while fixing up spelling mistakes in the kernel in the past year. Link: https://lkml.kernel.org/r/20221108110712.114611-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Andrew Morton --- scripts/spelling.txt | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/spelling.txt b/scripts/spelling.txt index 8435b99452b6..ded8bcfc0247 100644 --- a/scripts/spelling.txt +++ b/scripts/spelling.txt @@ -23,6 +23,7 @@ absoulte||absolute acccess||access acceess||access accelaration||acceleration +accelearion||acceleration acceleratoin||acceleration accelleration||acceleration accesing||accessing @@ -58,6 +59,7 @@ acording||according activete||activate actived||activated actualy||actually +actvie||active acumulating||accumulating acumulative||accumulative acumulator||accumulator @@ -253,6 +255,7 @@ brigde||bridge broadcase||broadcast broadcat||broadcast bufer||buffer +bufferred||buffered bufufer||buffer cacluated||calculated caculate||calculate @@ -273,6 +276,7 @@ cant||can't cant'||can't canot||cannot cann't||can't +cannnot||cannot capabilites||capabilities capabilties||capabilities capabilty||capability @@ -309,6 +313,7 @@ chiled||child chked||checked chnage||change chnages||changes +chnange||change chnnel||channel choosen||chosen chouse||chose @@ -439,6 +444,7 @@ defferred||deferred definate||definite definately||definitely definiation||definition +definiton||definition defintion||definition defintions||definitions defualt||default @@ -452,6 +458,7 @@ delare||declare delares||declares delaring||declaring delemiter||delimiter +delibrately||deliberately delievered||delivered demodualtor||demodulator demension||dimension @@ -481,6 +488,7 @@ destroied||destroyed detabase||database deteced||detected detectt||detect +detroyed||destroyed develope||develop developement||development developped||developed @@ -507,6 +515,7 @@ dimention||dimension dimesions||dimensions diconnected||disconnected disabed||disabled +disasembler||disassembler disble||disable disgest||digest disired||desired @@ -666,6 +675,7 @@ finanize||finalize findn||find finilizes||finalizes finsih||finish +fliter||filter flusing||flushing folloing||following followign||following @@ -725,6 +735,7 @@ hanled||handled happend||happened hardare||hardware harware||hardware +hardward||hardware havind||having heirarchically||hierarchically heirarchy||hierarchy @@ -740,6 +751,7 @@ howver||however hsould||should hypervior||hypervisor hypter||hyper +idel||idle identidier||identifier iligal||illegal illigal||illegal @@ -931,9 +943,11 @@ matchs||matches mathimatical||mathematical mathimatic||mathematic mathimatics||mathematics +maxmium||maximum maximium||maximum maxium||maximum mechamism||mechanism +mechanim||mechanism meetign||meeting memeory||memory memmber||member @@ -942,6 +956,7 @@ memroy||memory ment||meant mergable||mergeable mesage||message +mesages||messages messags||messages messgaes||messages messsage||message @@ -983,8 +998,9 @@ monochromo||monochrome monocrome||monochrome mopdule||module mroe||more -multipler||multiplier mulitplied||multiplied +muliple||multiple +multipler||multiplier multidimensionnal||multidimensional multipe||multiple multple||multiple @@ -1109,6 +1125,7 @@ peroid||period persistance||persistence persistant||persistent phoneticly||phonetically +plaform||platform plalform||platform platfoem||platform platfrom||platform @@ -1236,6 +1253,7 @@ refering||referring refernces||references refernnce||reference refrence||reference +regiser||register registed||registered registerd||registered registeration||registration @@ -1276,6 +1294,7 @@ reseting||resetting reseved||reserved reseverd||reserved resizeable||resizable +resotre||restore resouce||resource resouces||resources resoures||resources @@ -1314,6 +1333,7 @@ runtine||runtime sacrifying||sacrificing safly||safely safty||safety +satify||satisfy savable||saveable scaleing||scaling scaned||scanned @@ -1365,10 +1385,12 @@ similiar||similar simlar||similar simliar||similar simpified||simplified +simultaneusly||simultaneously simultanous||simultaneous singaled||signaled singal||signal singed||signed +slect||select sleeped||slept sliped||slipped softwade||software @@ -1438,6 +1460,7 @@ suported||supported suport||support supportet||supported suppored||supported +supporing||supporting supportin||supporting suppoted||supported suppported||supported @@ -1475,15 +1498,18 @@ sytem||system sythesis||synthesis taht||that tained||tainted +tarffic||traffic tansmit||transmit targetted||targeted targetting||targeting taskelt||tasklet teh||the +temeprature||temperature temorary||temporary temproarily||temporarily temperture||temperature thead||thread +theads||threads therfore||therefore thier||their threds||threads @@ -1533,12 +1559,14 @@ ture||true tyep||type udpate||update uesd||used +unknwon||unknown uknown||unknown usccess||success uncommited||uncommitted uncompatible||incompatible unconditionaly||unconditionally undeflow||underflow +undelying||underlying underun||underrun unecessary||unnecessary unexecpted||unexpected @@ -1569,11 +1597,14 @@ unneedingly||unnecessarily unnsupported||unsupported unmached||unmatched unprecise||imprecise +unpriviledged||unprivileged +unpriviliged||unprivileged unregester||unregister unresgister||unregister unrgesiter||unregister unsinged||unsigned unstabel||unstable +unsolicted||unsolicited unsolicitied||unsolicited unsuccessfull||unsuccessful unsuported||unsupported -- cgit v1.2.3-70-g09d2 From 3965292ad0ca70320f1c632f2ac3b886c88b9e80 Mon Sep 17 00:00:00 2001 From: Liao Chang Date: Fri, 4 Nov 2022 15:05:23 +0800 Subject: checkpatch: add check for array allocator family argument order These array allocator family are sometimes misused with the first and second arguments switched. Same issue with calloc, kvcalloc, kvmalloc_array etc. Bleat if sizeof is the first argument. Link: https://lore.kernel.org/lkml/5374345c-7973-6a3c-d559-73bf4ac15079@redhat.com/ Link: https://lkml.kernel.org/r/20221104070523.60296-1-liaochang1@huawei.com Signed-off-by: Liao Chang Acked-by: Joe Perches Cc: Lukas Bulwahn Cc: Christophe JAILLET Cc: Andy Whitcroft Cc: Bagas Sanjaya Cc: Dwaipayan Ray Cc: Paolo Bonzini Signed-off-by: Andrew Morton --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 29517897baa1..78cc595b98ce 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -7146,7 +7146,7 @@ sub process { } # check for alloc argument mismatch - if ($line =~ /\b((?:devm_)?(?:kcalloc|kmalloc_array))\s*\(\s*sizeof\b/) { + if ($line =~ /\b((?:devm_)?((?:k|kv)?(calloc|malloc_array)(?:_node)?))\s*\(\s*sizeof\b/) { WARN("ALLOC_ARRAY_ARGS", "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr); } -- cgit v1.2.3-70-g09d2