[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] linux-user: Simplify timerid checks on g_pos
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2] linux-user: Simplify timerid checks on g_posix_timers range |
Date: |
Fri, 22 Aug 2014 13:07:29 +0100 |
On 22 August 2014 12:56, Alexander Graf <address@hidden> wrote:
> We check whether the passed in timer id is negative on all calls
> that involve g_posix_timers.
>
> However, these checks are bogus. First off we limit the timer_id to
> 16 bits which is not what Linux does. Then we check whether it's negative
> which it can't be because we masked it.
>
> We can safely remove the masking. For the negativity check we can just
> treat the timerid as unsigned and only check for upper boundaries.
Timer IDs aren't unsigned for the kernel; why not just drop
the mask and keep the <0 checks?
-- PMM
Re: [Qemu-devel] [PATCH v2] linux-user: Simplify timerid checks on g_posix_timers range, Laurent Vivier, 2014/08/22