Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1585798

Re: checkpatch suspected false positive

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: checkpatch suspected false positive
Date 2017-02-22 00:20 +0100
Message-ID <tdrSV-11G-7@gated-at.bofh.it> (permalink)
References <tdrJg-Yh-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2017-02-22 at 10:01 +1100, Tobin C. Harding wrote:
> Checkpatch may be giving a false positive of type CONST_STRUCT when
> parsing files in drivers/staging/comedi/drivers.
> 
> $ pwd
> build/kernel/linux-trees/gregKH/staging/
> 
> $ cd drivers/staging/comedi/drivers
> 
> $ checkpatch --terse --show-types *.c | grep CONST_STRUCT
> addi_apci_3501.c:97: WARNING:CONST_STRUCT: struct comedi_lrange should normally be const
> das16.c:972: WARNING:CONST_STRUCT: struct comedi_lrange should normally be const
> das16.c:1006: WARNING:CONST_STRUCT: struct comedi_lrange should normally be const
> jr3_pci.c:659: WARNING:CONST_STRUCT: struct comedi_lrange should normally be const
> jr3_pci.c:667: WARNING:CONST_STRUCT: struct comedi_lrange should normally be const
> jr3_pci.c:668: WARNING:CONST_STRUCT: struct comedi_lrange should normally be const
> ni_670x.c:212: WARNING:CONST_STRUCT: struct comedi_lrange should normally be const

checkpatch is brainless, it just looks for patterns
that are atypical.

$ git grep -E "struct\s+comedi_lrange\b" | wc -l
223
$ git grep -E "const\s+struct\s+comedi_lrange\b" | wc -l
215

So, yes, that struct is normally const.
Normally doesn't mean always or has to be.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

checkpatch suspected false positive "Tobin C. Harding" <me@tobin.cc> - 2017-02-22 00:10 +0100
  Re: checkpatch suspected false positive Joe Perches <joe@perches.com> - 2017-02-22 00:20 +0100
    Re: checkpatch suspected false positive "Tobin C. Harding" <me@tobin.cc> - 2017-02-22 01:00 +0100

csiph-web