]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - drivers/usb/gadget/composite.c
linux/kernel.h: sync min, max, min3, max3 macros with Linux
[people/ms/u-boot.git] / drivers / usb / gadget / composite.c
index f8677931b46cbbda93ff47c516ebae8acbf508cc..a4c5606527a824bca5f53a5c7514d38e2d530f8b 100644 (file)
@@ -4,19 +4,7 @@
  * Copyright (C) 2006-2008 David Brownell
  * U-boot porting: Lukasz Majewski <l.majewski@samsung.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 #undef DEBUG
 
@@ -755,8 +743,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
                        if (!gadget_is_dualspeed(gadget))
                                break;
                        device_qual(cdev);
-                       value = min(w_length,
-                               sizeof(struct usb_qualifier_descriptor));
+                       value = min_t(int, w_length,
+                                     sizeof(struct usb_qualifier_descriptor));
                        break;
                case USB_DT_OTHER_SPEED_CONFIG:
                        if (!gadget_is_dualspeed(gadget))