From af1dfc98739bbd0a632fdb61ec07858b6ddabe95 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Tue, 12 May 2020 14:57:00 +0000 Subject: [PATCH] iscsi-scst: Remove unnecessary %s format modifiers See also https://github.com/bvanassche/scst/pull/18. Signed-off-by: Konstantin Kharlamov git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8903 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/config.c | 8 ++++---- iscsi-scst/kernel/conn.c | 2 +- iscsi-scst/kernel/param.c | 4 ++-- iscsi-scst/usr/event.c | 2 +- iscsi-scst/usr/param.c | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/iscsi-scst/kernel/config.c b/iscsi-scst/kernel/config.c index f6c2628c3..f3a574934 100644 --- a/iscsi-scst/kernel/config.c +++ b/iscsi-scst/kernel/config.c @@ -59,16 +59,16 @@ static ssize_t iscsi_open_state_show(struct kobject *kobj, { switch (ctr_open_state) { case ISCSI_CTR_OPEN_STATE_CLOSED: - sprintf(buf, "%s\n", "closed"); + sprintf(buf, "closed\n"); break; case ISCSI_CTR_OPEN_STATE_OPEN: - sprintf(buf, "%s\n", "open"); + sprintf(buf, "open\n"); break; case ISCSI_CTR_OPEN_STATE_CLOSING: - sprintf(buf, "%s\n", "closing"); + sprintf(buf, "closing\n"); break; default: - sprintf(buf, "%s\n", "unknown"); + sprintf(buf, "unknown\n"); break; } diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index 7e6a96611..640da52e7 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -39,7 +39,7 @@ static int print_conn_state(char *p, size_t size, struct iscsi_conn *conn) int pos = 0; if (conn->closing) { - pos += scnprintf(p, size, "%s", "closing"); + pos += scnprintf(p, size, "closing"); goto out; } diff --git a/iscsi-scst/kernel/param.c b/iscsi-scst/kernel/param.c index 682cf625e..77b1a82fb 100644 --- a/iscsi-scst/kernel/param.c +++ b/iscsi-scst/kernel/param.c @@ -66,14 +66,14 @@ const char *iscsi_get_digest_name(int val, char *res) int pos = 0; if (val & DIGEST_NONE) - pos = sprintf(&res[pos], "%s", "None"); + pos = sprintf(&res[pos], "None"); if (val & DIGEST_CRC32C) pos += sprintf(&res[pos], "%s%s", (pos != 0) ? ", " : "", "CRC32C"); if (pos == 0) - sprintf(&res[pos], "%s", "Unknown"); + sprintf(&res[pos], "Unknown"); return res; } diff --git a/iscsi-scst/usr/event.c b/iscsi-scst/usr/event.c index 0624613dc..61cb13205 100644 --- a/iscsi-scst/usr/event.c +++ b/iscsi-scst/usr/event.c @@ -624,7 +624,7 @@ static int handle_e_get_attr_value(int fd, const struct iscsi_kern_event *event) isns_access_control ? ISCSI_ISNS_SYSFS_ACCESS_CONTROL_ENABLED : ""); add_key_mark(res_str, sizeof(res_str), 0); } else - snprintf(res_str, sizeof(res_str), "%s\n", ""); + snprintf(res_str, sizeof(res_str), "\n"); } else if (strcasecmp(ISCSI_ISNS_ENTITY_ATTR_NAME, pp) == 0) { if (target != NULL) { log_error("Not NULL target %s for global attribute %s", diff --git a/iscsi-scst/usr/param.c b/iscsi-scst/usr/param.c index 463fc92a3..acdcd248e 100644 --- a/iscsi-scst/usr/param.c +++ b/iscsi-scst/usr/param.c @@ -181,7 +181,7 @@ static int digest_val_to_str(unsigned int val, char *str, int len) if (val & DIGEST_NONE) { len -= pos; - pos = snprintf(&str[pos], len, "%s", "None"); + pos = snprintf(&str[pos], len, "None"); } if (pos >= len) @@ -197,7 +197,7 @@ static int digest_val_to_str(unsigned int val, char *str, int len) goto out; if (pos == 0) - pos = snprintf(&str[0], len, "%s", "Unknown"); + pos = snprintf(&str[0], len, "Unknown"); out: return 0;