All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
	kernel-janitors@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] extcon: max14577: Use common error handling code in max14577_muic_set_path()
Date: Mon, 23 Oct 2017 05:54:02 +0000	[thread overview]
Message-ID: <59ED83FA.5000701@samsung.com> (raw)
In-Reply-To: <dda9c1c2-79ec-398e-40ed-a11e894e138b@users.sourceforge.net>

On 2017년 10월 23일 14:45, SF Markus Elfring wrote:
>> As you commented, this patch might remove the redundant error message.
>> But, it makes the code more complicated in side of readability.
> 
> Do you try to avoid duplicated code any more in other circumstances?

I usually used the goto statement on following cases:
- Return the value (error number if fail or 0 if success)
- Do free or unregister or remove operations when error happen.

I think that there is any benefit of this patch.
Also, as I commented, it make the code more complicated.

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

WARNING: multiple messages have this Message-ID (diff)
From: Chanwoo Choi <cw00.choi@samsung.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>,
	kernel-janitors@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] extcon: max14577: Use common error handling code in max14577_muic_set_path()
Date: Mon, 23 Oct 2017 14:54:02 +0900	[thread overview]
Message-ID: <59ED83FA.5000701@samsung.com> (raw)
In-Reply-To: <dda9c1c2-79ec-398e-40ed-a11e894e138b@users.sourceforge.net>

On 2017년 10월 23일 14:45, SF Markus Elfring wrote:
>> As you commented, this patch might remove the redundant error message.
>> But, it makes the code more complicated in side of readability.
> 
> Do you try to avoid duplicated code any more in other circumstances?

I usually used the goto statement on following cases:
- Return the value (error number if fail or 0 if success)
- Do free or unregister or remove operations when error happen.

I think that there is any benefit of this patch.
Also, as I commented, it make the code more complicated.

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

  reply	other threads:[~2017-10-23  5:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-22 17:50 [PATCH 0/2] extcon-max14577: Fine-tuning for max14577_muic_set_path() SF Markus Elfring
2017-10-22 17:51 ` [PATCH 1/2] extcon: max14577: Use common error handling code in max14577_muic_set_path() SF Markus Elfring
2017-10-22 18:59   ` Krzysztof Kozlowski
2017-10-22 20:15     ` SF Markus Elfring
2017-10-22 20:15       ` SF Markus Elfring
2017-10-23  0:57   ` Chanwoo Choi
2017-10-23  5:45     ` SF Markus Elfring
2017-10-23  5:45       ` SF Markus Elfring
2017-10-23  5:54       ` Chanwoo Choi [this message]
2017-10-23  5:54         ` Chanwoo Choi
2017-10-23  5:57         ` SF Markus Elfring
2017-10-23  5:57           ` SF Markus Elfring
2017-10-23  6:03           ` Chanwoo Choi
2017-10-23  6:03             ` Chanwoo Choi
2017-10-23  6:08             ` SF Markus Elfring
2017-10-23  6:08               ` 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=59ED83FA.5000701@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.