Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f748f64f authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman
Browse files

staging: unisys: remove goto in get_vbus_header_info



Remove the rc, the = -1, and all the goto mess here and just return
directly with a meaningful error number.

The caller only cares about success/failure right now, that needs to be
addressed in a later patch series.

Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a5cff2b7
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -1058,23 +1058,21 @@ static int
get_vbus_header_info(struct visorchannel *chan,
		     struct spar_vbus_headerinfo *hdr_info)
{
	int rc = -1;

	if (!SPAR_VBUS_CHANNEL_OK_CLIENT(visorchannel_get_header(chan)))
		goto away;
		return -EINVAL;

	if (visorchannel_read(chan, sizeof(struct channel_header), hdr_info,
			      sizeof(*hdr_info)) < 0) {
		goto away;
		return -EIO;
	}
	if (hdr_info->struct_bytes < sizeof(struct spar_vbus_headerinfo))
		goto away;
		return -EINVAL;

	if (hdr_info->device_info_struct_bytes <
	    sizeof(struct ultra_vbus_deviceinfo)) {
		goto away;
		return -EINVAL;
	}
	rc = 0;
away:
	return rc;
	return 0;
}

/* Write the contents of <info> to the struct