linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-i2c@vger.kernel.org,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	Karthikeyan Ramasubramanian <kramasub@codeaurora.org>,
	Sagar Dharia <sdharia@codeaurora.org>,
	Girish Mahadevan <girishm@codeaurora.org>
Subject: Re: [PATCH v2 2/2] i2c: i2c-qcom-geni: Simplify tx/rx functions
Date: Thu, 20 Sep 2018 15:18:08 -0700	[thread overview]
Message-ID: <153748188889.119890.3818754688788845202@swboyd.mtv.corp.google.com> (raw)
In-Reply-To: <CAD=FV=U=r0nkT+JO2j4WUHF03ZiJcmaVrzL6dsauDHV=a2m3tQ@mail.gmail.com>

Quoting Doug Anderson (2018-09-20 13:22:37)
> Hi,
> On Thu, Sep 20, 2018 at 11:03 AM Stephen Boyd <swboyd@chromium.org> wrote:
> >
> > We never really look at the 'ret' local variable in these functions, so
> > let's remove it to make way for shorter and simpler code. Furthermore,
> > we can shorten some lines by adding two local variables for the SE and
> > the message length so that everything fits in 80 columns. And kernel
> > style is to leave the return statement by itself, detached from the rest
> > of the function.
> >
> > Cc: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
> > Cc: Sagar Dharia <sdharia@codeaurora.org>
> > Cc: Girish Mahadevan <girishm@codeaurora.org>
> > Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> > ---
> >  drivers/i2c/busses/i2c-qcom-geni.c | 54 ++++++++++++++----------------
> >  1 file changed, 25 insertions(+), 29 deletions(-)
> 
> I didn't hate the old code, but you're right that this looks a little better.
> 
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> 
> NOTE: now that you're cleaning it up, I'd personally go even further
> and totally get rid of the "mode" local variable.  Basically, just:
> 
> dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
> if (dma_buf)
>   geni_se_select_mode(se, GENI_SE_DMA);
> else
>   geni_se_select_mode(se, GENI_SE_FIFO);

Sure that's fine. I'll resend this one patch with that squashed in.


  reply	other threads:[~2018-09-20 22:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 18:03 [PATCH v2 0/2] Fix qcom geni i2c DMA handling Stephen Boyd
2018-09-20 18:03 ` [PATCH v2 1/2] i2c: i2c-qcom-geni: Properly handle DMA safe buffers Stephen Boyd
2018-09-20 20:22   ` Doug Anderson
2018-09-24 22:13   ` Wolfram Sang
2018-09-20 18:03 ` [PATCH v2 2/2] i2c: i2c-qcom-geni: Simplify tx/rx functions Stephen Boyd
2018-09-20 20:22   ` Doug Anderson
2018-09-20 22:18     ` Stephen Boyd [this message]
2018-09-24 22:13       ` Wolfram Sang

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=153748188889.119890.3818754688788845202@swboyd.mtv.corp.google.com \
    --to=swboyd@chromium.org \
    --cc=dianders@chromium.org \
    --cc=girishm@codeaurora.org \
    --cc=kramasub@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sdharia@codeaurora.org \
    --cc=wsa@the-dreams.de \
    /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).