From patchwork Tue Apr 30 19:35:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13649923 Received: from smtp.smtpout.orange.fr (smtp-27.smtpout.orange.fr [80.12.242.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B20F2194C9D; Tue, 30 Apr 2024 19:44:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.27 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714506289; cv=none; b=uGqetebOp5hhi3gn8zC0+iWB5TO+7ZUj5zbd/68TBOMMYwYQGDROwcY0gKwfmjOBtN7e3licKXKx/VxjJax17CLgPEr6QRTVeUwIGE7r+C45mHB+/neb3VYAjqHIIEUhmJ0CsTlQMQJPrhyOENud/tLlNCs2Gcm1npzMpgC5bZY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714506289; c=relaxed/simple; bh=Yh/0kVomvA82YnCAEzDosws8iXCLFew+YFzQx0chFOY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HFFWHWAFDhUePmCUObxjVzJm5Gfdjq+PNgl2NNFjqR+rJtSdLwsc6NPU71zGw+z62tZOU/DqqqXeA9zPhkE1e9fituLAH6d+M1bFBS0fvoLukqM1rDHiPyC/7fXhRfdOX6k1TUcPXz5jyMW7ZnOXdwudzaMmS+65/nWDK8i5R1w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=Y6qkihPR; arc=none smtp.client-ip=80.12.242.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="Y6qkihPR" Received: from localhost.localdomain ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 1tGXsqFYLGyax1tGXss3dW; Tue, 30 Apr 2024 21:35:51 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1714505751; bh=skKo5kEoG79r6I+m+tXF3MUHJgIN3Agmwa3aOsSEA5o=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Y6qkihPRSdTI4mGkFmI3rkql6GZAFYWajX5CbOBz7NPrpMB0fZaaMx1OU0j4milP/ nBPv4d1a3bzLe6GaH6/mVP6jypYcEFUD9oI9eQVNlwEoSzipjv6GzGh2ZxUZ0HdL+b soQNlzkUmREM+hqL4f8iYZjoEkOUDVKz+3FEhTyDaVCJn2hrtCH5lV/+yz1SiYf6PO wcilfOX7XPFSrqVWGPPUb5ilCM6jtGv6DV+b7QHBrB4DAmK871udognHxQV57EZXxS We9vC8Pzli4CGyFrum4lO/Lyo4Zn2qE7KT3mPfVSyM9dTRVyVJd4b96TJy9Knh/eX6 DXiY6czAp7JQw== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 30 Apr 2024 21:35:51 +0200 X-ME-IP: 86.243.17.157 From: Christophe JAILLET To: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Jean Delvare , Guenter Roeck Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , openbmc@lists.ozlabs.org, linux-hwmon@vger.kernel.org Subject: [PATCH 1/2] hwmon: (npcm750-pwm-fan) Remove an unused field in struct npcm7xx_cooling_device Date: Tue, 30 Apr 2024 21:35:37 +0200 Message-ID: <74eee8aa739f94b8c6425ce3e37a427ca92243ea.1714505655.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In "struct npcm7xx_cooling_device", the 'fan_clk_freq' field is unused. Remove it. Found with cppcheck, unusedStructMember. Signed-off-by: Christophe JAILLET --- Compile tested only. This field was added in the initial commit f1fd4a4db777 ("hwmon: Add NPCM7xx PWM and Fan driver") but was never used. --- drivers/hwmon/npcm750-pwm-fan.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c index 904816abb7c4..6d92a3b89198 100644 --- a/drivers/hwmon/npcm750-pwm-fan.c +++ b/drivers/hwmon/npcm750-pwm-fan.c @@ -197,7 +197,6 @@ struct npcm7xx_pwm_fan_data { void __iomem *fan_base; int pwm_modules; unsigned long pwm_clk_freq; - unsigned long fan_clk_freq; struct clk *pwm_clk; struct clk *fan_clk; struct mutex pwm_lock[NPCM7XX_PWM_MAX_MODULES]; From patchwork Tue Apr 30 19:35:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13649911 Received: from msa.smtpout.orange.fr (msa-217.smtpout.orange.fr [193.252.23.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2524612B73; Tue, 30 Apr 2024 19:37:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.252.23.217 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714505839; cv=none; b=gzARsr8ehsalsgOo33vcrO9OWdPEpjqMhYi867NcIc3z+/69BJLwI5eurVdpqCxVqNNmJVTFSmBUxBE1kZDPjbbZwhsL6qOqkcGop6uNworHg+pyCser3RYluMZ1XSEoRTkqmVG9bLUFQsb/NkHDbNg7R2a58HXYg+3NhOLWHYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714505839; c=relaxed/simple; bh=u6JMWq3KGYar+o2HDcMvI/GFxB4sUHEoyhTzUKj4zXk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WkhklNYEbq8i92GRKMXL41BcihBiwig3Mr6fM09Yxa6/NdgVK3ZvN50BL8Wtxs89Fevze2P19dSOlXPs/Ds6eBG6jrmwR8NYKwvtX8SQfhAyszxmESqJB3B/ztS0V6+BSVSdTYJas95eDz+7/K9urGkX5rlJsZ5/mcwdnUzyV00= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=e9vL+6Zr; arc=none smtp.client-ip=193.252.23.217 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="e9vL+6Zr" Received: from localhost.localdomain ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 1tGXsqFYLGyax1tGfss3e5; Tue, 30 Apr 2024 21:35:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1714505758; bh=KS+TeFbjBWX9rgIDk409K2MoYqtyjLkv3GQe1jxfQhU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=e9vL+6ZrgjJ68/ouUB/vmJWJpMlplejctB6eF/dWgiHgPT4QjCTGD5HI4dMFlX7qf bea9axvhuGIBqjh92H+7+85/GE/lg+dGQrLXFRQsfrYhtnn0vod6lhglae4o+Phnml /DUG0aTQvR2K+X4R6KSOONbyAR4j+L9dlTOFmFczhtO8ruaO9HuYHUOHvD52n07Fkd dQ41jZV1e6kTI0OFmn54cQcKZc6LyR5GUA+7sfXNpo7W0Ye5BH1I4ohtPxsUgdX6wr rzuDyr3xW8R8T6YE/NHSpHdgUsUQe9MziyZiJ3Ha4OpSEXS5bsru9oDj5pOCei5OdM vsV9NjI9XVLmw== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 30 Apr 2024 21:35:58 +0200 X-ME-IP: 86.243.17.157 From: Christophe JAILLET To: Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Jean Delvare , Guenter Roeck Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , openbmc@lists.ozlabs.org, linux-hwmon@vger.kernel.org Subject: [PATCH 2/2] hwmon: (npcm750-pwm-fan) Remove another unused field in struct npcm7xx_cooling_device Date: Tue, 30 Apr 2024 21:35:38 +0200 Message-ID: <2ff738663d40ac5ae3d0b4d2e688ff7e36032be8.1714505655.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.44.0 In-Reply-To: <74eee8aa739f94b8c6425ce3e37a427ca92243ea.1714505655.git.christophe.jaillet@wanadoo.fr> References: <74eee8aa739f94b8c6425ce3e37a427ca92243ea.1714505655.git.christophe.jaillet@wanadoo.fr> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In "struct npcm7xx_cooling_device", the 'pwm_clk_freq' field is only written and never used. Remove it and update npcm7xx_pwm_init() accordingly. Signed-off-by: Christophe JAILLET --- Compile tested only. --- drivers/hwmon/npcm750-pwm-fan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fan.c index 6d92a3b89198..bc8db1dc595d 100644 --- a/drivers/hwmon/npcm750-pwm-fan.c +++ b/drivers/hwmon/npcm750-pwm-fan.c @@ -196,7 +196,6 @@ struct npcm7xx_pwm_fan_data { void __iomem *pwm_base; void __iomem *fan_base; int pwm_modules; - unsigned long pwm_clk_freq; struct clk *pwm_clk; struct clk *fan_clk; struct mutex pwm_lock[NPCM7XX_PWM_MAX_MODULES]; @@ -691,11 +690,12 @@ static u32 npcm7xx_pwm_init(struct npcm7xx_pwm_fan_data *data) { int m, ch; u32 prescale_val, output_freq; + unsigned long pwm_clk_freq; - data->pwm_clk_freq = clk_get_rate(data->pwm_clk); + pwm_clk_freq = clk_get_rate(data->pwm_clk); /* Adjust NPCM7xx PWMs output frequency to ~25Khz */ - output_freq = data->pwm_clk_freq / PWN_CNT_DEFAULT; + output_freq = pwm_clk_freq / PWN_CNT_DEFAULT; prescale_val = DIV_ROUND_CLOSEST(output_freq, PWM_OUTPUT_FREQ_25KHZ); /* If prescale_val = 0, then the prescale output clock is stopped */