Re: [PATCH v2 2/3] usb: dwc3: gadget: Add support for snps,reserved-endpoints property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 12, 2025, Thinh Nguyen wrote:
> On Mon, Feb 03, 2025, Andy Shevchenko wrote:
> >  
> > +static int dwc3_gadget_parse_reserved_endpoints(struct dwc3 *dwc, const char *propname,
> > +						u8 *eps, u8 num)
> > +{
> > +	u8 count;
> > +	int ret;
> > +
> > +	if (!device_property_present(dwc->dev, propname))
> > +		return 0;
> > +
> > +	ret = device_property_count_u8(dwc->dev, propname);
> > +	if (ret < 0)
> > +		return ret;
> > +	count = ret;
> > +
> > +	ret = device_property_read_u8_array(dwc->dev, propname, eps, min(num, count));
> 
> Why do min(num, count)? Can we just put the size of the eps array as
> specified by the function doc.
> 

Actually ignore this. What you have here is fine.

Thanks,
Thinh




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux