Skip to content

Commit

Permalink
Staging: rtl8192su, rtl8192u: use min_t() in store_debug_level()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Simon Horman authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 27b93f8 commit cf137d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/rtl8192su/ieee80211/ieee80211_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit cf137d5

Please sign in to comment.