All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Tudor.Ambarus@microchip.com>
To: <michael@walle.cc>, <vigneshr@ti.com>
Cc: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<miquel.raynal@bootlin.com>, <richard@nod.at>
Subject: Re: [PATCH v4 1/4] mtd: spi-nor: add OTP support
Date: Mon, 15 Mar 2021 09:39:43 +0000	[thread overview]
Message-ID: <8b35d8f6-6ff8-9bf3-02bd-434cf46acccb@microchip.com> (raw)
In-Reply-To: <b83dbbcdee6bdeee0d494ba79fd792e4@walle.cc>

On 3/15/21 11:23 AM, Michael Walle wrote:

cut

>>> diff --git a/drivers/mtd/spi-nor/otp.c b/drivers/mtd/spi-nor/otp.c
>>> new file mode 100644
>>> index 000000000000..4e301fd5156b
>>> --- /dev/null
>>> +++ b/drivers/mtd/spi-nor/otp.c
>>> @@ -0,0 +1,218 @@
>>> +// SPDX-License-Identifier: GPL-2.0
>>> +/*
>>> + * OTP support for SPI NOR flashes
>>> + *
>>> + * Copyright (C) 2021 Michael Walle <michael@walle.cc>> + */
>>> +
>>> +#include <linux/log2.h>
>>> +#include <linux/mtd/mtd.h>
>>> +#include <linux/mtd/spi-nor.h>
>>> +
>>> +#include "core.h"
>>> +
>>> +#define spi_nor_otp_ops(nor) ((nor)->params->otp.ops)
>>> +#define spi_nor_otp_region_len(nor) ((nor)->params->otp.org->len)
>>> +#define spi_nor_otp_n_regions(nor)
>>> ((nor)->params->otp.org->n_regions)
>>
>> I don't like these wrappers because they gratuiously hide what's really
>> there.
>> I find the code more easier to read without these wrappers, because I
>> don't
>> have to memorize what these wrappers are doing, and I better see how
>> the code
>> is organized.
> 
> TBH I find it easier on the eye and I've never seen so much dereferences
> as in mtd/spi-nor.

It's what I prefer, but it's not a hard requirement. Would you please check
for a second opinion with Vignesh? Inquire about the helpers too. Then do as
you find best.

Cheers,
ta

WARNING: multiple messages have this Message-ID (diff)
From: <Tudor.Ambarus@microchip.com>
To: <michael@walle.cc>, <vigneshr@ti.com>
Cc: <linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<miquel.raynal@bootlin.com>, <richard@nod.at>
Subject: Re: [PATCH v4 1/4] mtd: spi-nor: add OTP support
Date: Mon, 15 Mar 2021 09:39:43 +0000	[thread overview]
Message-ID: <8b35d8f6-6ff8-9bf3-02bd-434cf46acccb@microchip.com> (raw)
In-Reply-To: <b83dbbcdee6bdeee0d494ba79fd792e4@walle.cc>

On 3/15/21 11:23 AM, Michael Walle wrote:

cut

>>> diff --git a/drivers/mtd/spi-nor/otp.c b/drivers/mtd/spi-nor/otp.c
>>> new file mode 100644
>>> index 000000000000..4e301fd5156b
>>> --- /dev/null
>>> +++ b/drivers/mtd/spi-nor/otp.c
>>> @@ -0,0 +1,218 @@
>>> +// SPDX-License-Identifier: GPL-2.0
>>> +/*
>>> + * OTP support for SPI NOR flashes
>>> + *
>>> + * Copyright (C) 2021 Michael Walle <michael@walle.cc>> + */
>>> +
>>> +#include <linux/log2.h>
>>> +#include <linux/mtd/mtd.h>
>>> +#include <linux/mtd/spi-nor.h>
>>> +
>>> +#include "core.h"
>>> +
>>> +#define spi_nor_otp_ops(nor) ((nor)->params->otp.ops)
>>> +#define spi_nor_otp_region_len(nor) ((nor)->params->otp.org->len)
>>> +#define spi_nor_otp_n_regions(nor)
>>> ((nor)->params->otp.org->n_regions)
>>
>> I don't like these wrappers because they gratuiously hide what's really
>> there.
>> I find the code more easier to read without these wrappers, because I
>> don't
>> have to memorize what these wrappers are doing, and I better see how
>> the code
>> is organized.
> 
> TBH I find it easier on the eye and I've never seen so much dereferences
> as in mtd/spi-nor.

It's what I prefer, but it's not a hard requirement. Would you please check
for a second opinion with Vignesh? Inquire about the helpers too. Then do as
you find best.

Cheers,
ta
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2021-03-15  9:40 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-06  0:05 [PATCH v4 0/4] mtd: spi-nor: OTP support Michael Walle
2021-03-06  0:05 ` Michael Walle
2021-03-06  0:05 ` [PATCH v4 1/4] mtd: spi-nor: add " Michael Walle
2021-03-06  0:05   ` Michael Walle
2021-03-15  7:28   ` Tudor.Ambarus
2021-03-15  7:28     ` Tudor.Ambarus
2021-03-15  9:23     ` Michael Walle
2021-03-15  9:23       ` Michael Walle
2021-03-15  9:39       ` Tudor.Ambarus [this message]
2021-03-15  9:39         ` Tudor.Ambarus
2021-03-15  9:44         ` Tudor.Ambarus
2021-03-15  9:44           ` Tudor.Ambarus
2021-03-15 10:01           ` Michael Walle
2021-03-15 10:01             ` Michael Walle
2021-03-06  0:05 ` [PATCH v4 2/4] mtd: spi-nor: implement OTP support for Winbond and similar flashes Michael Walle
2021-03-06  0:05   ` Michael Walle
2021-03-15  8:20   ` Tudor.Ambarus
2021-03-15  8:20     ` Tudor.Ambarus
2021-03-15 10:29     ` Michael Walle
2021-03-15 10:29       ` Michael Walle
2021-03-15  8:31   ` Tudor.Ambarus
2021-03-15  8:31     ` Tudor.Ambarus
2021-03-15 10:43     ` Michael Walle
2021-03-15 10:43       ` Michael Walle
2021-03-06  0:05 ` [PATCH v4 3/4] mtd: spi-nor: winbond: add OTP support to w25q32fw/jw Michael Walle
2021-03-06  0:05   ` Michael Walle
2021-03-15  8:26   ` Tudor.Ambarus
2021-03-15  8:26     ` Tudor.Ambarus
2021-03-15  9:26     ` Michael Walle
2021-03-15  9:26       ` Michael Walle
2021-03-15  9:34       ` Tudor.Ambarus
2021-03-15  9:34         ` Tudor.Ambarus
2021-03-06  0:05 ` [PATCH v4 4/4] mtd: spi-nor: implement OTP erase for Winbond and similar flashes Michael Walle
2021-03-06  0:05   ` Michael Walle
2021-03-06  0:20   ` Michael Walle
2021-03-06  0:20     ` Michael Walle
2021-03-07  8:48   ` kernel test robot
2021-03-07  8:48     ` kernel test robot
2021-03-07  8:48     ` kernel test robot
2021-03-15  8:42   ` Tudor.Ambarus
2021-03-15  8:42     ` Tudor.Ambarus

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=8b35d8f6-6ff8-9bf3-02bd-434cf46acccb@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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.