From patchwork Thu Nov 11 02:53:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zev Weiss X-Patchwork-Id: 12613973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9324C433FE for ; Thu, 11 Nov 2021 02:53:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA8246103C for ; Thu, 11 Nov 2021 02:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234599AbhKKC4j (ORCPT ); Wed, 10 Nov 2021 21:56:39 -0500 Received: from thorn.bewilderbeest.net ([71.19.156.171]:38099 "EHLO thorn.bewilderbeest.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234604AbhKKC4j (ORCPT ); Wed, 10 Nov 2021 21:56:39 -0500 Received: from hatter.bewilderbeest.net (97-113-240-219.tukw.qwest.net [97.113.240.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 76A00407; Wed, 10 Nov 2021 18:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1636599230; bh=UxlRwr40WBjszXqnUlD1ucaCTdcWrwtOkgrw3DJK1DA=; h=From:To:Cc:Subject:Date:From; b=iBDLSNOKN5rrtw+PCljwdjBmZ6hLpG+mIUtMjL4DDRQBM0YUSzOAwOuZ2pgk2E1bE dcdw4OPDTMDGiz7XGeiMNNOX9WE53tTY9jgj6/sLzSEyn+mmLWlp1+QIHnKi3YrK3c 1o9qC+OWdsOebJrrT0xZ/wjYw9KS0ntNFwMHj2qM= From: Zev Weiss To: linux-hwmon@vger.kernel.org Cc: Zev Weiss , Guenter Roeck , Jean Delvare , Denis Pauk , Bernhard Seibold , Andy Shevchenko , Oleksandr Natalenko , linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: (nct6775) mask out bank number in nct6775_wmi_read_value() Date: Wed, 10 Nov 2021 18:53:38 -0800 Message-Id: <20211111025339.27520-1-zev@bewilderbeest.net> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org The first call to nct6775_asuswmi_read() in nct6775_wmi_read_value() had been passing the full bank+register number instead of just the lower 8 bits. It didn't end up actually causing problems because the second argument of that function is a u8 anyway, but it seems preferable to be explicit about it at the call site (and consistent with the rest of the code). Signed-off-by: Zev Weiss Fixes: 3fbbfc27f955 ("hwmon: (nct6775) Support access via Asus WMI") Reviewed-by: Andy Shevchenko --- drivers/hwmon/nct6775.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index 93dca471972e..57ce8633a725 100644 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c @@ -1527,7 +1527,7 @@ static u16 nct6775_wmi_read_value(struct nct6775_data *data, u16 reg) nct6775_wmi_set_bank(data, reg); - err = nct6775_asuswmi_read(data->bank, reg, &tmp); + err = nct6775_asuswmi_read(data->bank, reg & 0xff, &tmp); if (err) return 0;