Re: patch "tty: fix up atime/mtime mess, take four" added to tty-linus

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

 



On Fri, Mar 6, 2015 at 6:07 PM,  <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> +       unsigned long sec = get_seconds();
> +       if (abs(sec - time->tv_sec) & ~7)
>                 time->tv_sec = sec;

It does strike me that instead of

   abs(sec - time->tv_sec) & ~7

we could just do

    (sec ^ time->tv_sec) & ~7

which just simply says "do the two values differ in any other bits
than the low three ones". Which is a lot easier to calculate.

It's not like this is some hugely performance-sensitive thing, of
course, so I guess nobody cares.

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




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]