From: Pandy Gao <pandy.gao-3arQi8VN3Tc@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: "linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: RE: [bug report] spi: imx: add lpspi bus driver
Date: Thu, 24 Nov 2016 01:36:36 +0000 [thread overview]
Message-ID: <AM4PR0401MB1780CF80424B9054E7708C7EF6B60@AM4PR0401MB1780.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20161123225719.GA16302@mwanda>
From: Dan Carpenter <mailto:dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> Sent: Thursday, November 24, 2016 6:57 AM
> To: Pandy Gao <pandy.gao-3arQi8VN3Tc@public.gmane.org>
> Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> 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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2016-11-24 1:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 22:57 [bug report] spi: imx: add lpspi bus driver Dan Carpenter
2016-11-24 1:36 ` Pandy Gao [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=AM4PR0401MB1780CF80424B9054E7708C7EF6B60@AM4PR0401MB1780.eurprd04.prod.outlook.com \
--to=pandy.gao-3arqi8vn3tc@public.gmane.org \
--cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).