From: Dan Carpenter <dan.carpenter@oracle.com>
To: Javier Martinez Canillas <javier@dowhile0.org>,
Ferruh Yigit <fery@cypress.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch 1/3] Input: cyttsp4 - silence shift wrap warning
Date: Wed, 3 Jul 2013 00:40:19 +0300 [thread overview]
Message-ID: <20130702214019.GA1598@elgon.mountain> (raw)
"*max" is a size_t (long) type but "1" is an int so static checkers
complain that the shift could wrap.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c
index 963da05..7aa4a34 100644
--- a/drivers/input/touchscreen/cyttsp4_core.c
+++ b/drivers/input/touchscreen/cyttsp4_core.c
@@ -153,7 +153,7 @@ static int cyttsp4_hw_reset(struct cyttsp4 *cd)
*/
static int cyttsp4_bits_2_bytes(unsigned int nbits, size_t *max)
{
- *max = 1 << nbits;
+ *max = 1UL << nbits;
return (nbits + 7) / 8;
}
next reply other threads:[~2013-07-02 21:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 21:40 Dan Carpenter [this message]
2013-07-03 3:37 ` [patch 1/3] Input: cyttsp4 - silence shift wrap warning Dmitry Torokhov
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=20130702214019.GA1598@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=dmitry.torokhov@gmail.com \
--cc=fery@cypress.com \
--cc=javier@dowhile0.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-input@vger.kernel.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