Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20240503184230.2927283-1-andriy.shevchenko@linux.intel.com

authored by

Andy Shevchenko and committed by
Miquel Raynal
5350f6ec 1613e604

+16 -16
+16 -16
include/linux/mtd/cfi.h
··· 308 308 { 309 309 map_word val = map_read(map, addr); 310 310 311 - if (map_bankwidth_is_1(map)) { 311 + if (map_bankwidth_is_1(map)) 312 312 return val.x[0]; 313 - } else if (map_bankwidth_is_2(map)) { 313 + if (map_bankwidth_is_2(map)) 314 314 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]); 321 321 } 322 322 323 323 static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr) 324 324 { 325 325 map_word val = map_read(map, addr); 326 326 327 - if (map_bankwidth_is_1(map)) { 327 + if (map_bankwidth_is_1(map)) 328 328 return val.x[0] & 0xff; 329 - } else if (map_bankwidth_is_2(map)) { 329 + if (map_bankwidth_is_2(map)) 330 330 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]); 337 337 } 338 338 339 339 void cfi_udelay(int us);