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: octeontx2 - Use sysfs_emit in sysfs show functions

Replace sprintf() with sysfs_emit() in sso_pf_func_ovrd_show() and
kvf_limits_show(). sysfs_emit() is preferred for formatting sysfs output
as it performs proper 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
37b03cb3 bce4678f

+3 -2
+3 -2
drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
··· 2 2 /* Copyright (C) 2020 Marvell. */ 3 3 4 4 #include <linux/firmware.h> 5 + #include <linux/sysfs.h> 5 6 #include "otx2_cpt_hw_types.h" 6 7 #include "otx2_cpt_common.h" 7 8 #include "otx2_cpt_devlink.h" ··· 508 507 { 509 508 struct otx2_cptpf_dev *cptpf = dev_get_drvdata(dev); 510 509 511 - return sprintf(buf, "%d\n", cptpf->sso_pf_func_ovrd); 510 + return sysfs_emit(buf, "%d\n", cptpf->sso_pf_func_ovrd); 512 511 } 513 512 514 513 static ssize_t sso_pf_func_ovrd_store(struct device *dev, ··· 534 533 { 535 534 struct otx2_cptpf_dev *cptpf = dev_get_drvdata(dev); 536 535 537 - return sprintf(buf, "%d\n", cptpf->kvf_limits); 536 + return sysfs_emit(buf, "%d\n", cptpf->kvf_limits); 538 537 } 539 538 540 539 static ssize_t kvf_limits_store(struct device *dev,