public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Patrice Chotard <patrice.chotard@st.com>,
	Peter Griffin <peter.griffin@linaro.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	linux-remoteproc@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [PATCH] remoteproc: fix a.vs ~ typo
Date: Tue, 18 Dec 2018 08:16:57 +0000	[thread overview]
Message-ID: <20181218081657.GA32567@kadam> (raw)

This is from static analysis and not from testing.  It doesn't really
make sense to talk about !BIT(0) so probably ~BIT(0) was intended.
I had to cast it from unsigned long to unsigned int to silence a GCC
warning.

Fixes: bb6869b21478 ("Peter Griffin <peter.griffin@linaro.org>")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---

Sorry for the crap commit message.  I'm pretty sure the static checker
warning is correct, but I don't know what the run time impact of this
bug would be.

 drivers/remoteproc/st_slim_rproc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/st_slim_rproc.c b/drivers/remoteproc/st_slim_rproc.c
index d711d9430a4f..a646dfb9d6cd 100644
--- a/drivers/remoteproc/st_slim_rproc.c
+++ b/drivers/remoteproc/st_slim_rproc.c
@@ -128,7 +128,7 @@ static int slim_rproc_start(struct rproc *rproc)
 	writel(SLIM_STBUS_SYNC_DIS, slim_rproc->peri + SLIM_STBUS_SYNC_OFST);
 
 	/* enable cpu pipeline clock */
-	writel(!SLIM_CLK_GATE_DIS,
+	writel((unsigned int)~SLIM_CLK_GATE_DIS,
 		slim_rproc->slimcore + SLIM_CLK_GATE_OFST);
 
 	/* clear int & cmd mailbox */
@@ -167,7 +167,7 @@ static int slim_rproc_stop(struct rproc *rproc)
 	/* disable cpu pipeline clock */
 	writel(SLIM_CLK_GATE_DIS, slim_rproc->slimcore + SLIM_CLK_GATE_OFST);
 
-	writel(!SLIM_EN_RUN, slim_rproc->slimcore + SLIM_EN_OFST);
+	writel((unsigned int)~SLIM_EN_RUN, slim_rproc->slimcore + SLIM_EN_OFST);
 
 	val = readl(slim_rproc->slimcore + SLIM_EN_OFST);
 	if (val & SLIM_EN_RUN)
-- 
2.17.1

             reply	other threads:[~2018-12-18  8:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18  8:16 Dan Carpenter [this message]
2018-12-20 10:05 ` [PATCH] remoteproc: fix a.vs ~ typo Patrice CHOTARD
2018-12-20 10:14   ` Dan Carpenter
2018-12-20 10:17   ` Dan Carpenter

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=20181218081657.GA32567@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=patrice.chotard@st.com \
    --cc=peter.griffin@linaro.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