Skip to content

Commit 5350f6e

Browse files
andy-shevmiquelraynal
authored andcommitted
mtd: cfi: Get rid of redundant 'else'
In the snippets like the following if (...) return / goto / break / continue ...; else ... the 'else' is redundant. Get rid of it. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Jeff Johnson <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 1613e60 commit 5350f6e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

include/linux/mtd/cfi.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -308,32 +308,32 @@ static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr)
308308
{
309309
map_word val = map_read(map, addr);
310310

311-
if (map_bankwidth_is_1(map)) {
311+
if (map_bankwidth_is_1(map))
312312
return val.x[0];
313-
} else if (map_bankwidth_is_2(map)) {
313+
if (map_bankwidth_is_2(map))
314314
return cfi16_to_cpu(map, val.x[0]);
315-
} else {
316-
/* No point in a 64-bit byteswap since that would just be
317-
swapping the responses from different chips, and we are
318-
only interested in one chip (a representative sample) */
319-
return cfi32_to_cpu(map, val.x[0]);
320-
}
315+
/*
316+
* No point in a 64-bit byteswap since that would just be
317+
* swapping the responses from different chips, and we are
318+
* only interested in one chip (a representative sample)
319+
*/
320+
return cfi32_to_cpu(map, val.x[0]);
321321
}
322322

323323
static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr)
324324
{
325325
map_word val = map_read(map, addr);
326326

327-
if (map_bankwidth_is_1(map)) {
327+
if (map_bankwidth_is_1(map))
328328
return val.x[0] & 0xff;
329-
} else if (map_bankwidth_is_2(map)) {
329+
if (map_bankwidth_is_2(map))
330330
return cfi16_to_cpu(map, val.x[0]);
331-
} else {
332-
/* No point in a 64-bit byteswap since that would just be
333-
swapping the responses from different chips, and we are
334-
only interested in one chip (a representative sample) */
335-
return cfi32_to_cpu(map, val.x[0]);
336-
}
331+
/*
332+
* No point in a 64-bit byteswap since that would just be
333+
* swapping the responses from different chips, and we are
334+
* only interested in one chip (a representative sample)
335+
*/
336+
return cfi32_to_cpu(map, val.x[0]);
337337
}
338338

339339
void cfi_udelay(int us);

0 commit comments

Comments
 (0)