Re: [bug report] spi: Add ADI driver for Spreadtrum platform

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

On 25 October 2017 at 16:57, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> Hello Baolin Wang,
>
> The patch 7e2903cb91df: "spi: Add ADI driver for Spreadtrum platform"
> from Sep 15, 2017, leads to the following static checker warning:
>
>         drivers/spi/spi-sprd-adi.c:312 sprd_adi_hw_init()
>         warn: 'chn_id - 32' is negative one
>
> drivers/spi/spi-sprd-adi.c
>    293          chn_cnt = size / 8;
>    294          for (i = 0; i < chn_cnt; i++) {
>    295                  u32 value;
>    296                  u32 chn_id = be32_to_cpu(*list++);
>                             ^^^^^^
> Let's imagine chn_id == 31.
>
>
>    297                  u32 chn_config = be32_to_cpu(*list++);
>    298
>    299                  /* Channel 0 and 1 are software channels */
>    300                  if (chn_id < 2)
>    301                          continue;
>    302
>    303                  writel_relaxed(chn_config, sadi->base +
>    304                                 REG_ADI_CHN_ADDR(chn_id));
>    305
>    306                  if (chn_id < 31) {
>                             ^^^^^^^^^^^
> This is false.

Ah, you are correct. Sorry for my mistake, here the check should be
chn_id <= 31. I will send one patch to fix this issue. Thanks.

-- 
Baolin.wang
Best Regards
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux