All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] leds: lp50xx: Remove an unused field in struct lp50xx_led
@ 2024-04-28 17:15 Christophe JAILLET
  2024-04-28 17:15 ` [PATCH 2/2] leds: lp50xx: Remove an unused field in struct lp50xx Christophe JAILLET
  2024-05-02 17:11 ` [PATCH 1/2] leds: lp50xx: Remove an unused field in struct lp50xx_led Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2024-04-28 17:15 UTC (permalink / raw)
  To: Pavel Machek, Lee Jones
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-leds

In "struct lp50xx_led", the 'bank_modules' field is unused.
Remove it.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only.

It was added added in the initial commit 242b81170fb8 ("leds: lp50xx: Add
the LP50XX family of the RGB LED driver") but was never used.
---
 drivers/leds/leds-lp50xx.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
index 68c4d9967d68..407eddcf17c0 100644
--- a/drivers/leds/leds-lp50xx.c
+++ b/drivers/leds/leds-lp50xx.c
@@ -265,7 +265,6 @@ static const struct lp50xx_chip_info lp50xx_chip_info_tbl[] = {
 struct lp50xx_led {
 	struct led_classdev_mc mc_cdev;
 	struct lp50xx *priv;
-	unsigned long bank_modules;
 	u8 ctrl_bank_enabled;
 	int led_number;
 };
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] leds: lp50xx: Remove an unused field in struct lp50xx
  2024-04-28 17:15 [PATCH 1/2] leds: lp50xx: Remove an unused field in struct lp50xx_led Christophe JAILLET
@ 2024-04-28 17:15 ` Christophe JAILLET
  2024-05-02 17:11 ` [PATCH 1/2] leds: lp50xx: Remove an unused field in struct lp50xx_led Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Christophe JAILLET @ 2024-04-28 17:15 UTC (permalink / raw)
  To: Pavel Machek, Lee Jones
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-leds

In "struct lp50xx", the 'num_of_banked_leds' field is only written and is
never used.
Moreover, storing such an information in the 'priv' structure looks
pointless.

So, remove it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only.
---
 drivers/leds/leds-lp50xx.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c
index 407eddcf17c0..175d4b06659b 100644
--- a/drivers/leds/leds-lp50xx.c
+++ b/drivers/leds/leds-lp50xx.c
@@ -278,7 +278,6 @@ struct lp50xx_led {
  * @dev: pointer to the devices device struct
  * @lock: lock for reading/writing the device
  * @chip_info: chip specific information (ie num_leds)
- * @num_of_banked_leds: holds the number of banked LEDs
  * @leds: array of LED strings
  */
 struct lp50xx {
@@ -289,7 +288,6 @@ struct lp50xx {
 	struct device *dev;
 	struct mutex lock;
 	const struct lp50xx_chip_info *chip_info;
-	int num_of_banked_leds;
 
 	/* This needs to be at the end of the struct */
 	struct lp50xx_led leds[];
@@ -403,8 +401,6 @@ static int lp50xx_probe_leds(struct fwnode_handle *child, struct lp50xx *priv,
 			return -EINVAL;
 		}
 
-		priv->num_of_banked_leds = num_leds;
-
 		ret = fwnode_property_read_u32_array(child, "reg", led_banks, num_leds);
 		if (ret) {
 			dev_err(priv->dev, "reg property is missing\n");
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] leds: lp50xx: Remove an unused field in struct lp50xx_led
  2024-04-28 17:15 [PATCH 1/2] leds: lp50xx: Remove an unused field in struct lp50xx_led Christophe JAILLET
  2024-04-28 17:15 ` [PATCH 2/2] leds: lp50xx: Remove an unused field in struct lp50xx Christophe JAILLET
@ 2024-05-02 17:11 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2024-05-02 17:11 UTC (permalink / raw)
  To: Pavel Machek, Lee Jones, Christophe JAILLET
  Cc: linux-kernel, kernel-janitors, linux-leds

On Sun, 28 Apr 2024 19:15:24 +0200, Christophe JAILLET wrote:
> In "struct lp50xx_led", the 'bank_modules' field is unused.
> Remove it.
> 
> Found with cppcheck, unusedStructMember.
> 
> 

Applied, thanks!

[1/2] leds: lp50xx: Remove an unused field in struct lp50xx_led
      commit: 221db0183bebbee146922b5816419bdc9b5425ff
[2/2] leds: lp50xx: Remove an unused field in struct lp50xx
      commit: dd66d058565a705980e6d55bd6592958531221b9

--
Lee Jones [李琼斯]


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-02 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-28 17:15 [PATCH 1/2] leds: lp50xx: Remove an unused field in struct lp50xx_led Christophe JAILLET
2024-04-28 17:15 ` [PATCH 2/2] leds: lp50xx: Remove an unused field in struct lp50xx Christophe JAILLET
2024-05-02 17:11 ` [PATCH 1/2] leds: lp50xx: Remove an unused field in struct lp50xx_led Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.