Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf137d5c authored by Simon Horman's avatar Simon Horman Committed by Greg Kroah-Hartman
Browse files

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: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 27b93f80
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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;