linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: shuah@kernel.org, linux-kselftest@vger.kernel.org,
	Frederic Weisbecker <fweisbec@gmail.com>,
	John Stultz <john.stultz@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Shuah Khan <shuahkh@osg.samsung.com>
Subject: Re: [PATCH] selftests: posix_timers: Use common error handling code in two functions
Date: Tue, 21 Nov 2017 19:46:46 +0100	[thread overview]
Message-ID: <26ab24f1-cc65-17c1-2284-84cf5970506d@users.sourceforge.net> (raw)
In-Reply-To: <abce4f4e-a904-9bfe-7021-3cfd230d52ea@kernel.org>

>> Add jump targets so that a bit of exception handling can be better reused
>> at the end of these functions.
>>
>> This issue was detected by using the Coccinelle software.
> 
> Please include Coccinelle report in the change log.

I guess that I can not append the kind of report you might be looking for
so far. This small update suggestion is just another result from one
of my evolving scripts for the semantic patch language.

It was discussed under the topic “Comparing statement lists with SmPL”
to some degree.
https://systeme.lip6.fr/pipermail/cocci/2017-August/004388.html


>> @@ -104,10 +104,8 @@ static int check_itimer(int which)
>>  		signal(SIGALRM, sig_handler);
>>  
>>  	err = gettimeofday(&start, NULL);
>> -	if (err < 0) {
>> -		perror("Can't call gettimeofday()\n");
>> -		return -1;
>> -	}
>> +	if (err < 0)
>> +		goto report_failure;
> 
> Instead of report_failure, makes this specific to the failure.
> Something like, gettimeofday_error

Would you like to achieve unique error messages in this use case?

Regards,
Markus

      reply	other threads:[~2017-11-21 18:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 10:00 [PATCH] selftests: posix_timers: Use common error handling code in two functions SF Markus Elfring
2017-11-21 15:43 ` Shuah Khan
2017-11-21 18:46   ` SF Markus Elfring [this message]

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=26ab24f1-cc65-17c1-2284-84cf5970506d@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=fweisbec@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=shuah@kernel.org \
    --cc=shuahkh@osg.samsung.com \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).