diff options
author | Azeem Shaikh <azeemshaikh38@gmail.com> | 2023-06-14 16:37:57 +0300 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2023-06-17 20:18:07 +0300 |
commit | a9156d7e7d6a811a0ac1a2bc9ab6006bb928e871 (patch) | |
tree | 62570fdca13ad0877ece482eb5298e9ebd08fce3 /net | |
parent | 6c53da5d66b1f0d30b1039e14eed943efe377805 (diff) | |
download | linux-a9156d7e7d6a811a0ac1a2bc9ab6006bb928e871.tar.xz |
SUNRPC: Use sysfs_emit in place of strlcpy/sprintf
Part of an effort to remove strlcpy() tree-wide [1].
Direct replacement is safe here since the getter in kernel_params_ops
handles -errno return [2].
[1] https://github.com/KSPP/linux/issues/89
[2] https://elixir.bootlin.com/linux/v6.4-rc6/source/include/linux/moduleparam.h#L52
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index e6d4cec61e47..b011c318fef1 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -109,15 +109,15 @@ param_get_pool_mode(char *buf, const struct kernel_param *kp) switch (*ip) { case SVC_POOL_AUTO: - return strlcpy(buf, "auto\n", 20); + return sysfs_emit(buf, "auto\n"); case SVC_POOL_GLOBAL: - return strlcpy(buf, "global\n", 20); + return sysfs_emit(buf, "global\n"); case SVC_POOL_PERCPU: - return strlcpy(buf, "percpu\n", 20); + return sysfs_emit(buf, "percpu\n"); case SVC_POOL_PERNODE: - return strlcpy(buf, "pernode\n", 20); + return sysfs_emit(buf, "pernode\n"); default: - return sprintf(buf, "%d\n", *ip); + return sysfs_emit(buf, "%d\n", *ip); } } |