public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: kieran.bingham@ideasonboard.com
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Kieran Bingham <kbingham@kernel.org>,
	linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, sakari.ailus@iki.fi,
	niklas.soderlund@ragnatech.se
Subject: Re: [PATCH v4 1/2] media: i2c: adv748x: add adv748x driver
Date: Mon, 26 Jun 2017 19:00:13 +0300	[thread overview]
Message-ID: <12087293.ibczxtmbyi@avalon> (raw)
In-Reply-To: <530a839a-c828-b0cd-03de-858aa69d266c@ideasonboard.com>

[snip]

On Monday 26 Jun 2017 16:14:47 Kieran Bingham wrote:
> >> +int adv748x_txa_power(struct adv748x_state *state, bool on)
> >> +{
> >> +    int val;
> >> +
> >> +    val = txa_read(state, ADV748X_CSI_FS_AS_LS);
> >> +    if (val < 0)
> >> +        return val;
> >> +
> >> +    /*
> >> +     * This test against BIT(6) is not documented by the datasheet, but
> >> was +     * specified in the downstream driver.
> >> +     * Track with a WARN_ONCE to determine if it is ever set by HW.
> >> +     */
> >> +    WARN_ONCE((on && val & ADV748X_CSI_FS_AS_LS_UNKNOWN),
> >> +            "Enabling with unknown bit set");
> >> +
> >> +    if (on)
> >> +        return adv748x_write_regs(state, adv748x_power_up_txa_4lane);
> >> +    else
> >
> > 'else' isn't needed.
> 
> That's a shame - I think the code is more elegant (/symmetrical) this way -
> but no worries.
> Adapted. (same for the others)

For what it's worth, I would personally have kept the else here. I'm all for

	if (simple_case) {
		handle_simple_case();
		return 0;
	}

	/* Complex case */

or similar constructs with s/simple_case/uncommon_case/ or 
s/simple_case/error_case/, but here the two branches are small and symmetric, 
so an else makes sense to me to highlight that symmetry.

> >> +        return adv748x_write_regs(state, adv748x_power_down_txa_4lane);
> >> +}

-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2017-06-26 16:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13  0:35 [PATCH v4 0/2] ADV748x HDMI/Analog video receiver Kieran Bingham
2017-06-13  0:35 ` [PATCH v4 1/2] media: i2c: adv748x: add adv748x driver Kieran Bingham
2017-06-13  7:33   ` Niklas Söderlund
2017-06-13 12:22     ` Kieran Bingham
2017-06-13  9:24   ` Geert Uytterhoeven
2017-06-13  9:32     ` Kieran Bingham
2017-06-13  9:38       ` Geert Uytterhoeven
2017-06-19  9:13   ` Hans Verkuil
2017-06-26 15:14     ` Kieran Bingham
2017-06-26 15:36       ` Hans Verkuil
2017-06-26 16:00       ` Laurent Pinchart [this message]
2017-06-13  0:35 ` [PATCH v4 2/2] arm64: dts: renesas: salvator-x: Add ADV7482 support Kieran Bingham
2017-06-14  9:04   ` Simon Horman
2017-06-14  9:11     ` Kieran Bingham
2017-06-14  9:39   ` Geert Uytterhoeven
2017-06-14  9:43     ` Kieran Bingham
2017-06-14 11:33       ` Geert Uytterhoeven

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=12087293.ibczxtmbyi@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kbingham@kernel.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=sakari.ailus@iki.fi \
    /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