staging: pi433: Fix string form declaration
PATCH 1/1 staging: pi433: Fix string form declaration
From: Burak Ozdemir <[email protected]>
Use correct string form declaration, prevent extra variable declaration in final assembly output.
--- drivers/staging/pi433/pi433_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/pi433/pi433_if.c +1 -1
@@ -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;
Signature · 1 line
2.35.1
Greg Kroah-Hartman
maintainerQuoted 4 lines · Burak Ozdemir
From: Burak Ozdemir <[email protected]>
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
A message that is not in the archive (sent off-list or not yet received): CACAQkfXH4smoY2v28DOZ_0uf_2=e8iEDSFbEbTMhU0JPuteOPw@mail.gmail.com
Greg Kroah-Hartman
maintainerQuoted 5 lines · Burak Ozdemir
I have been analyzing todo tasks from
Kernel Janitors Projectsand saw the following taskFrom: Jeff Garzik
Quoted 8 lines
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