* [PATCH] staging: ccree: fix type mismatch warning
@ 2017-12-21 13:31 Arnd Bergmann
2017-12-21 17:14 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-12-21 13:31 UTC (permalink / raw)
To: Gilad Ben-Yossef, Greg Kroah-Hartman
Cc: Arnd Bergmann, Suniel Mahesh, Derek Robson, linux-crypto,
driverdev-devel, devel, linux-kernel
__dump_byte_array used to be hidden, but is now visible to the compiler
and causes a harmless warning:
drivers/staging/ccree/ssi_driver.c:82:6: error: conflicting types for '__dump_byte_array'
drivers/staging/ccree/ssi_driver.c: In function '__dump_byte_array':
drivers/staging/ccree/ssi_driver.c:89:41: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Werror=format=]
This changes the prototype in the header to match that of the actual
function on all architectures, and the format string to match the
argument.
Fixes: 3f268f5d6669 ("staging: ccree: turn compile time debug log to params")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/staging/ccree/ssi_driver.c | 2 +-
drivers/staging/ccree/ssi_driver.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/staging/ccree/ssi_driver.c
index 56b5d45a205c..1254c6922d50 100644
--- a/drivers/staging/ccree/ssi_driver.c
+++ b/drivers/staging/ccree/ssi_driver.c
@@ -86,7 +86,7 @@ void __dump_byte_array(const char *name, const u8 *buf, size_t len)
if (!buf)
return;
- snprintf(prefix, sizeof(prefix), "%s[%lu]: ", name, len);
+ snprintf(prefix, sizeof(prefix), "%s[%zu]: ", name, len);
print_hex_dump(KERN_DEBUG, prefix, DUMP_PREFIX_ADDRESS, 16, 1, buf,
len, false);
diff --git a/drivers/staging/ccree/ssi_driver.h b/drivers/staging/ccree/ssi_driver.h
index 5a56f7a76b71..e1406d6e1ab2 100644
--- a/drivers/staging/ccree/ssi_driver.h
+++ b/drivers/staging/ccree/ssi_driver.h
@@ -175,9 +175,9 @@ static inline struct device *drvdata_to_dev(struct cc_drvdata *drvdata)
}
void __dump_byte_array(const char *name, const u8 *the_array,
- unsigned long size);
+ size_t size);
static inline void dump_byte_array(const char *name, const u8 *the_array,
- unsigned long size)
+ size_t size)
{
if (cc_dump_bytes)
__dump_byte_array(name, the_array, size);
--
2.9.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: ccree: fix type mismatch warning
2017-12-21 13:31 [PATCH] staging: ccree: fix type mismatch warning Arnd Bergmann
@ 2017-12-21 17:14 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2017-12-21 17:14 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Gilad Ben-Yossef, devel, Derek Robson, driverdev-devel,
linux-kernel, linux-crypto, Suniel Mahesh
On Thu, Dec 21, 2017 at 02:31:20PM +0100, Arnd Bergmann wrote:
> __dump_byte_array used to be hidden, but is now visible to the compiler
> and causes a harmless warning:
>
> drivers/staging/ccree/ssi_driver.c:82:6: error: conflicting types for '__dump_byte_array'
> drivers/staging/ccree/ssi_driver.c: In function '__dump_byte_array':
> drivers/staging/ccree/ssi_driver.c:89:41: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Werror=format=]
>
> This changes the prototype in the header to match that of the actual
> function on all architectures, and the format string to match the
> argument.
>
> Fixes: 3f268f5d6669 ("staging: ccree: turn compile time debug log to params")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/staging/ccree/ssi_driver.c | 2 +-
> drivers/staging/ccree/ssi_driver.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
Should already be fixed, sorry.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-21 17:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-21 13:31 [PATCH] staging: ccree: fix type mismatch warning Arnd Bergmann
2017-12-21 17:14 ` 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