Skip to contentSkip to conversation

crypto: atmel-aes - erro when compiling with VERBOSE_DEBUG enable

BUG levent demir 3 participants 6 messages Sep 13, 2016 – Oct 3, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,

if you enable VERBOSE_DEBUG and compile you will have the following error :

drivers/crypto/atmel-aes.c:323:5: error: too few arguments to function 'atmel_aes_reg_name'

     atmel_aes_reg_name(offset, tmp));
     ^
include/linux/device.h:1306:41: note: in definition of macro 'dev_vdbg'
   dev_printk(KERN_DEBUG, dev, format, ##arg); \
                                         ^

drivers/crypto/atmel-aes.c:205:20: note: declared here
static const char *atmel_aes_reg_name(u32 offset, char *tmp, size_t sz)

Indeed, in atmel_aes_write function the call to atmel_aes_reg_name contains only two arguments instead of 3 :

atmel_aes_reg_name(offset, tmp));

To fix it, one has to only add the size of tmp as third argument :

atmel_aes_reg_name(offset, tmp, sizeof(tmp)));

atmel-aes-fixed.c renamed from atmel-aes.c +1 -1
@@ -317,7 +317,7 @@
 		char tmp[16];
 
 		dev_vdbg(dd->dev, "write 0x%08x into %s\n", value,
-			 atmel_aes_reg_name(offset, tmp));
+				atmel_aes_reg_name(offset, tmp, sizeof(tmp)));
 	}
 #endif /* VERBOSE_DEBUG */
maintainer
#1 lore raw
Quoted 15 lines · levent demir

Hello,

if you enable VERBOSE_DEBUG and compile you will have the following error :

drivers/crypto/atmel-aes.c:323:5: error: too few arguments to function 'atmel_aes_reg_name'

    atmel_aes_reg_name(offset, tmp));
    ^
include/linux/device.h:1306:41: note: in definition of macro 'dev_vdbg'
  dev_printk(KERN_DEBUG, dev, format, ##arg); \
                                        ^

drivers/crypto/atmel-aes.c:205:20: note: declared here static const char *atmel_aes_reg_name(u32 offset, char *tmp, size_t sz)

Quoted 8 lines

Indeed, in atmel_aes_write function the call to atmel_aes_reg_name contains only two arguments instead of 3 :

atmel_aes_reg_name(offset, tmp));

To fix it, one has to only add the size of tmp as third argument :

atmel_aes_reg_name(offset, tmp, sizeof(tmp)));

Thanks for the patch. In order to apply it, you need to fix the white-space damage as well as add a sign-off. For details please refer to Documentation/SubmittingPatches.

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw

Fix debug function call in atmel_aes_write

---
 drivers/crypto/atmel-aes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/atmel-aes.c +0 -0
index e3d40a8..2b0f926 100644
@@ -317,7 +317,7 @@ static inline void atmel_aes_write(struct

atmel_aes_dev *dd,
char tmp[16];

dev_vdbg(dd->dev, "write 0x%08x into %s\n", value,
- atmel_aes_reg_name(offset, tmp));
+ atmel_aes_reg_name(offset, tmp, sizeof(tmp)));
}
#endif /* VERBOSE_DEBUG */

Signature · 1 line
2.5.5
Quoted 30 lines · Herbert Xu
Quoted 15 lines · levent demir

Hello,

if you enable VERBOSE_DEBUG and compile you will have the following error :

drivers/crypto/atmel-aes.c:323:5: error: too few arguments to function 'atmel_aes_reg_name'

    atmel_aes_reg_name(offset, tmp));
    ^
include/linux/device.h:1306:41: note: in definition of macro 'dev_vdbg'
  dev_printk(KERN_DEBUG, dev, format, ##arg); \
                                        ^

drivers/crypto/atmel-aes.c:205:20: note: declared here static const char *atmel_aes_reg_name(u32 offset, char *tmp, size_t sz)

Quoted 8 lines

Indeed, in atmel_aes_write function the call to atmel_aes_reg_name contains only two arguments instead of 3 :

atmel_aes_reg_name(offset, tmp));

To fix it, one has to only add the size of tmp as third argument :

atmel_aes_reg_name(offset, tmp, sizeof(tmp)));

Thanks for the patch. In order to apply it, you need to fix the white-space damage as well as add a sign-off. For details please refer to Documentation/SubmittingPatches.

Cheers,

#3 lore raw

Hi Levent,

there is a typo in the subject line: erroR.
Also it would be better to start the summary phrase of the subject line with a verb:

crypto: atmel-aes: fix compiler error when VERBODE_DEBUG is defined

Quoted 12 lines · levent demir

Fix debug function call in atmel_aes_write

---
 drivers/crypto/atmel-aes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/atmel-aes.c +0 -0
index e3d40a8..2b0f926 100644

drivers/crypto/atmel-aes.c static inline void atmel_aes_write(struct · line 321

Quoted 6 lines
drivers/crypto/atmel-aes.c +1 -1
@@ -317,7 +317,7 @@ static inline void atmel_aes_write(struct
 atmel_aes_dev *dd,
 		char tmp[16];
 
 		dev_vdbg(dd->dev, "write 0x%08x into %s\n", value,
-			 atmel_aes_reg_name(offset, tmp));
+			atmel_aes_reg_name(offset, tmp, sizeof(tmp)));

It looks like a space has been removed.

drivers/crypto/atmel-aes.c static inline void atmel_aes_write(struct · line 323

Quoted 4 lines
drivers/crypto/atmel-aes.c +0 -0
 	}
 #endif /* VERBOSE_DEBUG */

Best regards,

Cyrille

maintainer
#4 lore raw
Quoted 24 lines · Cyrille Pitchen

Hi Levent,

there is a typo in the subject line: erroR.
Also it would be better to start the summary phrase of the subject line with a verb:

crypto: atmel-aes: fix compiler error when VERBODE_DEBUG is defined

Quoted 15 lines · levent demir

Fix debug function call in atmel_aes_write

---
 drivers/crypto/atmel-aes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/atmel-aes.c +0 -0
index e3d40a8..2b0f926 100644
@@ -317,7 +317,7 @@ static inline void atmel_aes_write(struct
 atmel_aes_dev *dd,
 		char tmp[16];
 
Quoted 4 lines

drivers/crypto/atmel-aes.c static inline void atmel_aes_write(struct · line 321

Quoted 3 lines
drivers/crypto/atmel-aes.c +1 -1
 		dev_vdbg(dd->dev, "write 0x%08x into %s\n", value,
-			 atmel_aes_reg_name(offset, tmp));
+			atmel_aes_reg_name(offset, tmp, sizeof(tmp)));

It looks like a space has been removed.

It's been completely mangled by the mailer and cannot be applied.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#5 lore raw

Hi all,

Quoted 25 lines · Herbert Xu
Quoted 24 lines · Cyrille Pitchen

Hi Levent,

there is a typo in the subject line: erroR.
Also it would be better to start the summary phrase of the subject line with a verb:

crypto: atmel-aes: fix compiler error when VERBODE_DEBUG is defined

Quoted 15 lines · levent demir

Fix debug function call in atmel_aes_write

---
 drivers/crypto/atmel-aes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/atmel-aes.c +0 -0
index e3d40a8..2b0f926 100644
@@ -317,7 +317,7 @@ static inline void atmel_aes_write(struct
 atmel_aes_dev *dd,
 		char tmp[16];
 
Quoted 7 lines
Quoted 4 lines

drivers/crypto/atmel-aes.c static inline void atmel_aes_write(struct · line 321

Quoted 3 lines
drivers/crypto/atmel-aes.c +1 -1
 		dev_vdbg(dd->dev, "write 0x%08x into %s\n", value,
-			 atmel_aes_reg_name(offset, tmp));
+			atmel_aes_reg_name(offset, tmp, sizeof(tmp)));

It looks like a space has been removed.

It's been completely mangled by the mailer and cannot be applied.

I've sent a new version in this thread:
https://lkml.org/lkml/2016/9/29/463

I added a Reported-by tag for Levent but if you want to use a Signed-off-by tag instead, it's fine with me!

Best regards,

Cyrille