From patchwork Wed Jan 6 08:36:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12001117 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3FDCC433E0 for ; Wed, 6 Jan 2021 08:37:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91D172310A for ; Wed, 6 Jan 2021 08:37:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726157AbhAFIhf (ORCPT ); Wed, 6 Jan 2021 03:37:35 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:53644 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbhAFIhe (ORCPT ); Wed, 6 Jan 2021 03:37:34 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1068VNI4052402; Wed, 6 Jan 2021 08:36:47 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-2020-01-29; bh=q+KJ8AfPkiSCHLPRdLSxb87gjhWi/QLcykmElkTz1T0=; b=yoTjTwaXig6Czqfr4rcKDk7U2dVFqJQKrVm4tXkcxaCkVSo9eFMr6B4hIz+0BpdZGaqF m3V0rg/djTklghEcNJwa4rOVgvLOwu4v/AhiJoo9GQTqMoRQ3vwb8Oe0AzpZ275kkLTN f4EL9CRw1PiFLu5DLQbrj+Qijv07LsBvesJT8im8LClS/NKKEVtVx8tddj05/79FGyIo OW7nUXLNDdYlaB2iYe4b0jJRKTmzPxxJMKejYJC1I0+GEiB+AZlCT91ekYxkeHKKjHYo LWdxkNGc/e8wKleqHKS1QYyJEPtSQ4LvlDMB4tAZQxZB+uDOe9FLbL1E3kqqy2B5zVtI 3g== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 35w53b0r1g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 06 Jan 2021 08:36:47 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1068XAha042304; Wed, 6 Jan 2021 08:36:47 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 35w3g0p66r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 Jan 2021 08:36:47 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 1068ajMG027546; Wed, 6 Jan 2021 08:36:45 GMT Received: from mwanda (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Jan 2021 08:36:44 +0000 Date: Wed, 6 Jan 2021 11:36:35 +0300 From: Dan Carpenter To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Lukasz Luba , linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/3] powercap/drivers/dtpm: Fix a double shift bug Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9855 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101060051 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9855 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 clxscore=1011 adultscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 impostorscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101060051 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The DTPM_POWER_LIMIT_FLAG is used for test_bit() etc which take a bit number so it should be bit 0. But currently it's set to BIT(0) then that is double shifted equivalent to BIT(BIT(0)). This doesn't cause a run time problem because it's done consistently. Fixes: a20d0ef97abf ("powercap/drivers/dtpm: Add API for dynamic thermal power management") Signed-off-by: Dan Carpenter Acked-by: Daniel Lezcano --- drivers/powercap/dtpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c index 0abcc439d728..d49df0569cd4 100644 --- a/drivers/powercap/dtpm.c +++ b/drivers/powercap/dtpm.c @@ -24,7 +24,7 @@ #include #include -#define DTPM_POWER_LIMIT_FLAG BIT(0) +#define DTPM_POWER_LIMIT_FLAG 0 static const char *constraint_name[] = { "Instantaneous",