Commit eb4a1468 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: refactor init_vbus_channel()

Clean up the function definition so it's a single line. Remove the unnecessary
goto statements and just return directly. Remove the unneeded local variable
for the return result. Fix CamelCase parameters and local variable names:

channelAddr => ch_addr
channelBytes => ch_bytes
pChan => ch
Signed-off-by: default avatarBryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b98ab24c
...@@ -128,28 +128,22 @@ init_msg_header(struct controlvm_message *msg, u32 id, uint rsp, uint svr) ...@@ -128,28 +128,22 @@ init_msg_header(struct controlvm_message *msg, u32 id, uint rsp, uint svr)
msg->hdr.flags.server = svr; msg->hdr.flags.server = svr;
} }
static __iomem void * static __iomem void *init_vbus_channel(u64 ch_addr, u32 ch_bytes)
init_vbus_channel(u64 channelAddr, u32 channelBytes)
{ {
void __iomem *rc = NULL; void __iomem *ch = uislib_ioremap_cache(ch_addr, ch_bytes);
void __iomem *pChan = uislib_ioremap_cache(channelAddr, channelBytes);
if (!pChan) { if (!ch) {
LOGERR("CONTROLVM_BUS_CREATE error: ioremap_cache of channelAddr:%Lx for channelBytes:%llu failed", LOGERR("CONTROLVM_BUS_CREATE error: ioremap_cache of channelAddr:%Lx for channelBytes:%llu failed",
(unsigned long long)channelAddr, (unsigned long long)ch_addr,
(unsigned long long)channelBytes); (unsigned long long)ch_bytes);
rc = NULL; return NULL;
goto Away;
} }
if (!SPAR_VBUS_CHANNEL_OK_CLIENT(pChan)) { if (!SPAR_VBUS_CHANNEL_OK_CLIENT(ch)) {
ERRDRV("%s channel cannot be used", __func__); ERRDRV("%s channel cannot be used", __func__);
uislib_iounmap(pChan); uislib_iounmap(ch);
rc = NULL; return NULL;
goto Away;
} }
rc = pChan; return ch;
Away:
return rc;
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment