Commit 820109fb authored by Wolfram Sang's avatar Wolfram Sang Committed by Vasily Gorbik
Browse files

s390: move from strlcpy with unused retval to strscpy

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/


Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
Acked-by: default avatarBenjamin Block <bblock@linux.ibm.com>
Acked-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
Link: https://lore.kernel.org/r/20220818205948.6360-1-wsa+renesas@sang-engineering.com
Link: https://lore.kernel.org/r/20220818210102.7301-1-wsa+renesas@sang-engineering.com


[gor@linux.ibm.com: squashed two changes linked above together]
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent b90cb105
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ static debug_info_t *debug_info_alloc(const char *name, int pages_per_area,
	rc->level	   = level;
	rc->buf_size	   = buf_size;
	rc->entry_size	   = sizeof(debug_entry_t) + buf_size;
	strlcpy(rc->name, name, sizeof(rc->name));
	strscpy(rc->name, name, sizeof(rc->name));
	memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *));
	memset(rc->debugfs_entries, 0, DEBUG_MAX_VIEWS * sizeof(struct dentry *));
	refcount_set(&(rc->ref_count), 0);
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ char __bootdata(early_command_line)[COMMAND_LINE_SIZE];
static void __init setup_boot_command_line(void)
{
	/* copy arch command line */
	strlcpy(boot_command_line, early_command_line, COMMAND_LINE_SIZE);
	strscpy(boot_command_line, early_command_line, COMMAND_LINE_SIZE);
}

static void __init check_image_bootable(void)
+1 −1
Original line number Diff line number Diff line
@@ -426,7 +426,7 @@ dasd_add_busid(const char *bus_id, int features)
	if (!devmap) {
		/* This bus_id is new. */
		new->devindex = dasd_max_devindex++;
		strlcpy(new->bus_id, bus_id, DASD_BUS_ID_SIZE);
		strscpy(new->bus_id, bus_id, DASD_BUS_ID_SIZE);
		new->features = features;
		new->device = NULL;
		list_add(&new->list, &dasd_hashlists[hash]);
+2 −2
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ static void dasd_eer_write_standard_trigger(struct dasd_device *device,
	ktime_get_real_ts64(&ts);
	header.tv_sec = ts.tv_sec;
	header.tv_usec = ts.tv_nsec / NSEC_PER_USEC;
	strlcpy(header.busid, dev_name(&device->cdev->dev),
	strscpy(header.busid, dev_name(&device->cdev->dev),
		DASD_EER_BUSID_SIZE);

	spin_lock_irqsave(&bufferlock, flags);
@@ -356,7 +356,7 @@ static void dasd_eer_write_snss_trigger(struct dasd_device *device,
	ktime_get_real_ts64(&ts);
	header.tv_sec = ts.tv_sec;
	header.tv_usec = ts.tv_nsec / NSEC_PER_USEC;
	strlcpy(header.busid, dev_name(&device->cdev->dev),
	strscpy(header.busid, dev_name(&device->cdev->dev),
		DASD_EER_BUSID_SIZE);

	spin_lock_irqsave(&bufferlock, flags);
+1 −1
Original line number Diff line number Diff line
@@ -614,7 +614,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
		rc = -ENAMETOOLONG;
		goto seg_list_del;
	}
	strlcpy(local_buf, buf, i + 1);
	strscpy(local_buf, buf, i + 1);
	dev_info->num_of_segments = num_of_segments;
	rc = dcssblk_is_continuous(dev_info);
	if (rc < 0)
Loading