/* hvc_iucv_parse_filter() - Parse filter for a single z/VM user ID @filter: String containing a comma-separated list of z/VM user IDs  */
static const char* hvc_iucv_parse_filter(const char *filter, char *dest)
/* hvc_iucv_parse_filter() - Parse filter for a single z/VM user ID @filter: String containing a comma-separated list of z/VM user IDs  */
static const char* hvc_iucv_parse_filter(const char *filter, char *dest)
{
	const char *nextdelim, *residual;
	size_t len;
	nextdelim = strchr(filter, ',');
	if (nextdelim) {
		len = nextdelim - filter;
		residual = nextdelim + 1;
	} else {
		len = strlen(filter);
		residual = filter + len;
	}
	if (len == 0)
		return ERR_PTR(-EINVAL);
	if (filter[len - 1] == '\n')
		len--;
	if (len > 8)
		return ERR_PTR(-EINVAL);
	memset(dest, ' ', 8);
	while (len--)
		dest[len] = toupper(filter[len]);
	return residual;
}