From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Lezcano Date: Thu, 07 Jan 2021 16:59:37 +0000 Subject: Re: [PATCH 1/3] powercap/drivers/dtpm: Fix a double shift bug Message-Id: <3723a63e-5c3f-9c15-2e2c-788e7e6ec0bf@linaro.org> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: Dan Carpenter , "Rafael J. Wysocki" Cc: Lukasz Luba , linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org On 06/01/2021 09:36, Dan Carpenter wrote: > 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. >=20 > 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(-) >=20 > 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 > =20 > -#define DTPM_POWER_LIMIT_FLAG BIT(0) > +#define DTPM_POWER_LIMIT_FLAG 0 > =20 > static const char *constraint_name[] =3D { > "Instantaneous", >=20 --=20 Linaro.org =E2=94=82 Open source software for ARM = SoCs Follow Linaro: Facebook | Twitter | Blog From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 41D2EC433E9 for ; Thu, 7 Jan 2021 17:00:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0509E233FC for ; Thu, 7 Jan 2021 17:00:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728158AbhAGRAV (ORCPT ); Thu, 7 Jan 2021 12:00:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbhAGRAV (ORCPT ); Thu, 7 Jan 2021 12:00:21 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9794EC0612F4 for ; Thu, 7 Jan 2021 08:59:40 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id v14so5772404wml.1 for ; Thu, 07 Jan 2021 08:59:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=mmzskSdQrTev/cCFm1H+i5iNhgQlXZbBR6M55+jIUbg=; b=p0FZbIHjagfRb2V9idGaKfOd3zkdv/4eXS3DJ41meEK8jk6I8AOTSYS1MsFFraN3di ux8SL6ohkQ4AIRrf7bzHsvHmarTw1r9rIQvGk3kql5bAIfqjUNH374oLhmueD91N+YvA iKutl8gulJLC/9H87XLTMdh7P6JpXc+0TnW0LMU471FUkhA7Se7gto7hmfUB+RzoMKt4 v87iGORighicC5EJo7iqmDhzxPQTO6E9MY+YHDE6HhyiVZ+YQ7UN2Wctpz1+c8Nnjnm2 ys2kqaWo76215ah0PEX34FZ5xAx7Ds3O1geNmeByFAXvAyREn0T+Ea0H4rNVa0pgxuwb K5Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=mmzskSdQrTev/cCFm1H+i5iNhgQlXZbBR6M55+jIUbg=; b=lYVKg0eY060Dn7eIEaoeNsGPMDSOLUHKLoo2TmDG3XMaFQG+W3E8xs4wVwUAZW06fk R/Zqf+XDyZvNOU7ARom+COu/jWDTQMztkKxIsIq6oZtSUSjNbK+62sp7i08IZVbcGXAh 7HOhEoQjruEYe3MBZyFinpz1Cp64/18q+PjUwvXR0ReQNDE/uTTBqgfvFPVzd0Gx0HsE IPrPFS9VARcM0PU9rXpttORrB+vDrir1GqJ9KKAlPaeNsgS/jeKFrXS6Q7IepqMY7KZK Gms2/6WI6Bsgl7GsesrjnDMauCZko3xfuDENp0vxV+SelMo8/6h3GOIC+FFPiFbQZHR3 yifQ== X-Gm-Message-State: AOAM531Jy5EVcsVpU34kFOGTdpVBmc6YbivX1zCLQAHoQqAq7ltZhv1N xSYwYdikp8NAVsNjKAqAX/7yYQ== X-Google-Smtp-Source: ABdhPJyOSGSpxEaUNicgKfPZbyMLJiHppv8e9n4occqn8Gv5bbSauWDqngbimbkh3mvgSdL8MjuQww== X-Received: by 2002:a7b:c35a:: with SMTP id l26mr8537212wmj.182.1610038779235; Thu, 07 Jan 2021 08:59:39 -0800 (PST) Received: from [192.168.0.41] (lns-bzn-59-82-252-152-224.adsl.proxad.net. [82.252.152.224]) by smtp.googlemail.com with ESMTPSA id g5sm9205632wro.60.2021.01.07.08.59.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 08:59:38 -0800 (PST) Subject: Re: [PATCH 1/3] powercap/drivers/dtpm: Fix a double shift bug To: Dan Carpenter , "Rafael J. Wysocki" Cc: Lukasz Luba , linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org References: From: Daniel Lezcano Message-ID: <3723a63e-5c3f-9c15-2e2c-788e7e6ec0bf@linaro.org> Date: Thu, 7 Jan 2021 17:59:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On 06/01/2021 09:36, Dan Carpenter wrote: > 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", > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog