[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159281499670.62212.17969220355200979156@swboyd.mtv.corp.google.com>
Date: Mon, 22 Jun 2020 01:36:36 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: kernel test robot <lkp@...el.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Mark Brown <broonie@...nel.org>, Arnd Bergmann <arnd@...db.de>
Subject: Re: drivers/clk/clk-divider.c:39:17: sparse: sparse: incorrect type in argument 1 (different base types)
Quoting kernel test robot (2020-06-21 02:05:20)
> Hi Stephen,
>
> First bad commit (maybe != root cause):
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 64677779e8962c20b580b471790fe42367750599
> commit: bbd7ffdbef6888459f301c5889f3b14ada38b913 clk: Allow the common clk framework to be selectable
> date: 7 weeks ago
> config: alpha-randconfig-s032-20200621 (attached as .config)
> compiler: alpha-linux-gcc (GCC) 9.3.0
> reproduce:
> # apt-get install sparse
> # sparse version: v0.6.2-rc2-13-gc59158c8-dirty
> git checkout bbd7ffdbef6888459f301c5889f3b14ada38b913
> # save the attached .config to linux build tree
> make W=1 C=1 ARCH=alpha CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
>
>
> sparse warnings: (new ones prefixed by >>)
>
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> drivers/clk/clk-divider.c:31:24: sparse: sparse: cast to restricted __be32
> >> drivers/clk/clk-divider.c:39:17: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] @@ got restricted __be32 [usertype] @@
> >> drivers/clk/clk-divider.c:39:17: sparse: expected unsigned int [usertype]
> drivers/clk/clk-divider.c:39:17: sparse: got restricted __be32 [usertype]
>
> vim +39 drivers/clk/clk-divider.c
>
> 9d9f78ed9af0e4 Mike Turquette 2012-03-15 17
> 9d9f78ed9af0e4 Mike Turquette 2012-03-15 18 /*
> 9d9f78ed9af0e4 Mike Turquette 2012-03-15 19 * DOC: basic adjustable divider clock that cannot gate
> 9d9f78ed9af0e4 Mike Turquette 2012-03-15 20 *
> 9d9f78ed9af0e4 Mike Turquette 2012-03-15 21 * Traits of this clock:
> 9d9f78ed9af0e4 Mike Turquette 2012-03-15 22 * prepare - clk_prepare only ensures that parents are prepared
> 9d9f78ed9af0e4 Mike Turquette 2012-03-15 23 * enable - clk_enable only ensures that parents are enabled
> 9556f9dad8f576 Brian Norris 2015-04-13 24 * rate - rate is adjustable. clk->rate = ceiling(parent->rate / divisor)
> 9d9f78ed9af0e4 Mike Turquette 2012-03-15 25 * parent - fixed parent. No clk_set_parent support
> 9d9f78ed9af0e4 Mike Turquette 2012-03-15 26 */
> 9d9f78ed9af0e4 Mike Turquette 2012-03-15 27
> 434d69fad63b44 Jonas Gorski 2019-04-18 28 static inline u32 clk_div_readl(struct clk_divider *divider)
> 434d69fad63b44 Jonas Gorski 2019-04-18 29 {
> 434d69fad63b44 Jonas Gorski 2019-04-18 30 if (divider->flags & CLK_DIVIDER_BIG_ENDIAN)
> 434d69fad63b44 Jonas Gorski 2019-04-18 @31 return ioread32be(divider->reg);
Ok. I guess we'll need to force cast the pointer to be __be32 in this
case. Before it wasn't in generic code so the architecture was masking
the issue.
Powered by blists - more mailing lists