提交 717dd09f 编写于 作者: B Benjamin Romer 提交者: Greg Kroah-Hartman

staging: unisys: refactor uisctrl_register_req_handler_ex()

Fix CamelCase local variable name:

pReqHandlerInfo => req_handler

Get rid of the useless goto and just return straight away on an error.
Signed-off-by: NBryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: NBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 61f98896
...@@ -112,46 +112,43 @@ uisctrl_register_req_handler_ex(uuid_le switch_uuid, ...@@ -112,46 +112,43 @@ uisctrl_register_req_handler_ex(uuid_le switch_uuid,
u32 client_str_len, u64 bytes), u32 client_str_len, u64 bytes),
struct ultra_vbus_deviceinfo *chipset_driver_info) struct ultra_vbus_deviceinfo *chipset_driver_info)
{ {
struct req_handler_info *pReqHandlerInfo; struct req_handler_info *req_handler;
int rc = 0; /* assume failure */
LOGINF("type=%pUL, controlfunc=0x%p.\n", LOGINF("type=%pUL, controlfunc=0x%p.\n",
&switch_uuid, controlfunc); &switch_uuid, controlfunc);
if (!controlfunc) { if (!controlfunc) {
LOGERR("%pUL: controlfunc must be supplied\n", &switch_uuid); LOGERR("%pUL: controlfunc must be supplied\n", &switch_uuid);
goto Away; return 0;
} }
if (!server_channel_ok) { if (!server_channel_ok) {
LOGERR("%pUL: Server_Channel_Ok must be supplied\n", LOGERR("%pUL: Server_Channel_Ok must be supplied\n",
&switch_uuid); &switch_uuid);
goto Away; return 0;
} }
if (!server_channel_init) { if (!server_channel_init) {
LOGERR("%pUL: Server_Channel_Init must be supplied\n", LOGERR("%pUL: Server_Channel_Init must be supplied\n",
&switch_uuid); &switch_uuid);
goto Away; return 0;
} }
pReqHandlerInfo = req_handler_add(switch_uuid, req_handler = req_handler_add(switch_uuid,
switch_type_name, switch_type_name,
controlfunc, controlfunc,
min_channel_bytes, min_channel_bytes,
server_channel_ok, server_channel_init); server_channel_ok, server_channel_init);
if (!pReqHandlerInfo) { if (!req_handler) {
LOGERR("failed to add %pUL to server list\n", &switch_uuid); LOGERR("failed to add %pUL to server list\n", &switch_uuid);
goto Away; return 0;
} }
atomic_inc(&uisutils_registered_services); atomic_inc(&uisutils_registered_services);
rc = 1; /* success */ if (chipset_driver_info) {
Away: bus_device_info_init(chipset_driver_info, "chipset",
if (rc) { "uislib", VERSION, NULL);
if (chipset_driver_info) return 1;
bus_device_info_init(chipset_driver_info, "chipset",
"uislib", VERSION, NULL);
} else {
LOGERR("failed to register type %pUL.\n", &switch_uuid);
} }
return rc;
LOGERR("failed to register type %pUL.\n", &switch_uuid);
return 0;
} }
EXPORT_SYMBOL_GPL(uisctrl_register_req_handler_ex); EXPORT_SYMBOL_GPL(uisctrl_register_req_handler_ex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册