[PATCH 106/368] Staging: rtl8192su, rtl8192u: use min_t() in store_debug_level()

Greg KH greg at kroah.com
Thu Mar 4 20:04:44 UTC 2010


From: Simon Horman <horms at verge.net.au>

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 at verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
---
 .../staging/rtl8192su/ieee80211/ieee80211_module.c |    2 +-
 .../staging/rtl8192u/ieee80211/ieee80211_module.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
index e8c67d5..c024fa6 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
@@ -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;
 
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index 7a8690f..b752017 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
@@ -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;
 
-- 
1.7.0.1




More information about the devel mailing list