mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Drokin <green@linuxhacker.ru>
To: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: checkpatch falsepositives in Lustre code
Date: Mon, 15 Feb 2016 21:45:27 -0500	[thread overview]
Message-ID: <D08C68AD-49AA-4481-B0F6-0ACE38278466@linuxhacker.ru> (raw)
In-Reply-To: <1455589627.4046.35.camel@perches.com>


On Feb 15, 2016, at 9:27 PM, Joe Perches wrote:

> On Mon, 2016-02-15 at 20:57 -0500, Oleg Drokin wrote:
>> On Feb 15, 2016, at 7:56 PM, Joe Perches wrote:
>>> [etc...]
>>> 
>>> Yeah, that's a defect of some type.
>> 
>> Also while I have your attention, here's another one:
>> 
>> struct cfs_percpt_lock *
>> cfs_percpt_lock_alloc(struct cfs_cpt_table *cptab)
>> {
>>         struct cfs_percpt_lock  *pcl;
>>         spinlock_t              *lock;
>>         int                     i;
>> …
>>         cfs_percpt_for_each(lock, i, pcl->pcl_locks)
>>                 spin_lock_init(lock);
>> 
>> The declaration of the spinlock pointer produces:
>> CHECK: spinlock_t definition without comment
>> 
>> Should spinlock pointers really be included in the check, it's obvious that
>> they themselves are not really protecting anything, esp. considering it's a
>> local function variable here.
> 
> I don't have an opinion here.
> 
> spinlock_t pointers are relatively rare.

I guess they are. And I understand why you would want a comment for the actual
spinlock, but pointexr - much less so.

Anyway, I have some more questions:

ERROR: Macros with complex values should be enclosed in parentheses
#8720: FILE: drivers/staging/lustre/lustre/libcfs/tracefile.h:189:
+#define cfs_tcd_for_each(tcd, i, j)                                   \
+       for (i = 0; cfs_trace_data[i]; i++)                             \
+               for (j = 0, ((tcd) = &(*cfs_trace_data[i])[j].tcd);     \
+                    j < num_possible_cpus();                            \
+                    j++, (tcd) = &(*cfs_trace_data[i])[j].tcd)

This is a macros with complex value alright, but the whole idea of this one
is to not be enclosed. Any ideas about this one and similar?

  reply	other threads:[~2016-02-16  2:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1E5E2198-2E5C-4B6F-AAA5-C28E0A776714@linuxhacker.ru>
2016-02-16  0:56 ` Joe Perches
2016-02-16  1:57   ` Oleg Drokin
2016-02-16  2:27     ` Joe Perches
2016-02-16  2:45       ` Oleg Drokin [this message]
2016-02-16  3:05         ` Joe Perches
2016-02-16  3:12           ` Oleg Drokin

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=D08C68AD-49AA-4481-B0F6-0ACE38278466@linuxhacker.ru \
    --to=green@linuxhacker.ru \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®