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

Configure Feed

Select the types of activity you want to include in your feed.

crypto: omap - Use sysfs_emit in sysfs show functions

Replace sprintf() with sysfs_emit() in sysfs show functions.
sysfs_emit() is preferred to format sysfs output as it provides better
bounds checking. No functional changes.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thorsten Blum and committed by
Herbert Xu
279b837c c66e0a27

+5 -3
+2 -1
drivers/crypto/omap-aes.c
··· 32 32 #include <linux/pm_runtime.h> 33 33 #include <linux/scatterlist.h> 34 34 #include <linux/string.h> 35 + #include <linux/sysfs.h> 35 36 #include <linux/workqueue.h> 36 37 37 38 #include "omap-crypto.h" ··· 1043 1042 { 1044 1043 struct omap_aes_dev *dd = dev_get_drvdata(dev); 1045 1044 1046 - return sprintf(buf, "%d\n", dd->engine->queue.max_qlen); 1045 + return sysfs_emit(buf, "%d\n", dd->engine->queue.max_qlen); 1047 1046 } 1048 1047 1049 1048 static ssize_t queue_len_store(struct device *dev,
+3 -2
drivers/crypto/omap-sham.c
··· 37 37 #include <linux/scatterlist.h> 38 38 #include <linux/slab.h> 39 39 #include <linux/string.h> 40 + #include <linux/sysfs.h> 40 41 #include <linux/workqueue.h> 41 42 42 43 #define MD5_DIGEST_SIZE 16 ··· 1974 1973 { 1975 1974 struct omap_sham_dev *dd = dev_get_drvdata(dev); 1976 1975 1977 - return sprintf(buf, "%d\n", dd->fallback_sz); 1976 + return sysfs_emit(buf, "%d\n", dd->fallback_sz); 1978 1977 } 1979 1978 1980 1979 static ssize_t fallback_store(struct device *dev, struct device_attribute *attr, ··· 2004 2003 { 2005 2004 struct omap_sham_dev *dd = dev_get_drvdata(dev); 2006 2005 2007 - return sprintf(buf, "%d\n", dd->queue.max_qlen); 2006 + return sysfs_emit(buf, "%d\n", dd->queue.max_qlen); 2008 2007 } 2009 2008 2010 2009 static ssize_t queue_len_store(struct device *dev,