Skip to contentSkip to conversation

mtd: m25p80.c: Use positive logic to check JEDEC id

PATCH Applied Axel Lin 2 participants 2 messages Jan 21, 2014 – Feb 11, 2014 Memory technology devices (MTD)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mtd: m25p80.c: Use positive logic to check JEDEC id

For slightly better readability.

---
 drivers/mtd/devices/m25p80.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mtd/devices/m25p80.c +2 -3
index d0f6475..3f7955f 100644
@@ -1061,9 +1061,8 @@ static const struct spi_device_id *jedec_probe(struct spi_device *spi)
 	for (tmp = 0; tmp < ARRAY_SIZE(m25p_ids) - 1; tmp++) {
 		info = (void *)m25p_ids[tmp].driver_data;
 		if (info->jedec_id == jedec) {
-			if (info->ext_id != 0 && info->ext_id != ext_jedec)
-				continue;
-			return &m25p_ids[tmp];
+			if (info->ext_id == 0 || info->ext_id == ext_jedec)
+				return &m25p_ids[tmp];
 		}
 	}
 	dev_err(&spi->dev, "unrecognized JEDEC id %06x\n", jedec);
Signature · 1 line
1.8.1.2