From patchwork Tue Jul 14 14:50:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11663057 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46F49722 for ; Tue, 14 Jul 2020 14:54:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F17B222C8 for ; Tue, 14 Jul 2020 14:54:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3PQDtO/Y"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="MHULfHb/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F17B222C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8UPKh99E7X3XH6i9Ty/DZP1FeLQ2XgIgn+JXa1+46ZQ=; b=3PQDtO/YfsoGD4bWDQNJd7vs6 1fxGjZMwtZvoc3l7vUae3DGvJA/HjkJDBEkkskMGtaen0UEt0sSTLv3fQNrLO734HH1c/SgGZvQ9d 2TEP3oTcE97nOdqrOamu+8o0gENtxMbjYS41rgpiMODiW+n9G1G5Tj81LFfUqCtlwDL239iB0HtAe PAKidHGy1carnTlU+Peitb/YPqZyAcxE305DjKYA0iKQs5NNA8BfMvAUhPmabW5pmQjdHubyNpu31 6C2AfB2zXQtR+4GLCqCT9rBVaCMrIv7Kc2Jw/lOYEpd4ijuLO43NIgmanYQKHmTBy8a6b3m0YaHU8 H10+PY+7w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvMHx-0004tR-1f; Tue, 14 Jul 2020 14:52:09 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvMGu-0004UK-If for linux-arm-kernel@lists.infradead.org; Tue, 14 Jul 2020 14:51:06 +0000 Received: by mail-wr1-x444.google.com with SMTP id z13so22179399wrw.5 for ; Tue, 14 Jul 2020 07:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xAmlwZf9FF5B+fNw3FLwoudWl6EScDCCxEL7TtadPBI=; b=MHULfHb/qq2DdPxVtZdND+73JTuMCaIpc5HvzUeGk6dbIqMsJzHFttAq159KGZhl+E uc32b1iIIALtw+ydZp8fFCVf22oX/ZdWCauKax3caYhdVkySmLHWnfqsCdIC72Zkwchc 0HSG5fFKVugqRl0OpEK9Pw86gfD9D3MreYxK7XhNMk+0Inko/tj6sj1308edItjH6uo6 E5+EcxAVfNcEsuIU/t2HPJ2VjGAKGSOfJyddVycUripolPiZXCNSEbtHOJSdnPoQdyBC z5kKNMEq5B9YxP3pmvcBN6urA6s4KBar6ixz9U4qx3EMF/Ca6qnZHRoNaYFvLzVkUo89 chLQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xAmlwZf9FF5B+fNw3FLwoudWl6EScDCCxEL7TtadPBI=; b=fAcKr9U/WrDVHmspgaEhcVv4f3n9bwDRREpL+R0mZMwj04ppNsP6doGYQCoYeZc7gx bEGgcJHpPlLq54XeefpQyLw81C7sCb+/znud2QkMmZWaNEj3sXeX9OshSrISJWmrP9BC s4r11X4mF6XC1YV6dKJi8+m8W1U/FMjWcR86wcE69RnplovdZt8PYLww4Vk5N9x01Bhj zuIDPUad6YRNKU0wHxdRs4TDiYCw+n8BVWLL+5bsoKLCUahjIBaKhpGXFIHAp0LWHLYC OUBIpfgRwoXhpDEomb/wd4aW5ZXhYRp6MO0msJJvpmNo6vTdsLodnH7ER8mmplavq2eL pPKg== X-Gm-Message-State: AOAM532X+0//9BrmSXprwEuYmzMYu37Ld6+JldBdfsq62n8U79qhxF6A GBFGsJxJ3ZHGUuhnRNguET95RA== X-Google-Smtp-Source: ABdhPJyoziaq49v5CTUiEUg6/TO+E0QrGY8bGLFPGBYZLqb4ZcvlqiI8gGMCMznhtGm8VhY3kHmpDA== X-Received: by 2002:adf:82f5:: with SMTP id 108mr6085256wrc.218.1594738263620; Tue, 14 Jul 2020 07:51:03 -0700 (PDT) Received: from localhost.localdomain ([2.31.163.61]) by smtp.gmail.com with ESMTPSA id a84sm4653305wmh.47.2020.07.14.07.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 07:51:03 -0700 (PDT) From: Lee Jones To: rjw@rjwysocki.net, viresh.kumar@linaro.org Subject: [PATCH 10/13] cpufreq: powernow-k8: Make use of known set but not used variables Date: Tue, 14 Jul 2020 15:50:46 +0100 Message-Id: <20200714145049.2496163-11-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200714145049.2496163-1-lee.jones@linaro.org> References: <20200714145049.2496163-1-lee.jones@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200714_105105_070239_9D2EFC19 X-CRM114-Status: GOOD ( 13.17 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pm@vger.kernel.org, Paul Devriendt , Andreas Herrmann , linux-kernel@vger.kernel.org, Mark Langsdorf , Pavel Machek , Lee Jones , linux-arm-kernel@lists.infradead.org, Dominik Brodowski Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org If we fail to use a variable, even a 'dummy' one, then the compiler complains that it is set but not used. We know this is fine, so we set it to its own value here. Fixes the following W=1 kernel build warning(s): drivers/cpufreq/powernow-k8.c: In function ‘pending_bit_stuck’: drivers/cpufreq/powernow-k8.c:89:10: warning: variable ‘hi’ set but not used [-Wunused-but-set-variable] 89 | u32 lo, hi; | ^~ drivers/cpufreq/powernow-k8.c: In function ‘core_voltage_pre_transition’: drivers/cpufreq/powernow-k8.c:285:14: warning: variable ‘lo’ set but not used [-Wunused-but-set-variable] 285 | u32 maxvid, lo, rvomult = 1; | ^~ Cc: Andreas Herrmann Cc: Dominik Brodowski Cc: Pavel Machek Cc: Paul Devriendt Cc: Mark Langsdorf Signed-off-by: Lee Jones --- drivers/cpufreq/powernow-k8.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index 3984959eed1d5..b76df81044c4f 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -89,6 +89,7 @@ static int pending_bit_stuck(void) u32 lo, hi; rdmsr(MSR_FIDVID_STATUS, lo, hi); + hi &= hi; /* Silence set but not used warning */ return lo & MSR_S_LO_CHANGE_PENDING ? 1 : 0; } @@ -292,6 +293,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data, rvomult = 2; rvosteps *= rvomult; rdmsr(MSR_FIDVID_STATUS, lo, maxvid); + lo &= lo; /* Silence set but not used warning */ maxvid = 0x1f & (maxvid >> 16); pr_debug("ph1 maxvid=0x%x\n", maxvid); if (reqvid < maxvid) /* lower numbers are higher voltages */