Re: [PATCH 2/2] Port dummy_hcd to hrtimers

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

 



Hi,

Thanks a lot for the comments!
I will make the suggested changes and resend properly this time.

>>  static int dummy_start_ss(struct dummy_hcd *dum_hcd)
>>  {
>> -     init_timer(&dum_hcd->timer);
>> -     dum_hcd->timer.function = dummy_timer;
>> -     dum_hcd->timer.data = (unsigned long)dum_hcd;
>> +     tasklet_hrtimer_init(&dum_hcd->ttimer, dummy_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
>>       dum_hcd->rh_state = DUMMY_RH_RUNNING;
>>       dum_hcd->stream_en_ep = 0;
>>       INIT_LIST_HEAD(&dum_hcd->urbp_list);
>> @@ -2347,9 +2366,7 @@ static int dummy_start(struct usb_hcd *hcd)
>>               return dummy_start_ss(dum_hcd);
>>
>>       spin_lock_init(&dum_hcd->dum->lock);
>> -     init_timer(&dum_hcd->timer);
>> -     dum_hcd->timer.function = dummy_timer;
>> -     dum_hcd->timer.data = (unsigned long)dum_hcd;
>> +     tasklet_hrtimer_init(&dum_hcd->ttimer, dummy_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
>>       dum_hcd->rh_state = DUMMY_RH_RUNNING;
>
> This looks weird, doesn't it?  As far as I can see, the only things
> that are different between dummy_start() and dummy_start_ss() are the
> spin_lock_init, stream_en_ep, and device_create_file.  I'd like to see
> this code refactored.  Maybe in a third patch?

I agree it looks a little weird and possibly buggy (because in the superspeed
case the list and timer could get reinitialized after they have started to be
used).

I 'm happy to send a separate patch for this.

Regards,
Pantelis
--
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