Re: [PATCH 4/9] pxa27x_udc: optimize code to remove local variable and extra check

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

 



Robert Jarzmik wrote, On 01/17/2009 05:46 AM:
> Vernon Sauder <vernoninhand@xxxxxxxxx> writes:
> 
>> diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
>> index a896431..af35088 100644
>> --- a/drivers/usb/gadget/pxa27x_udc.c
>> +++ b/drivers/usb/gadget/pxa27x_udc.c
>> @@ -817,9 +817,7 @@ static void ep_end_in_req(struct pxa_ep *ep, struct pxa27x_request *req)
>>   */
>>  static void ep0_end_in_req(struct pxa_ep *ep, struct pxa27x_request *req)
>>  {
>> -	struct pxa_udc *udc = ep->dev;
>> -
>> -	set_ep0state(udc, IN_STATUS_STAGE);
>> +	set_ep0state(ep->dev, IN_STATUS_STAGE);
>>  	ep_end_in_req(ep, req);
>>  }
> No. Leave the optimization to the compiler, he's smarter than me anyway. The way
> the code is written is for maintainability. I'm pretty sure the compiler will
> deal with the local variable appropriately.
> 

I was making this function match its sister ep0_end_out_req for
maintainability. Why should they be different? Should I submit a patch
to change ep0_end_out_req to add the local variable?

<snip>

> 
> Cheers.
> 
> --
> Robert


-- 
Regards,
 Vernon Sauder :)

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

  Powered by Linux