1
0
Fork 0

Staging: rtl8192su, rtl8192u: use min_t() in store_debug_level()

sizeof() returns a size_t but the other types involved
are unsigned long, so using min() results in a warning.

As sizeof() is called on an 11 character buffer defined
immediately above unsigned long is obviously wide enough
for the result.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
hifive-unleashed-5.1
Simon Horman 2009-12-23 19:54:54 +11:00 committed by Greg Kroah-Hartman
parent 27b93f80e4
commit cf137d5c49
2 changed files with 2 additions and 2 deletions

View File

@ -262,7 +262,7 @@ static int store_debug_level(struct file *file, const char *buffer,
unsigned long count, void *data)
{
char buf[] = "0x00000000";
unsigned long len = min(sizeof(buf) - 1, count);
unsigned long len = min_t(unsigned long, sizeof(buf) - 1, count);
char *p = (char *)buf;
unsigned long val;

View File

@ -260,7 +260,7 @@ static int store_debug_level(struct file *file, const char *buffer,
unsigned long count, void *data)
{
char buf[] = "0x00000000";
unsigned long len = min(sizeof(buf) - 1, count);
unsigned long len = min_t(unsigned long, sizeof(buf) - 1, count);
char *p = (char *)buf;
unsigned long val;