summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiba Prasad <sibap@codeaurora.org>2017-05-10 18:37:49 +0530
committerSiba Prasad <sibap@codeaurora.org>2017-05-10 20:17:19 +0530
commite14f225493d709e0946ff6206a782cac51c1bbf7 (patch)
tree1b33673eba7bda931e3ada801d18fb3cb2fba09f
parent3d82d66409abb91539bcb9d1f343fcb9d583f2b4 (diff)
mmc: core: Replacing sprintf() with snprintf()
While using the sysfs entry for getting the different bit values of EXT_CSD register, it is returned by sprintf(). But sprintf() has been deprecated, that's why replace with safe function snprintf(). By using this patch, PAGE_SIZE(4Kb) is the max number of characters store in a buffer. Change-Id: Ifb3dc39e8d3728094fff10c7e761dc19fdfaa854 Signed-off-by: Siba Prasad <sibap@codeaurora.org>
-rw-r--r--drivers/mmc/core/bus.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/core/bus.h b/drivers/mmc/core/bus.h
index 00a19710b6b4..3f3f24b2a757 100644
--- a/drivers/mmc/core/bus.h
+++ b/drivers/mmc/core/bus.h
@@ -15,7 +15,7 @@
static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \
{ \
struct mmc_card *card = mmc_dev_to_card(dev); \
- return sprintf(buf, fmt, args); \
+ return snprintf(buf, PAGE_SIZE, fmt, args); \
} \
static DEVICE_ATTR(name, S_IRUGO, mmc_##name##_show, NULL)