On Tue, Nov 14, 2017 at 08:42:30PM +0000, Bhanuprakash Bodireddy wrote:
> This commit replaces the numbers with MSEC_PER_SEC, NSEC_PER_SEC and
> USEC_PER_MSEC macros when dealing with timespec and timeval.
> 
> This commit doesn't change functionality.
> 
> Signed-off-by: Bhanuprakash Bodireddy <bhanuprakash.bodire...@intel.com>

This still seems careless and risky to me.

For example:
    msecs = secs * MSEC_PER_SEC * 1LL;
which expands to
    msecs = secs * 1000L * 1LL;
still risks overflow on a 32-bit system (where 1000L is 32 bits long).

The previous version of the code didn't have that problem:
    msecs = secs * 1000LL;

Maybe it would be better to just leave these as-is.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to