All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Linux I2C <linux-i2c@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [RFC/RFT 1/7] i2c: sh_mobile: simplify sending address for RX
Date: Thu, 17 Jan 2019 11:11:09 +0100	[thread overview]
Message-ID: <CAMuHMdVMQp9YOTc-WDSLkTdeYppHMO0sTBF3fkkxn-VvBUbZUw@mail.gmail.com> (raw)
In-Reply-To: <20190116210555.12209-2-wsa+renesas@sang-engineering.com>

Hi Wolfram,

On Thu, Jan 17, 2019 at 1:36 AM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> pd->pos won't be smaller than -1, so we can simplify the logic.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks for your patch!

> --- a/drivers/i2c/busses/i2c-sh_mobile.c
> +++ b/drivers/i2c/busses/i2c-sh_mobile.c
> @@ -392,13 +392,9 @@ static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd)
>         int real_pos;
>
>         do {
> -               if (pd->pos <= -1) {

If this condition is never true, shouldn't the block just be removed instead?

> +               if (sh_mobile_i2c_is_first_byte(pd)) {
>                         sh_mobile_i2c_get_data(pd, &data);
> -
> -                       if (sh_mobile_i2c_is_first_byte(pd))
> -                               i2c_op(pd, OP_TX_FIRST, data);
> -                       else
> -                               i2c_op(pd, OP_TX, data);
> +                       i2c_op(pd, OP_TX_FIRST, data);
>                         break;
>                 }

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2019-01-17 10:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 21:05 [RFC/RFT 0/7] i2c: sh_mobile: state machine simplifications Wolfram Sang
2019-01-16 21:05 ` [RFC/RFT 1/7] i2c: sh_mobile: simplify sending address for RX Wolfram Sang
2019-01-17 10:11   ` Geert Uytterhoeven [this message]
2019-01-17 10:18     ` Wolfram Sang
2019-01-17 10:23       ` Geert Uytterhoeven
2019-01-16 21:05 ` [RFC/RFT 2/7] i2c: sh_mobile: remove get_data function Wolfram Sang
2019-01-17 10:25   ` Geert Uytterhoeven
2019-01-16 21:05 ` [RFC/RFT 3/7] i2c: sh_mobile: drop 'data' argument from i2c_op function Wolfram Sang
2019-01-17 10:30   ` Geert Uytterhoeven
2019-01-16 21:05 ` [RFC/RFT 4/7] i2c: sh_mobile: remove is_first_byte function Wolfram Sang
2019-01-17 10:30   ` Geert Uytterhoeven
2019-01-16 21:05 ` [RFC/RFT 5/7] i2c: sh_mobile: replace break; with if-block Wolfram Sang
2019-01-17 10:32   ` Geert Uytterhoeven
2019-01-16 21:05 ` [RFC/RFT 6/7] i2c: sh_mobile: refactor rx isr Wolfram Sang
2019-01-17 10:36   ` Geert Uytterhoeven
2019-01-16 21:05 ` [RFC/RFT 7/7] i2c: sh_mobile: update copyright and comments Wolfram Sang
2019-01-17 10:41   ` Geert Uytterhoeven
2019-01-17 17:05     ` Wolfram Sang
2019-01-18  8:34       ` Geert Uytterhoeven
2019-01-18 10:16         ` Wolfram Sang
2019-01-22 23:12 ` [RFC/RFT 0/7] i2c: sh_mobile: state machine simplifications 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=CAMuHMdVMQp9YOTc-WDSLkTdeYppHMO0sTBF3fkkxn-VvBUbZUw@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.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.