diff mbox series

[v2,4/6] mtd: spi-nor: Make the enable argument passed to set_byte() a bool

Message ID 20181129141026.24892-5-boris.brezillon@bootlin.com
State Superseded
Headers show
Series mtd: spi-nor: Random cleanups | expand

Commit Message

Boris Brezillon Nov. 29, 2018, 2:10 p.m. UTC
No need to use an integer when the value is either true or false.
Make it a boolean.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
Changes in v2:
- None
---
 drivers/mtd/spi-nor/spi-nor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Tudor Ambarus Dec. 4, 2018, 7:38 p.m. UTC | #1
On 11/29/2018 04:10 PM, Boris Brezillon wrote:
> No need to use an integer when the value is either true or false.
> Make it a boolean.
> 
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>

> ---
> Changes in v2:
> - None
> ---
>  drivers/mtd/spi-nor/spi-nor.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
> index 6da50684f303..ed1d7ad2dcbb 100644
> --- a/drivers/mtd/spi-nor/spi-nor.c
> +++ b/drivers/mtd/spi-nor/spi-nor.c
> @@ -274,7 +274,7 @@ static void spi_nor_set_4byte_opcodes(struct spi_nor *nor,
>  }
>  
>  /* Enable/disable 4-byte addressing mode. */
> -static int set_4byte(struct spi_nor *nor, int enable)
> +static int set_4byte(struct spi_nor *nor, bool enable)
>  {
>  	int status;
>  	bool need_wren = false;
> @@ -3573,7 +3573,7 @@ static int spi_nor_init(struct spi_nor *nor)
>  		 */
>  		WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET,
>  			  "enabling reset hack; may not recover from unexpected reboots\n");
> -		set_4byte(nor, 1);
> +		set_4byte(nor, true);
>  	}
>  
>  	return 0;
> @@ -3599,7 +3599,7 @@ void spi_nor_restore(struct spi_nor *nor)
>  	    (JEDEC_MFR(nor->info) != SNOR_MFR_SPANSION) &&
>  	    !(nor->info->flags & SPI_NOR_4B_OPCODES) &&
>  	    (nor->flags & SNOR_F_BROKEN_RESET))
> -		set_4byte(nor, 0);
> +		set_4byte(nor, false);
>  }
>  EXPORT_SYMBOL_GPL(spi_nor_restore);
>  
>
diff mbox series

Patch

diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 6da50684f303..ed1d7ad2dcbb 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -274,7 +274,7 @@  static void spi_nor_set_4byte_opcodes(struct spi_nor *nor,
 }
 
 /* Enable/disable 4-byte addressing mode. */
-static int set_4byte(struct spi_nor *nor, int enable)
+static int set_4byte(struct spi_nor *nor, bool enable)
 {
 	int status;
 	bool need_wren = false;
@@ -3573,7 +3573,7 @@  static int spi_nor_init(struct spi_nor *nor)
 		 */
 		WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET,
 			  "enabling reset hack; may not recover from unexpected reboots\n");
-		set_4byte(nor, 1);
+		set_4byte(nor, true);
 	}
 
 	return 0;
@@ -3599,7 +3599,7 @@  void spi_nor_restore(struct spi_nor *nor)
 	    (JEDEC_MFR(nor->info) != SNOR_MFR_SPANSION) &&
 	    !(nor->info->flags & SPI_NOR_4B_OPCODES) &&
 	    (nor->flags & SNOR_F_BROKEN_RESET))
-		set_4byte(nor, 0);
+		set_4byte(nor, false);
 }
 EXPORT_SYMBOL_GPL(spi_nor_restore);