Re: [PATCH] jiffies.h: Better error message and add "const" where applicable.

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

 



On Sat, 29 Mar 2008, Robert P. J. Day wrote:

> 
> Add a more informative error message for bad values of HZ, and add
> "const" argument qualification for a couple routines for which it's
> appropriate.

What is the criterion for adding const?  For example, should there be 
const on the declaration of gran in the following function (also in 
kernel/time.c)?

struct timespec timespec_trunc(struct timespec t, unsigned gran)
{
        /*
         * Division is pretty slow so avoid it for common cases.
         * Currently current_kernel_time() never returns better than
         * jiffies resolution. Exploit that.
         */
        if (gran <= jiffies_to_usecs(1) * 1000) {
                /* nothing */
        } else if (gran == 1000000000) {
                t.tv_nsec = 0;
        } else {
                t.tv_nsec -= t.tv_nsec % gran;
        }
        return t;
}

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

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux