From patchwork Tue Dec 18 08:16:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10735077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 873E01399 for ; Tue, 18 Dec 2018 08:17:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7267429607 for ; Tue, 18 Dec 2018 08:17:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62A4B29DF9; Tue, 18 Dec 2018 08:17:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0734529607 for ; Tue, 18 Dec 2018 08:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726394AbeLRIRD (ORCPT ); Tue, 18 Dec 2018 03:17:03 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:41852 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbeLRIRD (ORCPT ); Tue, 18 Dec 2018 03:17:03 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBI8ETwJ089710; Tue, 18 Dec 2018 08:16:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=DWr95XW8JjaZs6x+Zw4Xuo0WM9jlfrS8C5Tvp7b05as=; b=3pj8AP7ZE3Dv119kTcq9X4/5h+TS0s/DTLZ3EDZwWGtKolxxBwPCAhCQS4P9p68mo4Mm oMBhQaz8657pTPdEyvlOime0vgX/2XZx7g5T9IG544KPxNUpZg99xe+W0IjetEWtq2Ui lRzP0SCMf9gkm4ZZwcPMc6Q70qa5TuFwlnK02hORxj2VRt9gmRxn5LiqSrH9coOg4UQy kb7NI1gFesm1f6wST2c84/xFDIaF90IfUgejd0sTdLI2LLqkUB4OY02IyFbG7FDSsPCo oaCc3qymbTFWGI0gUC9jeKoPWQ5tx9Xo8/ltQFZDVPIbRiOVs/Qgp4Vd9exT6ph67Q9H rg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2pcs1thpn7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Dec 2018 08:16:58 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wBI8GvUL009176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Dec 2018 08:16:57 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBI8GuU7032439; Tue, 18 Dec 2018 08:16:57 GMT Received: from kadam (/197.157.0.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Dec 2018 00:16:56 -0800 Date: Tue, 18 Dec 2018 11:16:57 +0300 From: Dan Carpenter To: Patrice Chotard , Peter Griffin Cc: Ohad Ben-Cohen , Bjorn Andersson , linux-remoteproc@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] remoteproc: fix a ! vs ~ typo Message-ID: <20181218081657.GA32567@kadam> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9110 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812180074 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 ") Signed-off-by: Dan Carpenter --- 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)