mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: kernel test robot <lkp@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: Re: [rt-devel:linux-5.15.y-rt-rebase 85/155] drivers/md/raid5.c:2222:20: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Mon, 11 Oct 2021 12:42:57 +0200	[thread overview]
Message-ID: <20211011104257.tyxo5pm4jln3a7ng@linutronix.de> (raw)
In-Reply-To: <202110092249.dDmDslZ6-lkp@intel.com>

On 2021-10-09 22:20:57 [+0800], kernel test robot wrote:
> sparse warnings: (new ones prefixed by >>)
> >> drivers/md/raid5.c:2222:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __percpu * @@
>    drivers/md/raid5.c:2222:20: sparse:     expected struct spinlock [usertype] *lock
>    drivers/md/raid5.c:2222:20: sparse:     got struct spinlock [noderef] __percpu *
>    drivers/md/raid5.c:2281:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct spinlock [usertype] *lock @@     got struct spinlock [noderef] __percpu * @@
>    drivers/md/raid5.c:2281:22: sparse:     expected struct spinlock [usertype] *lock
>    drivers/md/raid5.c:2281:22: sparse:     got struct spinlock [noderef] __percpu *

I think the code itself is correct but sparse got confused by the
definition of the struct. Defining raid5_percpu on its own makes the
warning go away:

diff --git a/drivers/md/raid5.h b/drivers/md/raid5.h
--- a/drivers/md/raid5.h
+++ b/drivers/md/raid5.h
@@ -559,6 +559,17 @@ struct r5pending_data {
 	struct bio_list bios;
 };
 
+/* per cpu variables */
+struct raid5_percpu {
+	spinlock_t	lock;		/* Protection for -RT */
+	struct page	*spare_page; /* Used when checking P/Q in raid6 */
+	void		*scribble;  /* space for constructing buffer
+				     * lists and performing address
+				     * conversions
+				     */
+	int scribble_obj_size;
+};
+
 struct r5conf {
 	struct hlist_head	*stripe_hashtbl;
 	/* only protect corresponding hash list and inactive_list */
@@ -634,15 +645,7 @@ struct r5conf {
 					    */
 	int			recovery_disabled;
 	/* per cpu variables */
-	struct raid5_percpu {
-		spinlock_t	lock;		/* Protection for -RT */
-		struct page	*spare_page; /* Used when checking P/Q in raid6 */
-		void		*scribble;  /* space for constructing buffer
-					     * lists and performing address
-					     * conversions
-					     */
-		int scribble_obj_size;
-	} __percpu *percpu;
+	struct raid5_percpu	__percpu *percpu;
 	int scribble_disks;
 	int scribble_sectors;
 	struct hlist_node node;

The RCU warnings look valid since there are __rcu annotations.

Sebastian

      reply	other threads:[~2021-10-11 10:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-09 14:20 kernel test robot
2021-10-11 10:42 ` Sebastian Andrzej Siewior [this message]

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=20211011104257.tyxo5pm4jln3a7ng@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=tglx@linutronix.de \
    /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®