linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: Pavel Machek <pavel@ucw.cz>,
	linux-pm@vger.kernel.org, Sebastian Reichel <sre@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: bq2415x_charger: Use common error handling code in bq2415x_timer_work()
Date: Thu, 9 Nov 2017 14:14:33 +0100	[thread overview]
Message-ID: <20171109131433.x7xuh4bqvqm72wb5@pali> (raw)
In-Reply-To: <d680ca7e-9806-1f39-80da-58fa7239a31c@users.sourceforge.net>

On Thursday 09 November 2017 14:04:19 SF Markus Elfring wrote:
> > Better fix would be to display separate messages; user is probably
> > interested in what failed...
> 
> Which information (or wording) would you find more appropriate
> at these places?

Hi! Basically dropping your patch and instead of the "Unknown error"
return to user reason why BQ2415X_BOOST_MODE_STATUS or
BQ2415X_FAULT_STATUS commands failed. Or at least instead of the
"Unknown error" write "Unknown error during BQ2415X_FAULT_STATUS".

Basically I do not see any value in your patch. Current coding style
pattern in that function is:

do_something;
if failed:
  print error;
  return;

And your patch just changed some, but not *all* parts of code to:

do_something;
if failed:
  goto end_of_function

If you are changing coding style, I would really suggest to change it on
all places to let it consistent. Because your change introduces just
inconsistency.

-- 
Pali Rohár
pali.rohar@gmail.com

  reply	other threads:[~2017-11-09 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 20:50 [PATCH] bq2415x_charger: Use common error handling code in bq2415x_timer_work() SF Markus Elfring
2017-11-09 12:08 ` Pavel Machek
2017-11-09 13:04   ` SF Markus Elfring
2017-11-09 13:14     ` Pali Rohár [this message]
2017-11-09 13:22       ` 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=20171109131433.x7xuh4bqvqm72wb5@pali \
    --to=pali.rohar@gmail.com \
    --cc=elfring@users.sourceforge.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=sre@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;
as well as URLs for NNTP newsgroup(s).