linux/kernel.h: sync min, max, min3, max3 macros with Linux

U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does.  This commit gets min, max, min3, max3
macros synced with the kernel introducing type checks.

Many of references of those macros must be fixed to suppress warnings.
We have two options:
 - Use min, max, min3, max3 only when the arguments have the same type
   (or add casts to the arguments)
 - Use min_t/max_t instead with the appropriate type for the first
   argument

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Pavel Machek <pavel@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
[trini: Fixup arch/blackfin/lib/string.c]
Signed-off-by: Tom Rini <trini@ti.com>
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 2a5bbf5..e8142ac 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -503,23 +503,23 @@
 	case 0:
 		switch (wValue & 0xff00) {
 		case 0x0100:	/* device descriptor */
-			len = min3(txlen, sizeof(root_hub_dev_des), wLength);
+			len = min3(txlen, (int)sizeof(root_hub_dev_des), (int)wLength);
 			memcpy(buffer, root_hub_dev_des, len);
 			break;
 		case 0x0200:	/* configuration descriptor */
-			len = min3(txlen, sizeof(root_hub_config_des), wLength);
+			len = min3(txlen, (int)sizeof(root_hub_config_des), (int)wLength);
 			memcpy(buffer, root_hub_config_des, len);
 			break;
 		case 0x0300:	/* string descriptors */
 			switch (wValue & 0xff) {
 			case 0x00:
-				len = min3(txlen, sizeof(root_hub_str_index0),
-					   wLength);
+				len = min3(txlen, (int)sizeof(root_hub_str_index0),
+					   (int)wLength);
 				memcpy(buffer, root_hub_str_index0, len);
 				break;
 			case 0x01:
-				len = min3(txlen, sizeof(root_hub_str_index1),
-					   wLength);
+				len = min3(txlen, (int)sizeof(root_hub_str_index1),
+					   (int)wLength);
 				memcpy(buffer, root_hub_str_index1, len);
 				break;
 			}
@@ -556,7 +556,7 @@
 			data[10] = data[9];
 		}
 
-		len = min3(txlen, data[0], wLength);
+		len = min3(txlen, (int)data[0], (int)wLength);
 		memcpy(buffer, data, len);
 		break;
 	default: