Re: [PATCH 6/7] mtd: spi-nor: Rework the SPI NOR lock/unlock logic
From: Vignesh Raghavendra
Date: Mon Aug 05 2019 - 07:29:50 EST
On 05/08/19 1:30 PM, Tudor.Ambarus@xxxxxxxxxxxxx wrote:
>>
>> On 31-Jul-19 2:33 PM, Tudor.Ambarus@xxxxxxxxxxxxx wrote:
>>> From: Boris Brezillon <boris.brezillon@xxxxxxxxxxx>
>>>
>>> Move the locking hooks in a separate struct so that we have just
>>> one field to update when we change the locking implementation.
>>>
>>> stm_locking_ops, the legacy locking operations, can be overwritten
>>> later on by implementing manufacturer specific default_init() hooks.
>>>
>>> Signed-off-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxx>
>>> [tudor.ambarus@xxxxxxxxxxxxx: use ->default_init() hook]
>>> Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxxxxx>
>>
>> [...]
[...]
>>>
>>> +/**
>>> + * struct spi_nor_locking_ops - SPI NOR locking methods
>>> + * @lock: lock a region of the SPI NOR
>>> + * @unlock: unlock a region of the SPI NOR
>>> + * @is_locked: check if a region of the SPI NOR is completely locked
>>> + */
>>> +struct spi_nor_locking_ops {
>>> + int (*lock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
>>> + int (*unlock)(struct spi_nor *nor, loff_t ofs, uint64_t len);
>>> + int (*is_locked)(struct spi_nor *nor, loff_t ofs, uint64_t len);
>>
>> checkpatch does not like uint64_t. Please changes these to size_t
>
> This respects what struct mtd_info is expecting:
>
> int (*_lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
> int (*_unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
> int (*_is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len);
>
> I haven't seen the warnings, would you mind pasting them?
> ./scripts/checkpatch.pl --strict 6-7-mtd-spi-nor-Rework-the-SPI-NOR-lock-unlock-logic.patch
> total: 0 errors, 0 warnings, 0 checks, 102 lines checked
>
> 6-7-mtd-spi-nor-Rework-the-SPI-NOR-lock-unlock-logic.patch has no obvious style problems and is ready for submission.
>
Hmm, seems to be emitted only for certain type of declarations. Not sure
whats the pattern here. Warning is something like:
CHECK: Prefer kernel type 'u64' over 'uint64_t'
from: https://elixir.bootlin.com/linux/latest/source/scripts/checkpatch.pl#L5906
--
Regards
Vignesh