Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1239425lqt; Fri, 7 Jun 2024 11:58:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX3C2sAZdPeuyWF2K1m7tC7VwtwzO/WvFxzXLLlq55wZ0+TxT8Pn2a0uR5BT3fBrtN1gFY2rXFKNV5EVl6U8EcWnlcztGGy5+zJL2nY6w== X-Google-Smtp-Source: AGHT+IEn9DDNy1Z2L+5sSNQ9uGMXEzfETUBtg0uD2vdC/rjqtfmfbXGYKEif1oE2GYTQti2fZrKe X-Received: by 2002:aca:1b18:0:b0:3c9:6510:5908 with SMTP id 5614622812f47-3d210dbf3cdmr3200866b6e.28.1717786717636; Fri, 07 Jun 2024 11:58:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717786717; cv=pass; d=google.com; s=arc-20160816; b=hl6nbB0CWkyTWQJyvoyCaYKtzfQH8w1pNF90XDQcJPOB2esAvpRy+DoPYYbyEJKOki iO8qUAr/yMk+zVI7Y1UT2i8fGiRSupHznZclkfZcmHfgL1QIF3ieeMCejV/WXkovxm5A 7acPaYC5syYmGdCk/EaBpS2E5MeJhTrxtmRXcgoF/i4t6N5DRitpjjlfPrkYHidsGkIL Jzsoyze704vrjdp1AAgmjMEKmg+XVvHDyZbUjqTHw9tNuhQ/CcO0yXER2wkSyhwRsu4F WxvRilJcfHuJMDXUZWHt2if46OwLIzqLZwRtg1RipVQz+5QIfD3R5tnb3wIeFr9BgMB2 cwAA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=4jc147Qg5hoyTZheVMojqONKvE21oMEiq/6WbCIOI20=; fh=9iKjSNrlTWK80MeP7zdwJ/YtSgkv/K0fuGDkFlnKa0k=; b=j1PUyxwT3CdbJC20qevknmDSnD6D3zjK3UgOEXV8lsg4qijg48YbEsKMbIdrZ81pKm 7Bh7pMWlA5aF0nJgTIjONtf3O8VjOwAMeITFZ+Hz354zLOZmR9IF1sjggct6ZPnkr1zw gQbUwVMC87Z/1PkW1Jmz0XBjKv10taQ7WcbfBmeSyztKZ8Bho0vriY6ZCfyR4B/uSGK6 AK6IjML68YNfor5vOYddYkfJR4+f8lgITQI9MaHn+EvgUwr+wL4GHS0Y2YLeAL7zu4n6 FKMDEC84BJlMTikx6lGvdyF4rfCzQCpjEfitreg6/RlGaDnsuwrIZfitF/+uDhnW5959 W11g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YOXKifFL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206637-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206637-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04f6812ecsi46417526d6.151.2024.06.07.11.58.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 11:58:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206637-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YOXKifFL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-206637-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206637-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 51AD51C217A6 for ; Fri, 7 Jun 2024 18:58:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34DD81411E6; Fri, 7 Jun 2024 18:58:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YOXKifFL" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CBC54204F; Fri, 7 Jun 2024 18:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717786710; cv=none; b=XY4xjJvtDilAaDRlI6Bi6l5JcGKOFCZ3al0w9ZxKH4gtQDB0shFPuhsqc2ZbuR3wSbmA7zrIv4a/oL4SaRDL0Ucjzvjlps8Ht/BuPzmI8DGnyaaGfl/nln+2bi5+Zg3fneDC6yaPKKXJlJEFKARrrog3fdT5QdfK0/b0gJ/fKQc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717786710; c=relaxed/simple; bh=YVTm9rx3hAIDwiIpXyJ3t35LjCIU0Wrud/PJ+L0hRAM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=YbyAYhGYZNW90z5lJYNnvSq4iDI19wgUEittKupTktBgYv4z+f0EqdehQuqHUlMNfcc92TiOCVhJLrzhdw42APwRkiitO+mAnAOXMQsHfiPQFkgIubKtcu/o26pHq/6ZBe8VLTX0DRlxkNekuqlsJ8LdZikC8SC/n9zbOpPEgQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YOXKifFL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4830C2BBFC; Fri, 7 Jun 2024 18:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717786709; bh=YVTm9rx3hAIDwiIpXyJ3t35LjCIU0Wrud/PJ+L0hRAM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=YOXKifFLgh1ZwqWzgL1zO3O1tqr3aZniW/A8l/E5vc9ZlYhbhB2DrXCw1o+7TZYtF YHmdib2DG5g7XI5I55qAjKl2ft0FLnuxLzfcDy7pnd57tSC0ZtSBjBX6iEonQZc8jy ZZug2odzQSxDzrvJjyidTkV+TBoGj2jixdjwmnegYUCCr11h8amaTJ7KCybpFucGZV L7o/Zxo3N1kAwYHS1/72TIleKAWPFX/5BL83KfoRBoGb+7yM+PmoslBy+X8rdN5t95 KdGqLLLZ4JHRAKwfAV9F9OzVwr9cxk9RkgkK6ML7dZaCgtqXY5204pkD2yTu/w3Opv 0RPIjjWIt+Low== Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-3d21cb3833cso164b6e.2; Fri, 07 Jun 2024 11:58:29 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUXSmD4EfwccQ46kuD5vYSUcOpw9yqBioMfuuBplHQ9PErj89wDoARdYM02zLk1N2flQt+HEf0PvxlwEi2HDDWMXA6RqXj05lW146wXxyH5Pr2BWcA/OjmrSWIeqm8OkUwxWPZtR2k= X-Gm-Message-State: AOJu0YywVtN71rvu6GQMjKS6+4c+H8YImGIlgbFjBWPbvZrc2abGbFbG LgHuRLTt9Slumg5qNNrDwKrD73j6kwVV3QYeMTNlxg+QszlH4aTXy7bH1ZZ7yEv8VWMCpNpOb+J Q7AqlB/GyUN2VD1TIRhwjsVxKUeA= X-Received: by 2002:a4a:a788:0:b0:5ba:ca8a:6598 with SMTP id 006d021491bc7-5baca8a70b5mr1596823eaf.0.1717786709173; Fri, 07 Jun 2024 11:58:29 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240605135841.97446-1-thorsten.blum@toblux.com> In-Reply-To: <20240605135841.97446-1-thorsten.blum@toblux.com> From: "Rafael J. Wysocki" Date: Fri, 7 Jun 2024 20:58:18 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] powercap: idle_inject: Simplify if condition To: Thorsten Blum Cc: rafael@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 5, 2024 at 3:59=E2=80=AFPM Thorsten Blum wrote: > > The if condition !A || A && B can be simplified to !A || B. > > Fixes the following Coccinelle/coccicheck warning reported by > excluded_middle.cocci: > > WARNING !A || A && B is equivalent to !A || B > > Compile-tested only. > > Signed-off-by: Thorsten Blum > --- > drivers/powercap/idle_inject.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/powercap/idle_inject.c b/drivers/powercap/idle_injec= t.c > index e18a2cc4e46a..bafc59904ed3 100644 > --- a/drivers/powercap/idle_inject.c > +++ b/drivers/powercap/idle_inject.c > @@ -127,7 +127,7 @@ static enum hrtimer_restart idle_inject_timer_fn(stru= ct hrtimer *timer) > struct idle_inject_device *ii_dev =3D > container_of(timer, struct idle_inject_device, timer); > > - if (!ii_dev->update || (ii_dev->update && ii_dev->update())) > + if (!ii_dev->update || ii_dev->update()) > idle_inject_wakeup(ii_dev); > > duration_us =3D READ_ONCE(ii_dev->run_duration_us); > -- Applied as 6.11 material, thanks!