[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150124181724.GA5198@localhost.localdomain>
Date: Sat, 24 Jan 2015 19:17:24 +0100
From: Richard Cochran <richardcochran@...il.com>
To: Daniel Church <dchurch@...plus.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
libc-alpha@...rceware.org
Subject: Re: [PATCH v2 1/2] posix-timers: Prevents overrun counter overflow
On Sat, Jan 24, 2015 at 12:48:56PM -0500, Daniel Church wrote:
> +/*
> + * Updates a timer's overrun count while capping it to delaytimer_max
> + */
> +static void posix_timer_update_overrun_count(struct k_itimer *timer,
> + unsigned int overruns)
> +{
> + const bool newOverrunsAboveMax = overruns >= delaytimer_max;
> + const bool totalOverrunsAboveMax =
> + timer->it_overrun >= 0 &&
> + timer->it_overrun >= delaytimer_max - overruns;
Lower camel case is not a part of the kernel coding style.
Also, the 'const' keyword is useless in this context.
> +
> + if (newOverrunsAboveMax || totalOverrunsAboveMax) {
> + timer->it_overrun = delaytimer_max;
> + } else {
> + timer->it_overrun += overruns;
> + }
> +}
> +
> /* Get clock_realtime */
> static int posix_clock_realtime_get(clockid_t which_clock, struct timespec *tp)
> {
> @@ -1122,3 +1150,4 @@ long clock_nanosleep_restart(struct restart_block *restart_block)
>
> return kc->nsleep_restart(restart_block);
> }
> +
This stray newline and the camel case are the kinds of things that
checkpatch.pl will catch.
Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists