aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamarth Parikh <samarthp@ymail.com>2014-07-16 06:44:37 -0400
committerBrian Norris <computersforpeace@gmail.com>2014-08-19 14:53:07 -0400
commit6f3c0f163103fb225c77b73ca17fc4ecea308103 (patch)
tree0a8c89ee85814c9d12f910e451bd3d71bf135fc6
parent2902330e7ac16d5962f114d92bb17631e9cb49e9 (diff)
mtd: Fixed checkpatch seq_printf warnings
Fixed checkpatch warnings: "WARNING: Prefer seq_puts to seq_printf" This patch is created with reference to the ongoing lkml thread https://lkml.org/lkml/2014/7/15/646 where Andrew Morton wrote: " - puts is presumably faster - puts doesn't go rogue if you accidentally pass it a "%". - this patch would actually make compiled object files few bytes smaller. Perhaps because seq_printf() is a varargs function, forcing the caller to pass args on the stack instead of in registers. " Signed-off-by: Samarth Parikh <samarthp@ymail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r--drivers/mtd/devices/docg3.c26
-rw-r--r--drivers/mtd/mtdswap.c4
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 91a169c44b39..21cc4b66feaa 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -1697,16 +1697,16 @@ static int dbg_asicmode_show(struct seq_file *s, void *p)
1697 1697
1698 switch (mode) { 1698 switch (mode) {
1699 case DOC_ASICMODE_RESET: 1699 case DOC_ASICMODE_RESET:
1700 pos += seq_printf(s, "reset"); 1700 pos += seq_puts(s, "reset");
1701 break; 1701 break;
1702 case DOC_ASICMODE_NORMAL: 1702 case DOC_ASICMODE_NORMAL:
1703 pos += seq_printf(s, "normal"); 1703 pos += seq_puts(s, "normal");
1704 break; 1704 break;
1705 case DOC_ASICMODE_POWERDOWN: 1705 case DOC_ASICMODE_POWERDOWN:
1706 pos += seq_printf(s, "powerdown"); 1706 pos += seq_puts(s, "powerdown");
1707 break; 1707 break;
1708 } 1708 }
1709 pos += seq_printf(s, ")\n"); 1709 pos += seq_puts(s, ")\n");
1710 return pos; 1710 return pos;
1711} 1711}
1712DEBUGFS_RO_ATTR(asic_mode, dbg_asicmode_show); 1712DEBUGFS_RO_ATTR(asic_mode, dbg_asicmode_show);
@@ -1745,22 +1745,22 @@ static int dbg_protection_show(struct seq_file *s, void *p)
1745 pos += seq_printf(s, "Protection = 0x%02x (", 1745 pos += seq_printf(s, "Protection = 0x%02x (",
1746 protect); 1746 protect);
1747 if (protect & DOC_PROTECT_FOUNDRY_OTP_LOCK) 1747 if (protect & DOC_PROTECT_FOUNDRY_OTP_LOCK)
1748 pos += seq_printf(s, "FOUNDRY_OTP_LOCK,"); 1748 pos += seq_puts(s, "FOUNDRY_OTP_LOCK,");
1749 if (protect & DOC_PROTECT_CUSTOMER_OTP_LOCK) 1749 if (protect & DOC_PROTECT_CUSTOMER_OTP_LOCK)
1750 pos += seq_printf(s, "CUSTOMER_OTP_LOCK,"); 1750 pos += seq_puts(s, "CUSTOMER_OTP_LOCK,");
1751 if (protect & DOC_PROTECT_LOCK_INPUT) 1751 if (protect & DOC_PROTECT_LOCK_INPUT)
1752 pos += seq_printf(s, "LOCK_INPUT,"); 1752 pos += seq_puts(s, "LOCK_INPUT,");
1753 if (protect & DOC_PROTECT_STICKY_LOCK) 1753 if (protect & DOC_PROTECT_STICKY_LOCK)
1754 pos += seq_printf(s, "STICKY_LOCK,"); 1754 pos += seq_puts(s, "STICKY_LOCK,");
1755 if (protect & DOC_PROTECT_PROTECTION_ENABLED) 1755 if (protect & DOC_PROTECT_PROTECTION_ENABLED)
1756 pos += seq_printf(s, "PROTECTION ON,"); 1756 pos += seq_puts(s, "PROTECTION ON,");
1757 if (protect & DOC_PROTECT_IPL_DOWNLOAD_LOCK) 1757 if (protect & DOC_PROTECT_IPL_DOWNLOAD_LOCK)
1758 pos += seq_printf(s, "IPL_DOWNLOAD_LOCK,"); 1758 pos += seq_puts(s, "IPL_DOWNLOAD_LOCK,");
1759 if (protect & DOC_PROTECT_PROTECTION_ERROR) 1759 if (protect & DOC_PROTECT_PROTECTION_ERROR)
1760 pos += seq_printf(s, "PROTECT_ERR,"); 1760 pos += seq_puts(s, "PROTECT_ERR,");
1761 else 1761 else
1762 pos += seq_printf(s, "NO_PROTECT_ERR"); 1762 pos += seq_puts(s, "NO_PROTECT_ERR");
1763 pos += seq_printf(s, ")\n"); 1763 pos += seq_puts(s, ")\n");
1764 1764
1765 pos += seq_printf(s, "DPS0 = 0x%02x : " 1765 pos += seq_printf(s, "DPS0 = 0x%02x : "
1766 "Protected area [0x%x - 0x%x] : OTP=%d, READ=%d, " 1766 "Protected area [0x%x - 0x%x] : OTP=%d, READ=%d, "
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
index 8b33b26eb12b..0ec96cd5dc78 100644
--- a/drivers/mtd/mtdswap.c
+++ b/drivers/mtd/mtdswap.c
@@ -1287,7 +1287,7 @@ static int mtdswap_show(struct seq_file *s, void *data)
1287 1287
1288 seq_printf(s, "total erasures: %lu\n", sum); 1288 seq_printf(s, "total erasures: %lu\n", sum);
1289 1289
1290 seq_printf(s, "\n"); 1290 seq_puts(s, "\n");
1291 1291
1292 seq_printf(s, "mtdswap_readsect count: %llu\n", d->sect_read_count); 1292 seq_printf(s, "mtdswap_readsect count: %llu\n", d->sect_read_count);
1293 seq_printf(s, "mtdswap_writesect count: %llu\n", d->sect_write_count); 1293 seq_printf(s, "mtdswap_writesect count: %llu\n", d->sect_write_count);
@@ -1296,7 +1296,7 @@ static int mtdswap_show(struct seq_file *s, void *data)
1296 seq_printf(s, "mtd write count: %llu\n", d->mtd_write_count); 1296 seq_printf(s, "mtd write count: %llu\n", d->mtd_write_count);
1297 seq_printf(s, "discarded pages count: %llu\n", d->discard_page_count); 1297 seq_printf(s, "discarded pages count: %llu\n", d->discard_page_count);
1298 1298
1299 seq_printf(s, "\n"); 1299 seq_puts(s, "\n");
1300 seq_printf(s, "total pages: %u\n", pages); 1300 seq_printf(s, "total pages: %u\n", pages);
1301 seq_printf(s, "pages mapped: %u\n", mapped); 1301 seq_printf(s, "pages mapped: %u\n", mapped);
1302 1302