/* The function stores the filter as a comma-separated list of z/VM user IDs in @buffer. Typically, sysfs routines call this function for attr show.  */
static int param_get_vmidfilter(char *buffer, struct kernel_param *kp)
/* The function stores the filter as a comma-separated list of z/VM user IDs in @buffer. Typically, sysfs routines call this function for attr show.  */
static int param_get_vmidfilter(char *buffer, struct kernel_param *kp)
{
	int rc;
	size_t index, len;
	void *start, *end;
	if (!MACHINE_IS_VM || !hvc_iucv_devices)
		return -ENODEV;
	rc = 0;
	read_lock_bh(&hvc_iucv_filter_lock);
	for (index = 0; index < hvc_iucv_filter_size; index++) {
		start = hvc_iucv_filter + (8 * index);
		end   = memchr(start, ' ', 8);
		len   = (end) ? end - start : 8;
		memcpy(buffer + rc, start, len);
		rc += len;
		buffer[rc++] = ',';
	}
	read_unlock_bh(&hvc_iucv_filter_lock);
	if (rc)
		buffer[--rc] = '\0';
	return rc;
}