linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Chanwoo Choi <cw00.choi@samsung.com>
Cc: <myungjoo.ham@samsung.com>, <linux-kernel@vger.kernel.org>,
	<patches@opensource.wolfsonmicro.com>
Subject: Re: [PATCH v2] extcon: arizona: Wait for any running HPDETs to complete on jack removal
Date: Wed, 25 Jan 2017 10:07:32 +0000	[thread overview]
Message-ID: <20170125100732.GD1754@localhost.localdomain> (raw)
In-Reply-To: <58887456.1060904@samsung.com>

On Wed, Jan 25, 2017 at 06:48:06PM +0900, Chanwoo Choi wrote:
> Hi,
> 
> I modified some minor issue and added my comment on below.
> After modified them by myself, Applied it. 
> 
> On 2017년 01월 25일 18:34, Charles Keepax wrote:
> > As the HPDET can't be aborted mid way through we should not allow any new
> > insertion to be processed until the previous HPDET has finished. It is very
> > unlikely but with low enough debounce settings you could start a new HPDET
> > before the old one has completed, which results in an erroneous reading.
> > 
> > Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> > ---
> > +#define ARIZONA_HPDET_WAIT_COUNT 15
> > +#define ARIZONA_HPDET_WAIT_DELAY_MS 20
> 
> Move these definitions on the top.
> 

You can make this change if it is your preference, but generally
I feel this makes the code less clear. Previously you could
look at this bit of the code locally and clearly see what was
happening now the reader will need to spin all the way up to the
top of the file probably twice.

> > +
> > +static int arizona_hpdet_wait(struct arizona_extcon_info *info)
> > +{
> > +	struct arizona *arizona = info->arizona;
> > +	unsigned int val;
> > +	int i, ret;
> > +
> > +	for (i = 0; i < ARIZONA_HPDET_WAIT_COUNT; i++) {
> > +		ret = regmap_read(arizona->regmap, ARIZONA_HEADPHONE_DETECT_2,
> > +				  &val);
> 
> Remove the space indentation. I prefer to use only tab indentation.
> 

Again I don't mind, but my understanding was this was the
preferred style in the kernel and checkpatch --strict will warn
if you remove the spaces. It does also match the style of the
rest of the file itself.

Thanks,
Charles

      reply	other threads:[~2017-01-25 10:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170125093332epcas2p27a231cb2c921811302a8e2df9c23f251@epcas2p2.samsung.com>
2017-01-25  9:34 ` [PATCH v2] extcon: arizona: Wait for any running HPDETs to complete on jack removal Charles Keepax
2017-01-25  9:35   ` Chanwoo Choi
2017-01-25  9:41     ` Charles Keepax
2017-01-25  9:48   ` Chanwoo Choi
2017-01-25 10:07     ` Charles Keepax [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=20170125100732.GD1754@localhost.localdomain \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=cw00.choi@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=patches@opensource.wolfsonmicro.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;
as well as URLs for NNTP newsgroup(s).