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

at25: fix debug and error messaging

The patch does the following:
- fixes specifiers and removes explicit casting of the parameters
- joins literals to one line
- increases readability of the parameters

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
3936e4c8 13decfb4

+7 -13
+7 -13
drivers/misc/eeprom/at25.c
··· 121 121 * this chip is clocked very slowly 122 122 */ 123 123 status = spi_sync(at25->spi, &m); 124 - dev_dbg(&at25->spi->dev, 125 - "read %Zd bytes at %d --> %d\n", 126 - count, offset, (int) status); 124 + dev_dbg(&at25->spi->dev, "read %zu bytes at %d --> %zd\n", 125 + count, offset, status); 127 126 128 127 mutex_unlock(&at25->lock); 129 128 return status; ··· 166 167 *cp = AT25_WREN; 167 168 status = spi_write(at25->spi, cp, 1); 168 169 if (status < 0) { 169 - dev_dbg(&at25->spi->dev, "WREN --> %d\n", 170 - (int) status); 170 + dev_dbg(&at25->spi->dev, "WREN --> %d\n", status); 171 171 break; 172 172 } 173 173 ··· 194 196 memcpy(cp, buf, segment); 195 197 status = spi_write(at25->spi, bounce, 196 198 segment + at25->addrlen + 1); 197 - dev_dbg(&at25->spi->dev, 198 - "write %u bytes at %u --> %d\n", 199 - segment, offset, (int) status); 199 + dev_dbg(&at25->spi->dev, "write %u bytes at %u --> %d\n", 200 + segment, offset, status); 200 201 if (status < 0) 201 202 break; 202 203 ··· 222 225 223 226 if ((sr < 0) || (sr & AT25_SR_nRDY)) { 224 227 dev_err(&at25->spi->dev, 225 - "write %d bytes offset %d, " 226 - "timeout after %u msecs\n", 228 + "write %u bytes offset %u, timeout after %u msecs\n", 227 229 segment, offset, 228 230 jiffies_to_msecs(jiffies - 229 231 (timeout - EE_TIMEOUT))); ··· 364 368 return PTR_ERR(at25->nvmem); 365 369 366 370 dev_info(&spi->dev, "%d %s %s eeprom%s, pagesize %u\n", 367 - (chip.byte_len < 1024) 368 - ? chip.byte_len 369 - : (chip.byte_len / 1024), 371 + (chip.byte_len < 1024) ? chip.byte_len : (chip.byte_len / 1024), 370 372 (chip.byte_len < 1024) ? "Byte" : "KByte", 371 373 at25->chip.name, 372 374 (chip.flags & EE_READONLY) ? " (readonly)" : "",