[PATCH v2 2/2] mtd: spi-nor: Move condition to avoid a NULL check

Tudor.Ambarus at microchip.com Tudor.Ambarus at microchip.com
Mon Nov 11 11:28:13 PST 2019



On 10/25/2019 05:28 PM, Tudor Ambarus - M18064 wrote:
> From: Tudor Ambarus <tudor.ambarus at microchip.com>
> 
> When the controller is not under the SPI-MEM interface it may implement
> the optional controller_ops->erase() method.
> 
> nor->spimem and nor->controller_ops are mutual exclusive. Move the
> nor->controller_ops->erase != NULL check as an 'else if' case to
> nor->spimem, in order to avoid the nor->controller_ops != NULL
> check.
> 
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
> Signed-off-by: Tudor Ambarus <tudor.ambarus at microchip.com>
> ---
> v2: add Reported-by tag, amend commit description.
> 
>  drivers/mtd/spi-nor/spi-nor.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Amended commit description, s/mutual/mutually. Patch applied to spi-nor/next.


More information about the linux-mtd mailing list