From patchwork Thu Feb 14 10:46:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10812407 X-Patchwork-Delegate: rjw@sisk.pl 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 03AF713A4 for ; Thu, 14 Feb 2019 10:46:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E63AA2D6AD for ; Thu, 14 Feb 2019 10:46:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAA332D6B0; Thu, 14 Feb 2019 10:46:28 +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 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 8BCD02D6AF for ; Thu, 14 Feb 2019 10:46:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393734AbfBNKq1 (ORCPT ); Thu, 14 Feb 2019 05:46:27 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:38028 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393731AbfBNKq1 (ORCPT ); Thu, 14 Feb 2019 05:46:27 -0500 Received: by mail-pf1-f195.google.com with SMTP id q1so2910851pfi.5 for ; Thu, 14 Feb 2019 02:46:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aaYeH8nV1OLgBDYYMNbC3cE4BCJm7aABuoHzkKFCk5g=; b=iMtbLXiXXoBPvri2HV3z8WJqExe3XZs9kjSQYKNHDIIgguaJu+M2XSiN2ptuwOg1zk /c9SvT+1wp2Xri2zHmr6pIIHelbCMQnoH06DAObNOUD0gcm/hPzOoHqKMmt6TT18OVyo hCmFX3sytDE81mqgg9iVz1SeVvdlr7izfpEE8mQ6h/NMhni8f7RNkonpnkC3opwl6zUZ 6GD6Bp2iAzNNjr/peV3ky6yFRyrdHlxRRYybGjZMZWl/SCHQxFukn01N9Wr/8Tr43UUU 6WpeNcCdIw8UkIoA18+leJkNHSlfxsxDHQ4nY0yErla3xZAvOeNPPKUrppFTrD48qoto 5ChQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aaYeH8nV1OLgBDYYMNbC3cE4BCJm7aABuoHzkKFCk5g=; b=k80Iw0T91EsV4Lr2/XdA0YtNnqhhMV/IECZ7PktFpCXoENHrE0rD6SsdU2bhU1hn5E Bcic4BMhrj4TdHWGqqYj/EM9V0HTKXqfzb/VQ8Zl9INkAZaiDw+3QVXbqejfkeV8hs/F tfkTlEAOLPvCfR8nZtjvyJDTdTbtFORJY0tDq5aY4gsqyNYoMCbK5e+gifT8n7Yz1zmc jLPXcJL69A/Mi4hTZquXf7roKVWN5wW+H68jzYl1m5Q8i6ifrBd9wgOeInZXMEziZera YkNamy3LAUwi7fyYX1ggMrGZrX4nIOXQPL6mdDOhdm2mi0voA1cpJoCk9PL0ig8gVsKy p4Rw== X-Gm-Message-State: AHQUAuZZ4tQUfPmXraZbqSTWBqO8TCy0QGpTDDssN+BqFifbTJQu1SYX xU/2BZWymGaBZ8zQ6u53KiDvrA== X-Google-Smtp-Source: AHgI3IY4/1ZkelKSvbp8jSbbwio93IKO5dCJA+9THbE5EzQDK/lGDqELUOrJT62cq4Vyz17xKFKp3g== X-Received: by 2002:a63:e10:: with SMTP id d16mr3158981pgl.148.1550141186964; Thu, 14 Feb 2019 02:46:26 -0800 (PST) Received: from localhost ([122.172.102.63]) by smtp.gmail.com with ESMTPSA id z186sm2902120pfz.119.2019.02.14.02.46.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 02:46:25 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: Replace double NOT (!!) with single NOT (!) Date: Thu, 14 Feb 2019 16:16:21 +0530 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Double NOT (!!) operation is normally done to convert a non-zero value to 1 and keep zero as is, but that isn't the requirement in this case. All we wanted was to make sure that only one of the two routines isn't set, i.e. either both function pointers are set or both are unset. This can be done with a single NOT (!) operation as well. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 55e9795801a4..ad4e9991c3cc 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2505,7 +2505,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) driver_data->target) || (driver_data->setpolicy && (driver_data->target_index || driver_data->target)) || - (!!driver_data->get_intermediate != !!driver_data->target_intermediate) || + (!driver_data->get_intermediate != !driver_data->target_intermediate) || (!driver_data->online != !driver_data->offline)) return -EINVAL;