mtd/m25p80: retlen is never NULL

This is just a cleanup, it doesn't fix any bugs.

These functions all check retlen inconsistently and it generates a
warning in Smatch (http://smatch.sf.net). If retlen were ever NULL it
would cause an oops and the code has been this way since 2006 so someone
would have complained. Also I looked at other places that implemented
the mtd read and write functions and they dereference retlen without
checking.

I removed the checks.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

authored by Dan Carpenter and committed by David Woodhouse b06cd21e d2b5bbef

+4 -8
+4 -8
drivers/mtd/devices/m25p80.c
··· 347 spi_message_add_tail(&t[1], &m); 348 349 /* Byte count starts at zero. */ 350 - if (retlen) 351 - *retlen = 0; 352 353 mutex_lock(&flash->lock); 354 ··· 393 dev_name(&flash->spi->dev), __func__, "to", 394 (u32)to, len); 395 396 - if (retlen) 397 - *retlen = 0; 398 399 /* sanity checks */ 400 if (!len) ··· 464 465 spi_sync(flash->spi, &m); 466 467 - if (retlen) 468 - *retlen += m.actual_length - m25p_cmdsz(flash); 469 } 470 } 471 ··· 482 size_t actual; 483 int cmd_sz, ret; 484 485 - if (retlen) 486 - *retlen = 0; 487 488 /* sanity checks */ 489 if (!len)
··· 347 spi_message_add_tail(&t[1], &m); 348 349 /* Byte count starts at zero. */ 350 + *retlen = 0; 351 352 mutex_lock(&flash->lock); 353 ··· 394 dev_name(&flash->spi->dev), __func__, "to", 395 (u32)to, len); 396 397 + *retlen = 0; 398 399 /* sanity checks */ 400 if (!len) ··· 466 467 spi_sync(flash->spi, &m); 468 469 + *retlen += m.actual_length - m25p_cmdsz(flash); 470 } 471 } 472 ··· 485 size_t actual; 486 int cmd_sz, ret; 487 488 + *retlen = 0; 489 490 /* sanity checks */ 491 if (!len)