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

staging: unisys: refactor visor_memregion_create()



Fix the sizeof() so it uses the variable name rather than the type, fix the
argument alignment to the kzalloc(), and rename the goto label.

Away => cleanup

Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b63438c4
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ struct memregion *
visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes)
{
	struct memregion *rc = NULL;
	struct memregion *memregion = kzalloc(sizeof(struct memregion),
	struct memregion *memregion = kzalloc(sizeof(*memregion),
					      GFP_KERNEL | __GFP_NORETRY);
	if (memregion == NULL) {
		ERRDRV("visor_memregion_create allocation failed");
@@ -52,10 +52,10 @@ visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes)
	memregion->overlapped = FALSE;
	if (!mapit(memregion)) {
		rc = NULL;
		goto Away;
		goto cleanup;
	}
	rc = memregion;
Away:
cleanup:
	if (rc == NULL) {
		if (memregion != NULL) {
			visor_memregion_destroy(memregion);