Replace snprintf("%s", ...) with the faster and more direct strscpy().
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
#include <linux/fs.h>
#include <linux/major.h>
#include <linux/slab.h>
+#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/vmalloc.h>
#include <linux/raid/detect.h>
state->pp_buf[0] = '\0';
state->disk = hd;
- snprintf(state->name, BDEVNAME_SIZE, "%s", hd->disk_name);
+ strscpy(state->name, hd->disk_name);
snprintf(state->pp_buf, PAGE_SIZE, " %s:", state->name);
if (isdigit(state->name[strlen(state->name)-1]))
sprintf(state->name, "p");