Hi, On Wed, Aug 05, 2015 at 08:32:02AM +0800, Peter Chen wrote: > On Tue, Aug 04, 2015 at 11:04:38AM -0500, Felipe Balbi wrote: > > commit 913e4a90b6f9 ("usb: gadget: f_uac2: > > finalize wMaxPacketSize according to bandwidth") > > added a possible build warning when calling > > min(). In order to fix the warning, we just > > make sure to call min_t() and tell that its > > arguments should be u16. > > > > Cc: Peter Chen <peter.chen@xxxxxxxxxxxxx> > > Signed-off-by: Felipe Balbi <balbi@xxxxxx> > > --- > > drivers/usb/gadget/function/f_uac2.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c > > index b5680246d6aa..c35a2a1157d5 100644 > > --- a/drivers/usb/gadget/function/f_uac2.c > > +++ b/drivers/usb/gadget/function/f_uac2.c > > @@ -994,7 +994,7 @@ static void set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts, > > > > max_packet_size = num_channels(chmask) * ssize * > > DIV_ROUND_UP(srate, factor / (1 << (ep_desc->bInterval - 1))); > > - ep_desc->wMaxPacketSize = cpu_to_le16(min(max_packet_size, > > + ep_desc->wMaxPacketSize = cpu_to_le16(min_t(u16, max_packet_size, > > le16_to_cpu(ep_desc->wMaxPacketSize))); > > } > > > > -- > > 2.5.0 > > > > Felipe, thanks for your fix. By the way, how to trigger this build > warning? allmodconfig triggered, now I can't remember if it was x86 or ARM build. GCC 4.9.3 from Debian unstable on both cases. -- balbi
Attachment:
signature.asc
Description: Digital signature