lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 19 May 2022 19:49:22 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Colin Ian King <colin.i.king@...il.com>
Cc:     "Rafael J . Wysocki" <rafael@...nel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] powercap: intel_rapl: remove redundant store to value
 after multiply

On Wed, May 18, 2022 at 10:45 AM Colin Ian King <colin.i.king@...il.com> wrote:
>
> There is no need to store the result of the multiply back to variable value
> after the multiplication. The store is redundant, replace *= with just *.
>
> Cleans up clang scan build warning:
> warning: Although the value stored to 'value' is used in the enclosing
> expression, the value is never actually read from 'value'
> [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
>  drivers/powercap/intel_rapl_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/powercap/intel_rapl_common.c b/drivers/powercap/intel_rapl_common.c
> index 83da499dd6ec..70e38278986d 100644
> --- a/drivers/powercap/intel_rapl_common.c
> +++ b/drivers/powercap/intel_rapl_common.c
> @@ -1010,7 +1010,7 @@ static u64 rapl_compute_time_window_atom(struct rapl_package *rp, u64 value,
>          * where time_unit is default to 1 sec. Never 0.
>          */
>         if (!to_raw)
> -               return (value) ? value *= rp->time_unit : rp->time_unit;
> +               return (value) ? value * rp->time_unit : rp->time_unit;
>
>         value = div64_u64(value, rp->time_unit);
>
> --

Applied as 5.19 material, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ