public inbox for backports@vger.kernel.org
 help / color / mirror / Atom feed
From: Arend van Spriel <arend@broadcom.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Julia Lawall <julia.lawall@lip6.fr>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	Coccinelle <cocci@systeme.lip6.fr>, <backports@vger.kernel.org>,
	"Johannes Berg" <johannes@sipsolutions.net>,
	"Luis R. Rodriguez" <mcgrof@suse.com>
Subject: Re: [patch] CodingStyle: add some more error handling guidelines
Date: Wed, 3 Dec 2014 15:08:02 +0100	[thread overview]
Message-ID: <547F1942.5060502@broadcom.com> (raw)
In-Reply-To: <547F0F2A.3060708@users.sourceforge.net>

On 12/03/14 14:24, SF Markus Elfring wrote:
>> Sorry.  I misread your email.  If the code looks like this:
>>
>> 	foo = kmalloc();
>> 	if (!foo)
>> 		goto kmalloc_failed;
>>
>> The "kmalloc_failed" doesn't add any information.
>
> I find that this such a name approach would fit to your
> expectation of a source-oriented labeling of these identifiers.
>
>
>> We can see that kmalloc failed from the context.
>
> Which name pattern do you find more appropriate in such
> an use case?

I think Dan wants the label to be descriptive about the tasks needed in 
the exception handling itself. This makes sense as the exception 
handling steps may be reused for different failures in the code.

void foo(void)
{
	if (check_a())
		goto do_bar;

	sub_foo1();

	if (checck_b())
		goto do_bar;

	sub_foo2();
	return;

do_bar:
	bar();
}

Regards,
Arend

> Regards,
> Markus
> --
> To unsubscribe from this list: send the line "unsubscribe backports" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2014-12-03 14:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20141202085950.GA13434@mwanda>
2014-12-03 12:31 ` [patch] CodingStyle: add some more error handling guidelines SF Markus Elfring
2014-12-03 12:39   ` Arend van Spriel
2014-12-03 12:51     ` SF Markus Elfring
2014-12-03 12:45   ` Dan Carpenter
2014-12-03 12:52     ` Julia Lawall
2014-12-03 13:15       ` Dan Carpenter
2014-12-03 13:00     ` SF Markus Elfring
2014-12-03 13:20       ` Dan Carpenter
2014-12-03 13:24         ` SF Markus Elfring
2014-12-03 14:08           ` Arend van Spriel [this message]
2014-12-03 16:00             ` SF Markus Elfring
2014-12-03 19:13               ` Arend van Spriel
2014-12-03 23:11                 ` SF Markus Elfring

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=547F1942.5060502@broadcom.com \
    --to=arend@broadcom.com \
    --cc=backports@vger.kernel.org \
    --cc=cocci@systeme.lip6.fr \
    --cc=corbet@lwn.net \
    --cc=dan.carpenter@oracle.com \
    --cc=elfring@users.sourceforge.net \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=johannes@sipsolutions.net \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@suse.com \
    /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