linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: supply: code cleanup
@ 2021-05-15 11:09 Nour-eddine Taleb
  0 siblings, 0 replies; only message in thread
From: Nour-eddine Taleb @ 2021-05-15 11:09 UTC (permalink / raw)
  To: sre, matti.vaittinen; +Cc: linux-pm, linux-kernel, linux-power

replace declarations like:
	char *foo = "bar";
with:
	char foo[] = "bar"
because the first declaration creates two variables, one for the string,
and the second for the pointer to the string.
while the second declaration create just one variable for the string,
which makes smaller bin.

Signed-off-by: Nour-eddine Taleb <contact@noureddine.xyz>
---
  drivers/power/supply/act8945a_charger.c | 4 ++--
  drivers/power/supply/bd70528-charger.c  | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/act8945a_charger.c 
b/drivers/power/supply/act8945a_charger.c
index e9b5f4283772..d7002b30e74c 100644
--- a/drivers/power/supply/act8945a_charger.c
+++ b/drivers/power/supply/act8945a_charger.c
@@ -15,8 +15,8 @@
  #include <linux/regmap.h>
  #include <linux/gpio/consumer.h>

-static const char *act8945a_charger_model = "ACT8945A";
-static const char *act8945a_charger_manufacturer = "Active-semi";
+static const char act8945a_charger_model[] = "ACT8945A";
+static const char act8945a_charger_manufacturer[] = "Active-semi";

  /*
   * ACT8945A Charger Register Map
diff --git a/drivers/power/supply/bd70528-charger.c 
b/drivers/power/supply/bd70528-charger.c
index 7c1f0b99c71b..0b7575ed80d5 100644
--- a/drivers/power/supply/bd70528-charger.c
+++ b/drivers/power/supply/bd70528-charger.c
@@ -87,8 +87,8 @@
  #define CHG_STAT_TSD_TOPOFF	0x22
  #define CHG_STAT_BAT_ERR	0x7f

-static const char *bd70528_charger_model = "BD70528";
-static const char *bd70528_charger_manufacturer = "ROHM Semiconductors";
+static const char bd70528_charger_model[] = "BD70528";
+static const char bd70528_charger_manufacturer[] = "ROHM Semiconductors";

  #define BD_ERR_IRQ_HND(_name_, _wrn_)					\
  static irqreturn_t bd0528_##_name_##_interrupt(int irq, void *arg)	\
-- 
2.30.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-15 11:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-15 11:09 [PATCH] power: supply: code cleanup Nour-eddine Taleb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).