Re: [PATCH 2/9] IR: minor fixes:

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

 



Em 28-07-2010 13:38, Maxim Levitsky escreveu:
> On Wed, 2010-07-28 at 13:01 -0300, Mauro Carvalho Chehab wrote:
>> Em 28-07-2010 12:14, Maxim Levitsky escreveu:
>>> * lirc: Don't propagate reset event to userspace
>>> * lirc: Remove strange logic from lirc that would make first sample always be pulse
>>> * Make TO_US macro actualy print what it should.
>>>
>>> Signed-off-by: Maxim Levitsky <maximlevitsky@xxxxxxxxx>
>>> ---
>>>  drivers/media/IR/ir-core-priv.h  |    3 +--
>>>  drivers/media/IR/ir-lirc-codec.c |   14 ++++++++------
>>>  drivers/media/IR/ir-raw-event.c  |    3 +++
>>>  3 files changed, 12 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h
>>> index babd520..8ce80e4 100644
>>> --- a/drivers/media/IR/ir-core-priv.h
>>> +++ b/drivers/media/IR/ir-core-priv.h
>>> @@ -76,7 +76,6 @@ struct ir_raw_event_ctrl {
>>>  	struct lirc_codec {
>>>  		struct ir_input_dev *ir_dev;
>>>  		struct lirc_driver *drv;
>>> -		int lircdata;
>>>  	} lirc;
>>>  };
>>>  
>>> @@ -104,7 +103,7 @@ static inline void decrease_duration(struct ir_raw_event *ev, unsigned duration)
>>>  		ev->duration -= duration;
>>>  }
>>>  
>>> -#define TO_US(duration)			(((duration) + 500) / 1000)
>>> +#define TO_US(duration)			((duration) / 1000)
>>
>> It is better to keep rounding the duration to its closest value.
> 
> But that breaks if duration is already at maximum. At that case,
> you see usual signed int wrap from positive to negative, and abnormally
> large space...
> 
> I didn't notice though that you do rounding here.
> I replace that with something better.

There's a function for rounding at kernel. The better is to use it, as it should already
solve the signal wrap.

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


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux