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: 158350 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1191659jaa; Thu, 14 Feb 2019 02:46:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IZGHWoXachu3fTFSc5d74vIzoGF6Uy9qnqMtb+xocbPYV7MDLfJCL0r7W8fn+s4rRbXVZoK X-Received: by 2002:a63:fa58:: with SMTP id g24mr3089248pgk.390.1550141188552; Thu, 14 Feb 2019 02:46:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550141188; cv=none; d=google.com; s=arc-20160816; b=0bVJEpAIGJcsTOg5AFpbuMp9kLT5R7CtnPfjxIVSxSTWGKvI6579fdOa1EVx7HdZY1 c8LdSJBGUhJf5KLTtds6tYWoHiKm3sWUvNcWcmznqJ5RsxXWDQ4geRs94us23RaHggAJ MMG5xFMCS3Tlyzt8EmDRLO52WScmr4l+XFSGgJ0fYw2doFAybNTHAvl6ecESI4HWoxz4 T3wsxq+C1++rJNAzWaoxYrWySMZWIeiU5EcunntzTFiTc8qYGO24SNZ2UTpRSAMyqh0d ym7jndmOJKpqDcRB0qdg2a5LR6CmGA4bfBiQ+C6mzhrl+lP94/DlsII8L0xyviglLl0K FFpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aaYeH8nV1OLgBDYYMNbC3cE4BCJm7aABuoHzkKFCk5g=; b=zauuWjVP1q2C5gis24chIs6spisx2y11lzzsB3G1vLAdP8wBwd+cfpFUZuuc2fYbHT qmLrdLGJmxi7vHW5/F5r1Hdd1uGJJdvatcCCxyIgKmRjdgNiddPk8JNMpC7HjqbRDqsc 9Q6d/dR+EZeVRCDBgCYddlLDaWmNcPc/VEq4aB2s+WXcOSy0NHPkoVQLCP4aVTbOAtA+ /BOQVUV13tImfYpVAzqE91WxfKVncWp19262xn8vqMInmZ/Xh+O7GRHoCO2PCqeZgkjW YSLDHpv4Dgn1kew6/IdlaDVoqjWKFbmbSbhcCqGVaG3vwGt7PHuUZypwnUwWeR060spq cT+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iMtbLXiX; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23si1999284pgu.151.2019.02.14.02.46.28; Thu, 14 Feb 2019 02:46:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iMtbLXiX; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393734AbfBNKq1 (ORCPT + 11 others); 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-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 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(-) -- 2.21.0.rc0.269.g1a574e7a288b 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;