public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH] staging: pi433: Fix string form declaration
  2022-09-09 18:24 [PATCH] staging: pi433: Fix string form declaration Burak Ozdemir
@ 2022-09-09 18:04 ` Greg Kroah-Hartman
       [not found]   ` <CACAQkfXH4smoY2v28DOZ_0uf_2=e8iEDSFbEbTMhU0JPuteOPw@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2022-09-09 18:04 UTC (permalink / raw)
  To: Burak Ozdemir; +Cc: linux-staging, linux-kernel

On Fri, Sep 09, 2022 at 06:24:13PM +0000, Burak Ozdemir wrote:
> From: Burak Ozdemir <bozdemir@gmail.com>
> 
> Use correct string form declaration, prevent extra variable
> declaration in final assembly output.

I am sorry, but I do not understand this text.  How is the original code
incorrect?

Please explain this a lot better when you resend a v2.

thanks,

greg k-h

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

* [PATCH] staging: pi433: Fix string form declaration
@ 2022-09-09 18:24 Burak Ozdemir
  2022-09-09 18:04 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Burak Ozdemir @ 2022-09-09 18:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-staging, linux-kernel

From: Burak Ozdemir <bozdemir@gmail.com>

Use correct string form declaration, prevent extra variable
declaration in final assembly output.

Signed-off-by: Burak Ozdemir <bozdemir@gmail.com>
---
 drivers/staging/pi433/pi433_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index df02335fdbab..70b3709acbb2 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -1105,7 +1105,7 @@ static int pi433_debugfs_regs_show(struct seq_file *m, void *p)
 	struct pi433_device *dev;
 	u8 reg_data[114];
 	int i;
-	char *fmt = "0x%02x, 0x%02x\n";
+	static const char fmt[] = "0x%02x, 0x%02x\n";
 	int ret;
 
 	dev = m->private;
-- 
2.35.1


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

* Re: [PATCH] staging: pi433: Fix string form declaration
       [not found]   ` <CACAQkfXH4smoY2v28DOZ_0uf_2=e8iEDSFbEbTMhU0JPuteOPw@mail.gmail.com>
@ 2022-09-10  5:36     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2022-09-10  5:36 UTC (permalink / raw)
  To: Burak Ozdemir; +Cc: linux-staging, linux-kernel

On Fri, Sep 09, 2022 at 10:50:57PM +0000, Burak Ozdemir wrote:
> I have been  analyzing todo tasks from `Kernel Janitors Projects` and saw
> the following task
> 
> From: Jeff Garzik
> 
> 1) The string form
>         [const] char *foo = "blah";
> creates two variables in the final assembly output, a static string, and a
> char pointer to the static string. The alternate string form
>         [const] char foo[] = "blah";
> is better because it declares a single variable.
> 
> That's why I changed that char * to static const[].

I'm sorry, but I have no context here at all for what this is in
response to.

Remember, some of us get hundreds of changes each day to review, and we
have the short-term memory of a squirrel.  Always include proper context
in an email message so that we know what is going on.

thanks,

greg k-h

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

end of thread, other threads:[~2022-09-10  5:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-09 18:24 [PATCH] staging: pi433: Fix string form declaration Burak Ozdemir
2022-09-09 18:04 ` Greg Kroah-Hartman
     [not found]   ` <CACAQkfXH4smoY2v28DOZ_0uf_2=e8iEDSFbEbTMhU0JPuteOPw@mail.gmail.com>
2022-09-10  5:36     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox