All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-i2c@vger.kernel.org
Subject: Re: [PATCH v3 3/6] i2c: rcar: Consolidate timings calls in rcar_i2c_clock_calculate()
Date: Tue, 24 Mar 2020 09:13:28 +0100	[thread overview]
Message-ID: <20200324081328.GA1134@ninjato> (raw)
In-Reply-To: <20200323220353.GZ1922688@smile.fi.intel.com>

[-- Attachment #1: Type: text/plain, Size: 909 bytes --]

Hi Andy,

> > Here, the initialization to 0 is missing, so some values are broken.
> 
> Yes, and this is fine. They are not being used. So, the idea is, whenever we
> pass "false" as a parameter to the function we must take care of all fields we
> are using.

Can be argued. Still, uninitialized values look a little sloppy IMO. I
had a patch on top of this series to print the generated values as debug
output, and '0' looks much more intentional there.

> > Why don't we just drop the pointer and init the array directly?
> > 
> > 	struct i2c_timings t = {
> > 		.bus_freq_hz = ...
> > 		...
> > 	}
> 
> I can do it if you think it's better. I have no strong opinion here.
> From code prospective I guess it will be something similar anyway.

I like it better. Easier to read in the code, no need for a seperate
pointer. I can fix it locally here, though.

Thanks!

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-03-24  8:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 15:49 [PATCH v3 1/6] i2c: core: Provide generic definitions for bus frequencies Andy Shevchenko
2020-03-16 15:49 ` [PATCH v3 2/6] i2c: core: Allow override timing properties with 0 Andy Shevchenko
2020-03-20 14:43   ` Wolfram Sang
2020-03-20 16:23     ` Andy Shevchenko
2020-03-20 16:44       ` Wolfram Sang
2020-03-20 16:46         ` Andy Shevchenko
2020-03-16 15:49 ` [PATCH v3 3/6] i2c: rcar: Consolidate timings calls in rcar_i2c_clock_calculate() Andy Shevchenko
2020-03-23 21:54   ` Wolfram Sang
2020-03-23 22:03     ` Andy Shevchenko
2020-03-24  8:13       ` Wolfram Sang [this message]
2020-03-24  9:02         ` Andy Shevchenko
2020-03-24  9:15           ` Wolfram Sang
2020-03-16 15:49 ` [PATCH v3 4/6] i2c: stm32f7: switch to I²C generic property parsing Andy Shevchenko
2020-03-20  8:23   ` Alain Volmat
2020-03-20 10:30     ` Andy Shevchenko
2020-03-16 15:49 ` [PATCH v3 5/6] i2c: algo: Use generic definitions for bus frequencies Andy Shevchenko
2020-03-19 17:19 ` [PATCH v3 1/6] i2c: core: Provide " Andy Shevchenko
2020-03-20 14:45   ` Wolfram Sang
2020-03-20 16:23     ` Andy Shevchenko
     [not found] ` <20200316154929.20886-6-andriy.shevchenko@linux.intel.com>
2020-03-20 14:23   ` [PATCH v3 6/6] i2c: drivers: Use " Dmitry Osipenko

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=20200324081328.GA1134@ninjato \
    --to=wsa@the-dreams.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-i2c@vger.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 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.