All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Tobin C. Harding" <me@tobin.cc>, Andy Whitcroft <apw@canonical.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: checkpatch suspected false positive
Date: Tue, 21 Feb 2017 15:19:22 -0800	[thread overview]
Message-ID: <1487719162.2853.41.camel@perches.com> (raw)
In-Reply-To: <20170221230148.GA25711@eros>

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.

  reply	other threads:[~2017-02-21 23:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 23:01 checkpatch suspected false positive Tobin C. Harding
2017-02-21 23:19 ` Joe Perches [this message]
2017-02-21 23:52   ` Tobin C. Harding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487719162.2853.41.camel@perches.com \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@tobin.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.