[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b35d8f6-6ff8-9bf3-02bd-434cf46acccb@microchip.com>
Date: Mon, 15 Mar 2021 09:39:43 +0000
From: <Tudor.Ambarus@...rochip.com>
To: <michael@...le.cc>, <vigneshr@...com>
CC: <linux-mtd@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<miquel.raynal@...tlin.com>, <richard@....at>
Subject: Re: [PATCH v4 1/4] mtd: spi-nor: add OTP support
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@...le.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
Powered by blists - more mailing lists