linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nour-eddine Taleb <contact@noureddine.xyz>
To: sre@kernel.org, matti.vaittinen@fi.rohmeurope.com
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-power@fi.rohmeurope.com
Subject: [PATCH] power: supply: code cleanup
Date: Sat, 15 May 2021 11:09:41 +0000	[thread overview]
Message-ID: <31d85698-0fc0-6dcc-d3fc-41151f79a9cb@noureddine.xyz> (raw)

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


                 reply	other threads:[~2021-05-15 11:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31d85698-0fc0-6dcc-d3fc-41151f79a9cb@noureddine.xyz \
    --to=contact@noureddine.xyz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).