[PATCH] staging: pi433: Fix string form declaration

Burak Ozdemir posted 1 patch 3 years, 6 months ago
drivers/staging/pi433/pi433_if.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] staging: pi433: Fix string form declaration
Posted by Burak Ozdemir 3 years, 6 months ago
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
Re: [PATCH] staging: pi433: Fix string form declaration
Posted by Greg Kroah-Hartman 3 years, 6 months ago
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