RE: [bug report] spi: imx: add lpspi bus driver

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

 



From: Dan Carpenter <mailto:dan.carpenter@xxxxxxxxxx>  Sent: Thursday, November 24, 2016 6:57 AM
> To: Pandy Gao <pandy.gao@xxxxxxx>
> Cc: linux-spi@xxxxxxxxxxxxxxx
> Subject: [bug report] spi: imx: add lpspi bus driver
> 
> Hello Gao Pan,
> 
> The patch 5314987de5e5: "spi: imx: add lpspi bus driver" from Nov 22,
> 2016, leads to the following static checker warning:
> 
> 	drivers/spi/spi-fsl-lpspi.c:220 fsl_lpspi_set_cmd()
> 	warn: potential shift truncation.  '0x11 << 30'
> 
> drivers/spi/spi-fsl-lpspi.c
>    213  static void fsl_lpspi_set_cmd(struct fsl_lpspi_data *fsl_lpspi,
>    214                                bool is_first_xfer)
>    215  {
>    216          u32 temp = 0;
>    217
>    218          temp |= fsl_lpspi->config.bpw - 1;
>    219          temp |= fsl_lpspi->config.prescale << 27;
>    220          temp |= (fsl_lpspi->config.mode & 0x11) << 30;
> 
> Are you sure you didn't intend to write:
> 
> 		temp |= (fsl_lpspi->config.mode & 0x3) << 30;
> 
> The current code doesn't make sense at any rate.

Yes, you are right. Will submit a patch to fix this bug. Thanks!

Best  Regards
Gao Pan

--
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