mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Alexey Perevalov <a.perevalov@samsung.com>
Cc: linux-kernel@vger.kernel.org, john.stultz@linaro.org,
	Anton Vorontsov <anton@enomsg.org>,
	kyungmin.park@samsung.com, cw00.choi@samsung.com,
	akpm@linux-foundation.org,
	Anton Vorontsov <anton.vorontsov@linaro.org>
Subject: Re: [PATCH v4 4/6] timerfd: Move repeated logic into timerfd_rearm()
Date: Thu, 20 Feb 2014 22:13:11 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.02.1402202141220.4468@ionos.tec.linutronix.de> (raw)
In-Reply-To: <1392913425-29369-5-git-send-email-a.perevalov@samsung.com>

On Thu, 20 Feb 2014, Alexey Perevalov wrote:
> From: Anton Vorontsov <anton@enomsg.org>
> 
> This patch introduces timerfd_rearm(), this small helper is used to
> forward and restart the hrtimer.

And for what is this helper used for?
 
> Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
> Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
> ---
>  fs/timerfd.c |   40 +++++++++++++++++++---------------------
>  1 file changed, 19 insertions(+), 21 deletions(-)
> 
> diff --git a/fs/timerfd.c b/fs/timerfd.c
> index 9293121..4a349cb 100644
> --- a/fs/timerfd.c
> +++ b/fs/timerfd.c
> @@ -229,6 +229,23 @@ static unsigned int timerfd_poll(struct file *file, poll_table *wait)
>  	return events;
>  }
>  
> +static u64 timerfd_rearm(struct timerfd_ctx *ctx)
> +{
> +	u64 orun = 0;
> +
> +	if (isalarm(ctx)) {
> +		orun += alarm_forward_now(
> +			&ctx->t.alarm, ctx->tintv) - 1;
> +		alarm_restart(&ctx->t.alarm);
> +	} else {
> +		orun += hrtimer_forward_now(&ctx->t.tmr,
> +		     ctx->tintv) - 1;
> +		hrtimer_restart(&ctx->t.tmr);
> +	}
> +
> +	return orun;

I really give up. You did not even try to read and understand my
review points.

No, you went and mechanicallly fixed the compiler warning in the most
idiotic way one can come up with.

What's wrong with writing it:

{
	u64 orun;

	if (isalarm(ctx)) {
		orun = alarm_forward_now(ctx->t.alarm, ctx->tintv) - 1;
		alarm_restart(&ctx->t.alarm);
	} else {
		orun = hrtimer_forward_now(&ctx->t.tmr, ctx->tintv) - 1;
		hrtimer_restart(&ctx->t.tmr);
	}
	return orun;
}

Can you spot the difference? Just for the record:

1) It fixes the issue with proper assignments instead of pointlessly
   initializing the variable to 0 and then add the return value.

2) It removes the useless line break which makes the code simpler to
   read.

I told you to do #2 explicitely, but you decided to ignore it.

I did not tell you how to do #1, but I did not expect at all that
anyone might come up with that horrible solution.

This is not some random homework assignment in high school where you
might get away with the "It compiles so what" mentality.

Seriously, if you come back with another set of half baken patches,
you're going to end up in the utter-waste-of-time section of my
.procmailrc.

I have quite some patience with people, but I really have better
things to do than wasting my scarce time with advisory resistant
wannabe kernel developers.

Thanks,

	tglx

Hint: Take your time. Read carefully what I asked for and let your
      coworkers look over the patches including the subject lines and
      the changelogs before you send another half baken crap out in a
      haste.


  reply	other threads:[~2014-02-20 21:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 16:23 [PATCH v4 0/6] Deferrable timers support for hrtimers/timerfd API Alexey Perevalov
2014-02-20 16:23 ` [PATCH v4 1/6] Replace ternary operator to macro Alexey Perevalov
2014-02-20 20:49   ` Thomas Gleixner
2014-02-20 16:23 ` [PATCH v4 2/6] tracing/trivial: Add CLOCK_BOOTIME and CLOCK_TAI for human readable clockid trace Alexey Perevalov
2014-02-20 20:49   ` Thomas Gleixner
2014-02-20 16:23 ` [PATCH v4 3/6] hrtimer: Add support for deferrable timer into the hrtimer Alexey Perevalov
2014-02-20 16:23 ` [PATCH v4 4/6] timerfd: Move repeated logic into timerfd_rearm() Alexey Perevalov
2014-02-20 21:13   ` Thomas Gleixner [this message]
2014-02-20 16:23 ` [PATCH v4 5/6] timerfd: Add support for deferrable timers Alexey Perevalov
2014-02-26  2:53   ` Andy Lutomirski
2014-03-04 20:58     ` Thomas Gleixner
2014-03-04 21:53       ` Andy Lutomirski
2014-03-04 22:11         ` Thomas Gleixner
2014-03-04 22:43           ` Andy Lutomirski
2014-03-05  0:10             ` Thomas Gleixner
2014-03-05  0:42               ` Andy Lutomirski
2014-03-05 11:40                 ` Thomas Gleixner
2014-03-05  9:42           ` Richard Cochran
2014-02-20 16:23 ` [PATCH v4 6/6] tracing/trivial: Add CLOCK_*_DEFERRABLE for tracing clockids Alexey Perevalov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1402202141220.4468@ionos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=a.perevalov@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=anton.vorontsov@linaro.org \
    --cc=anton@enomsg.org \
    --cc=cw00.choi@samsung.com \
    --cc=john.stultz@linaro.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®