All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [linux-next:master 7259/7889] drivers/hwspinlock/omap_hwspinlock.c:39:39: sparse: sparse: incorrect type in initializer (different address spaces)
Date: Thu, 12 Mar 2020 14:38:38 +0800	[thread overview]
Message-ID: <202003121423.0CDSGbHT%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 15181 bytes --]

Hi Baolin,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d44a64766795839eaa0f79a9e5365e8a794a1642
commit: 05eafe64881fae970470406948f2fb115f5fc347 [7259/7889] hwspinlock: Allow drivers to be built with COMPILE_TEST
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-174-g094d5a94-dirty
        git checkout 05eafe64881fae970470406948f2fb115f5fc347
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> drivers/hwspinlock/omap_hwspinlock.c:39:39: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *lock_addr @@    got n:2> *lock_addr @@
   drivers/hwspinlock/omap_hwspinlock.c:39:39: sparse:    expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/omap_hwspinlock.c:39:39: sparse:    got void *priv
   drivers/hwspinlock/omap_hwspinlock.c:47:39: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *lock_addr @@    got n:2> *lock_addr @@
   drivers/hwspinlock/omap_hwspinlock.c:47:39: sparse:    expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/omap_hwspinlock.c:47:39: sparse:    got void *priv
>> drivers/hwspinlock/omap_hwspinlock.c:132:30: sparse: sparse: incorrect type in assignment (different address spaces) @@    expected void *priv @@    got void [noderef] <asvoid *priv @@
   drivers/hwspinlock/omap_hwspinlock.c:132:30: sparse:    expected void *priv
   drivers/hwspinlock/omap_hwspinlock.c:132:30: sparse:    got void [noderef] <asn:2> *
--
>> drivers/hwspinlock/sirf_hwspinlock.c:35:39: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *lock_addr @@    got n:2> *lock_addr @@
   drivers/hwspinlock/sirf_hwspinlock.c:35:39: sparse:    expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/sirf_hwspinlock.c:35:39: sparse:    got void *priv
   drivers/hwspinlock/sirf_hwspinlock.c:43:39: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *lock_addr @@    got n:2> *lock_addr @@
   drivers/hwspinlock/sirf_hwspinlock.c:43:39: sparse:    expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/sirf_hwspinlock.c:43:39: sparse:    got void *priv
>> drivers/hwspinlock/sirf_hwspinlock.c:77:30: sparse: sparse: incorrect type in assignment (different address spaces) @@    expected void *priv @@    got void [noderef] <asvoid *priv @@
   drivers/hwspinlock/sirf_hwspinlock.c:77:30: sparse:    expected void *priv
   drivers/hwspinlock/sirf_hwspinlock.c:77:30: sparse:    got void [noderef] <asn:2> *
--
>> drivers/hwspinlock/sprd_hwspinlock.c:46:34: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *addr @@    got n:2> *addr @@
   drivers/hwspinlock/sprd_hwspinlock.c:46:34: sparse:    expected void [noderef] <asn:2> *addr
   drivers/hwspinlock/sprd_hwspinlock.c:46:34: sparse:    got void *priv
>> drivers/hwspinlock/sprd_hwspinlock.c:64:39: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *lock_addr @@    got n:2> *lock_addr @@
   drivers/hwspinlock/sprd_hwspinlock.c:64:39: sparse:    expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/sprd_hwspinlock.c:64:39: sparse:    got void *priv
>> drivers/hwspinlock/sprd_hwspinlock.c:131:28: sparse: sparse: incorrect type in assignment (different address spaces) @@    expected void *priv @@    got void [noderef] <asvoid *priv @@
   drivers/hwspinlock/sprd_hwspinlock.c:131:28: sparse:    expected void *priv
   drivers/hwspinlock/sprd_hwspinlock.c:131:28: sparse:    got void [noderef] <asn:2> *
--
>> drivers/hwspinlock/stm32_hwspinlock.c:30:39: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *lock_addr @@    got n:2> *lock_addr @@
   drivers/hwspinlock/stm32_hwspinlock.c:30:39: sparse:    expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/stm32_hwspinlock.c:30:39: sparse:    got void *priv
   drivers/hwspinlock/stm32_hwspinlock.c:41:39: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *lock_addr @@    got n:2> *lock_addr @@
   drivers/hwspinlock/stm32_hwspinlock.c:41:39: sparse:    expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/stm32_hwspinlock.c:41:39: sparse:    got void *priv
>> drivers/hwspinlock/stm32_hwspinlock.c:78:39: sparse: sparse: incorrect type in assignment (different address spaces) @@    expected void *priv @@    got void [noderef] <asvoid *priv @@
   drivers/hwspinlock/stm32_hwspinlock.c:78:39: sparse:    expected void *priv
   drivers/hwspinlock/stm32_hwspinlock.c:78:39: sparse:    got void [noderef] <asn:2> *
--
>> drivers/hwspinlock/u8500_hsem.c:52:39: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *lock_addr @@    got n:2> *lock_addr @@
   drivers/hwspinlock/u8500_hsem.c:52:39: sparse:    expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/u8500_hsem.c:52:39: sparse:    got void *priv
   drivers/hwspinlock/u8500_hsem.c:65:39: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *lock_addr @@    got n:2> *lock_addr @@
   drivers/hwspinlock/u8500_hsem.c:65:39: sparse:    expected void [noderef] <asn:2> *lock_addr
   drivers/hwspinlock/u8500_hsem.c:65:39: sparse:    got void *priv
>> drivers/hwspinlock/u8500_hsem.c:116:30: sparse: sparse: incorrect type in assignment (different address spaces) @@    expected void *priv @@    got void [noderef] <asvoid *priv @@
   drivers/hwspinlock/u8500_hsem.c:116:30: sparse:    expected void *priv
   drivers/hwspinlock/u8500_hsem.c:116:30: sparse:    got void [noderef] <asn:2> *
>> drivers/hwspinlock/u8500_hsem.c:126:52: sparse: sparse: incorrect type in initializer (different address spaces) @@    expected void [noderef] <asn:2> *io_base @@    got n:2> *io_base @@
   drivers/hwspinlock/u8500_hsem.c:126:52: sparse:    expected void [noderef] <asn:2> *io_base
   drivers/hwspinlock/u8500_hsem.c:126:52: sparse:    got void *

vim +39 drivers/hwspinlock/omap_hwspinlock.c

70ba4cc26b9f53 Simon Que      2011-02-17   36  
70ba4cc26b9f53 Simon Que      2011-02-17   37  static int omap_hwspinlock_trylock(struct hwspinlock *lock)
70ba4cc26b9f53 Simon Que      2011-02-17   38  {
300bab9770e2bd Ohad Ben-Cohen 2011-09-06  @39  	void __iomem *lock_addr = lock->priv;
70ba4cc26b9f53 Simon Que      2011-02-17   40  
70ba4cc26b9f53 Simon Que      2011-02-17   41  	/* attempt to acquire the lock by reading its value */
300bab9770e2bd Ohad Ben-Cohen 2011-09-06   42  	return (SPINLOCK_NOTTAKEN == readl(lock_addr));
70ba4cc26b9f53 Simon Que      2011-02-17   43  }
70ba4cc26b9f53 Simon Que      2011-02-17   44  
70ba4cc26b9f53 Simon Que      2011-02-17   45  static void omap_hwspinlock_unlock(struct hwspinlock *lock)
70ba4cc26b9f53 Simon Que      2011-02-17   46  {
300bab9770e2bd Ohad Ben-Cohen 2011-09-06   47  	void __iomem *lock_addr = lock->priv;
70ba4cc26b9f53 Simon Que      2011-02-17   48  
70ba4cc26b9f53 Simon Que      2011-02-17   49  	/* release the lock by writing 0 to it */
300bab9770e2bd Ohad Ben-Cohen 2011-09-06   50  	writel(SPINLOCK_NOTTAKEN, lock_addr);
70ba4cc26b9f53 Simon Que      2011-02-17   51  }
70ba4cc26b9f53 Simon Que      2011-02-17   52  
70ba4cc26b9f53 Simon Que      2011-02-17   53  /*
70ba4cc26b9f53 Simon Que      2011-02-17   54   * relax the OMAP interconnect while spinning on it.
70ba4cc26b9f53 Simon Que      2011-02-17   55   *
70ba4cc26b9f53 Simon Que      2011-02-17   56   * The specs recommended that the retry delay time will be
70ba4cc26b9f53 Simon Que      2011-02-17   57   * just over half of the time that a requester would be
70ba4cc26b9f53 Simon Que      2011-02-17   58   * expected to hold the lock.
70ba4cc26b9f53 Simon Que      2011-02-17   59   *
70ba4cc26b9f53 Simon Que      2011-02-17   60   * The number below is taken from an hardware specs example,
70ba4cc26b9f53 Simon Que      2011-02-17   61   * obviously it is somewhat arbitrary.
70ba4cc26b9f53 Simon Que      2011-02-17   62   */
70ba4cc26b9f53 Simon Que      2011-02-17   63  static void omap_hwspinlock_relax(struct hwspinlock *lock)
70ba4cc26b9f53 Simon Que      2011-02-17   64  {
70ba4cc26b9f53 Simon Que      2011-02-17   65  	ndelay(50);
70ba4cc26b9f53 Simon Que      2011-02-17   66  }
70ba4cc26b9f53 Simon Que      2011-02-17   67  
70ba4cc26b9f53 Simon Que      2011-02-17   68  static const struct hwspinlock_ops omap_hwspinlock_ops = {
70ba4cc26b9f53 Simon Que      2011-02-17   69  	.trylock = omap_hwspinlock_trylock,
70ba4cc26b9f53 Simon Que      2011-02-17   70  	.unlock = omap_hwspinlock_unlock,
70ba4cc26b9f53 Simon Que      2011-02-17   71  	.relax = omap_hwspinlock_relax,
70ba4cc26b9f53 Simon Que      2011-02-17   72  };
70ba4cc26b9f53 Simon Que      2011-02-17   73  
571291066d053c Bill Pemberton 2012-11-19   74  static int omap_hwspinlock_probe(struct platform_device *pdev)
70ba4cc26b9f53 Simon Que      2011-02-17   75  {
65bd4341d61678 Suman Anna     2015-03-04   76  	struct device_node *node = pdev->dev.of_node;
300bab9770e2bd Ohad Ben-Cohen 2011-09-06   77  	struct hwspinlock_device *bank;
300bab9770e2bd Ohad Ben-Cohen 2011-09-06   78  	struct hwspinlock *hwlock;
70ba4cc26b9f53 Simon Que      2011-02-17   79  	void __iomem *io_base;
300bab9770e2bd Ohad Ben-Cohen 2011-09-06   80  	int num_locks, i, ret;
65bd4341d61678 Suman Anna     2015-03-04   81  	/* Only a single hwspinlock block device is supported */
65bd4341d61678 Suman Anna     2015-03-04   82  	int base_id = 0;
70ba4cc26b9f53 Simon Que      2011-02-17   83  
65bd4341d61678 Suman Anna     2015-03-04   84  	if (!node)
c3c1250e93a7ab Ohad Ben-Cohen 2011-09-05   85  		return -ENODEV;
c3c1250e93a7ab Ohad Ben-Cohen 2011-09-05   86  
bf2740068a87e2 Baolin Wang    2020-01-08   87  	io_base = devm_platform_ioremap_resource(pdev, 0);
bf2740068a87e2 Baolin Wang    2020-01-08   88  	if (IS_ERR(io_base))
bf2740068a87e2 Baolin Wang    2020-01-08   89  		return PTR_ERR(io_base);
70ba4cc26b9f53 Simon Que      2011-02-17   90  
e1e4528f8c9962 Suman Anna     2014-07-02   91  	/*
e1e4528f8c9962 Suman Anna     2014-07-02   92  	 * make sure the module is enabled and clocked before reading
e1e4528f8c9962 Suman Anna     2014-07-02   93  	 * the module SYSSTATUS register
e1e4528f8c9962 Suman Anna     2014-07-02   94  	 */
e1e4528f8c9962 Suman Anna     2014-07-02   95  	pm_runtime_enable(&pdev->dev);
e1e4528f8c9962 Suman Anna     2014-07-02   96  	ret = pm_runtime_get_sync(&pdev->dev);
e1e4528f8c9962 Suman Anna     2014-07-02   97  	if (ret < 0) {
e1e4528f8c9962 Suman Anna     2014-07-02   98  		pm_runtime_put_noidle(&pdev->dev);
bf2740068a87e2 Baolin Wang    2020-01-08   99  		goto runtime_err;
e1e4528f8c9962 Suman Anna     2014-07-02  100  	}
e1e4528f8c9962 Suman Anna     2014-07-02  101  
70ba4cc26b9f53 Simon Que      2011-02-17  102  	/* Determine number of locks */
70ba4cc26b9f53 Simon Que      2011-02-17  103  	i = readl(io_base + SYSSTATUS_OFFSET);
70ba4cc26b9f53 Simon Que      2011-02-17  104  	i >>= SPINLOCK_NUMLOCKS_BIT_OFFSET;
70ba4cc26b9f53 Simon Que      2011-02-17  105  
e1e4528f8c9962 Suman Anna     2014-07-02  106  	/*
e1e4528f8c9962 Suman Anna     2014-07-02  107  	 * runtime PM will make sure the clock of this module is
e1e4528f8c9962 Suman Anna     2014-07-02  108  	 * enabled again iff at least one lock is requested
e1e4528f8c9962 Suman Anna     2014-07-02  109  	 */
e1e4528f8c9962 Suman Anna     2014-07-02  110  	ret = pm_runtime_put(&pdev->dev);
e1e4528f8c9962 Suman Anna     2014-07-02  111  	if (ret < 0)
bf2740068a87e2 Baolin Wang    2020-01-08  112  		goto runtime_err;
e1e4528f8c9962 Suman Anna     2014-07-02  113  
70ba4cc26b9f53 Simon Que      2011-02-17  114  	/* one of the four lsb's must be set, and nothing else */
70ba4cc26b9f53 Simon Que      2011-02-17  115  	if (hweight_long(i & 0xf) != 1 || i > 8) {
70ba4cc26b9f53 Simon Que      2011-02-17  116  		ret = -EINVAL;
bf2740068a87e2 Baolin Wang    2020-01-08  117  		goto runtime_err;
70ba4cc26b9f53 Simon Que      2011-02-17  118  	}
70ba4cc26b9f53 Simon Que      2011-02-17  119  
300bab9770e2bd Ohad Ben-Cohen 2011-09-06  120  	num_locks = i * 32; /* actual number of locks in this device */
c97f6dd0fe21df Ohad Ben-Cohen 2011-09-05  121  
42f291ebfdd83a Baolin Wang    2020-01-08  122  	bank = devm_kzalloc(&pdev->dev, struct_size(bank, lock, num_locks),
42f291ebfdd83a Baolin Wang    2020-01-08  123  			    GFP_KERNEL);
300bab9770e2bd Ohad Ben-Cohen 2011-09-06  124  	if (!bank) {
c97f6dd0fe21df Ohad Ben-Cohen 2011-09-05  125  		ret = -ENOMEM;
bf2740068a87e2 Baolin Wang    2020-01-08  126  		goto runtime_err;
c97f6dd0fe21df Ohad Ben-Cohen 2011-09-05  127  	}
c97f6dd0fe21df Ohad Ben-Cohen 2011-09-05  128  
300bab9770e2bd Ohad Ben-Cohen 2011-09-06  129  	platform_set_drvdata(pdev, bank);
70ba4cc26b9f53 Simon Que      2011-02-17  130  
300bab9770e2bd Ohad Ben-Cohen 2011-09-06  131  	for (i = 0, hwlock = &bank->lock[0]; i < num_locks; i++, hwlock++)
300bab9770e2bd Ohad Ben-Cohen 2011-09-06 @132  		hwlock->priv = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i;
70ba4cc26b9f53 Simon Que      2011-02-17  133  
300bab9770e2bd Ohad Ben-Cohen 2011-09-06  134  	ret = hwspin_lock_register(bank, &pdev->dev, &omap_hwspinlock_ops,
65bd4341d61678 Suman Anna     2015-03-04  135  						base_id, num_locks);
c97f6dd0fe21df Ohad Ben-Cohen 2011-09-05  136  	if (ret)
42f291ebfdd83a Baolin Wang    2020-01-08  137  		goto runtime_err;
70ba4cc26b9f53 Simon Que      2011-02-17  138  
d4d98bba3ea58e Suman Anna     2019-05-30  139  	dev_dbg(&pdev->dev, "Registered %d locks with HwSpinlock core\n",
d4d98bba3ea58e Suman Anna     2019-05-30  140  		num_locks);
d4d98bba3ea58e Suman Anna     2019-05-30  141  
70ba4cc26b9f53 Simon Que      2011-02-17  142  	return 0;
70ba4cc26b9f53 Simon Que      2011-02-17  143  
bf2740068a87e2 Baolin Wang    2020-01-08  144  runtime_err:
e1e4528f8c9962 Suman Anna     2014-07-02  145  	pm_runtime_disable(&pdev->dev);
70ba4cc26b9f53 Simon Que      2011-02-17  146  	return ret;
70ba4cc26b9f53 Simon Que      2011-02-17  147  }
70ba4cc26b9f53 Simon Que      2011-02-17  148  

:::::: The code at line 39 was first introduced by commit
:::::: 300bab9770e2bd10262bcc78e7249fdce2c74b38 hwspinlock/core: register a bank of hwspinlocks in a single API call

:::::: TO: Ohad Ben-Cohen <ohad@wizery.com>
:::::: CC: Ohad Ben-Cohen <ohad@wizery.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

                 reply	other threads:[~2020-03-12  6:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202003121423.0CDSGbHT%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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 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.