* [PATCH] power: supply: lp8788: make const array name static
@ 2022-10-05 16:13 Colin Ian King
2022-10-28 14:13 ` Sebastian Reichel
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-10-05 16:13 UTC (permalink / raw)
To: Sebastian Reichel, linux-pm; +Cc: kernel-janitors, linux-kernel
Don't populate the read-only array name on the stack but instead make
it static. Since the data and the pointers don't change also add in
a missing const. Also makes the object code a little smaller.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/power/supply/lp8788-charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/lp8788-charger.c b/drivers/power/supply/lp8788-charger.c
index 56c57529c228..802c9491fcdb 100644
--- a/drivers/power/supply/lp8788-charger.c
+++ b/drivers/power/supply/lp8788-charger.c
@@ -520,7 +520,7 @@ static int lp8788_set_irqs(struct platform_device *pdev,
static int lp8788_irq_register(struct platform_device *pdev,
struct lp8788_charger *pchg)
{
- const char *name[] = {
+ static const char * const name[] = {
LP8788_CHG_IRQ, LP8788_PRSW_IRQ, LP8788_BATT_IRQ
};
int i;
--
2.37.3
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] power: supply: lp8788: make const array name static
2022-10-05 16:13 [PATCH] power: supply: lp8788: make const array name static Colin Ian King
@ 2022-10-28 14:13 ` Sebastian Reichel
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2022-10-28 14:13 UTC (permalink / raw)
To: Colin Ian King; +Cc: linux-pm, kernel-janitors, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1075 bytes --]
Hi,
On Wed, Oct 05, 2022 at 05:13:48PM +0100, Colin Ian King wrote:
> Don't populate the read-only array name on the stack but instead make
> it static. Since the data and the pointers don't change also add in
> a missing const. Also makes the object code a little smaller.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
Thanks, queued.
-- Sebastian
> drivers/power/supply/lp8788-charger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/lp8788-charger.c b/drivers/power/supply/lp8788-charger.c
> index 56c57529c228..802c9491fcdb 100644
> --- a/drivers/power/supply/lp8788-charger.c
> +++ b/drivers/power/supply/lp8788-charger.c
> @@ -520,7 +520,7 @@ static int lp8788_set_irqs(struct platform_device *pdev,
> static int lp8788_irq_register(struct platform_device *pdev,
> struct lp8788_charger *pchg)
> {
> - const char *name[] = {
> + static const char * const name[] = {
> LP8788_CHG_IRQ, LP8788_PRSW_IRQ, LP8788_BATT_IRQ
> };
> int i;
> --
> 2.37.3
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-28 14:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 16:13 [PATCH] power: supply: lp8788: make const array name static Colin Ian King
2022-10-28 14:13 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®