[PATCH 07/19] mtd: spi-nor: swp: Clarify a comment

Miquel Raynal posted 19 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH 07/19] mtd: spi-nor: swp: Clarify a comment
Posted by Miquel Raynal 2 months, 3 weeks ago
The comment states that all power of two sizes are not supported. This
is very device dependent (based on the size), so modulate a bit the
sentence to make it more accurate.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/mtd/spi-nor/swp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/swp.c b/drivers/mtd/spi-nor/swp.c
index ede03f26de3c65ff53c1cb888c2c43aea268b85a..350fb8cd67dbafa3c62201c8c06bff7131143c04 100644
--- a/drivers/mtd/spi-nor/swp.c
+++ b/drivers/mtd/spi-nor/swp.c
@@ -298,7 +298,7 @@ static int spi_nor_sr_unlock(struct spi_nor *nor, loff_t ofs, u64 len)
 		if (nor->flags & SNOR_F_HAS_SR_BP3_BIT6 && val & SR_BP3)
 			val = (val & ~SR_BP3) | SR_BP3_BIT6;
 
-		/* Some power-of-two sizes are not supported */
+		/* Some power-of-two sizes may not be supported */
 		if (val & ~mask)
 			return -EINVAL;
 	}

-- 
2.51.0
Re: [PATCH 07/19] mtd: spi-nor: swp: Clarify a comment
Posted by Michael Walle 2 months, 3 weeks ago
On Fri Nov 14, 2025 at 6:53 PM CET, Miquel Raynal wrote:
> The comment states that all power of two sizes are not supported. This

No it says "some power-of-two". That's clearly not all :)

I'm fine with either:
Reviewed-by: Michael Walle <mwalle@kernel.org>

-michael

> is very device dependent (based on the size), so modulate a bit the
> sentence to make it more accurate.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  drivers/mtd/spi-nor/swp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/spi-nor/swp.c b/drivers/mtd/spi-nor/swp.c
> index ede03f26de3c65ff53c1cb888c2c43aea268b85a..350fb8cd67dbafa3c62201c8c06bff7131143c04 100644
> --- a/drivers/mtd/spi-nor/swp.c
> +++ b/drivers/mtd/spi-nor/swp.c
> @@ -298,7 +298,7 @@ static int spi_nor_sr_unlock(struct spi_nor *nor, loff_t ofs, u64 len)
>  		if (nor->flags & SNOR_F_HAS_SR_BP3_BIT6 && val & SR_BP3)
>  			val = (val & ~SR_BP3) | SR_BP3_BIT6;
>  
> -		/* Some power-of-two sizes are not supported */
> +		/* Some power-of-two sizes may not be supported */
>  		if (val & ~mask)
>  			return -EINVAL;
>  	}

Re: [PATCH 07/19] mtd: spi-nor: swp: Clarify a comment
Posted by Miquel Raynal 2 months, 3 weeks ago
On 18/11/2025 at 10:55:58 +01, "Michael Walle" <mwalle@kernel.org> wrote:

> On Fri Nov 14, 2025 at 6:53 PM CET, Miquel Raynal wrote:
>> The comment states that all power of two sizes are not supported. This
>
> No it says "some power-of-two". That's clearly not all :)

Ah crap, I failed at replicating the comment here. Well, the change I
believe is still correct but the commit is indeed wrong, I'll fix it.

> I'm fine with either:
> Reviewed-by: Michael Walle <mwalle@kernel.org>

Thanks,
Miquèl