Commit 6a405e39 authored by Arun Gopalakrishnan's avatar Arun Gopalakrishnan Committed by Hari Kanigeri

ARM: OMAP Syslink IPC ioctl module variable name changes

Some  variables that makes a osal feel were renamed
Signed-off-by: default avatarArun M G <arunmg@ti.com>
parent 67592dc6
......@@ -38,16 +38,16 @@
static int gatepeterson_ioctl_get_config(struct gatepeterson_cmd_args *cargs)
{
struct gatepeterson_config config;
s32 osstatus = 0;
s32 status = 0;
s32 size;
cargs->api_status = gatepeterson_get_config(&config);
size = copy_to_user(cargs->args.get_config.config, &config,
sizeof(struct gatepeterson_config));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
return osstatus;
return status;
}
/*
......@@ -58,20 +58,20 @@ static int gatepeterson_ioctl_get_config(struct gatepeterson_cmd_args *cargs)
static int gatepeterson_ioctl_setup(struct gatepeterson_cmd_args *cargs)
{
struct gatepeterson_config config;
s32 osstatus = 0;
s32 status = 0;
s32 size;
size = copy_from_user(&config, cargs->args.setup.config,
sizeof(struct gatepeterson_config));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
cargs->api_status = gatepeterson_setup(&config);
exit:
return osstatus;
return status;
}
/*
......@@ -94,16 +94,16 @@ static int gatepeterson_ioctl_destroy(
static int gatepeterson_ioctl_params_init(struct gatepeterson_cmd_args *cargs)
{
struct gatepeterson_params params;
s32 osstatus = 0;
s32 status = 0;
s32 size;
cargs->api_status = gatepeterson_params_init(&params);
size = copy_to_user(cargs->args.params_init.params, &params,
sizeof(struct gatepeterson_params));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
return osstatus;
return status;
}
/*
......@@ -115,13 +115,13 @@ static int gatepeterson_ioctl_create(struct gatepeterson_cmd_args *cargs)
{
struct gatepeterson_params params;
void *handle = NULL;
s32 osstatus = 0;
s32 status = 0;
s32 size;
size = copy_from_user(&params, cargs->args.create.params,
sizeof(struct gatepeterson_params));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
......@@ -129,7 +129,7 @@ static int gatepeterson_ioctl_create(struct gatepeterson_cmd_args *cargs)
params.name = kmalloc(cargs->args.create.name_len + 1,
GFP_KERNEL);
if (params.name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
......@@ -138,7 +138,7 @@ static int gatepeterson_ioctl_create(struct gatepeterson_cmd_args *cargs)
cargs->args.create.params->name,
cargs->args.create.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto name_from_usr_error;
}
......@@ -158,7 +158,7 @@ name_from_usr_error:
kfree(params.name);
exit:
return osstatus;
return status;
}
/*
......@@ -182,13 +182,13 @@ static int gatepeterson_ioctl_open(struct gatepeterson_cmd_args *cargs)
{
struct gatepeterson_params params;
void *handle = NULL;
s32 osstatus = 0;
s32 status = 0;
s32 size;
size = copy_from_user(&params, cargs->args.open.params,
sizeof(struct gatepeterson_params));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
......@@ -196,7 +196,7 @@ static int gatepeterson_ioctl_open(struct gatepeterson_cmd_args *cargs)
params.name = kmalloc(cargs->args.open.name_len + 1,
GFP_KERNEL);
if (params.name != NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
......@@ -205,13 +205,13 @@ static int gatepeterson_ioctl_open(struct gatepeterson_cmd_args *cargs)
cargs->args.open.params->name,
cargs->args.open.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto name_from_usr_error;
}
}
params.shared_addr = sharedregion_get_ptr((u32 *)params.shared_addr);
osstatus = gatepeterson_open(&handle, &params);
status = gatepeterson_open(&handle, &params);
cargs->args.open.handle = handle;
cargs->api_status = 0;
......@@ -220,7 +220,7 @@ name_from_usr_error:
kfree(params.name);
exit:
return osstatus;
return status;
}
/*
......@@ -254,6 +254,7 @@ static int gatepeterson_ioctl_leave(struct gatepeterson_cmd_args *cargs)
{
gatepeterson_leave(cargs->args.enter.handle,
cargs->args.enter.flags);
cargs->api_status = 0;
return 0;
}
......@@ -265,14 +266,14 @@ static int gatepeterson_ioctl_leave(struct gatepeterson_cmd_args *cargs)
static int gatepeterson_ioctl_shared_memreq(struct gatepeterson_cmd_args *cargs)
{
struct gatepeterson_params params;
s32 osstatus = 0;
s32 status = 0;
s32 size;
size = copy_from_user(&params, cargs->args.shared_memreq.params,
sizeof(struct gatepeterson_params));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
......@@ -281,7 +282,7 @@ static int gatepeterson_ioctl_shared_memreq(struct gatepeterson_cmd_args *cargs)
cargs->api_status = 0;
exit:
return osstatus;
return status;
}
/*
......@@ -292,7 +293,7 @@ exit:
int gatepeterson_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long args)
{
s32 os_status = 0;
s32 status = 0;
s32 size = 0;
struct gatepeterson_cmd_args __user *uarg =
(struct gatepeterson_cmd_args __user *)args;
......@@ -300,12 +301,12 @@ int gatepeterson_ioctl(struct inode *inode, struct file *filp,
if (_IOC_DIR(cmd) & _IOC_READ)
os_status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
else if (_IOC_DIR(cmd) & _IOC_WRITE)
os_status = !access_ok(VERIFY_READ, uarg, _IOC_SIZE(cmd));
status = !access_ok(VERIFY_READ, uarg, _IOC_SIZE(cmd));
if (os_status) {
os_status = -EFAULT;
if (status) {
status = -EFAULT;
goto exit;
}
......@@ -313,58 +314,58 @@ int gatepeterson_ioctl(struct inode *inode, struct file *filp,
size = copy_from_user(&cargs, uarg,
sizeof(struct gatepeterson_cmd_args));
if (size) {
os_status = -EFAULT;
status = -EFAULT;
goto exit;
}
switch (cmd) {
case CMD_GATEPETERSON_GETCONFIG:
os_status = gatepeterson_ioctl_get_config(&cargs);
status = gatepeterson_ioctl_get_config(&cargs);
break;
case CMD_GATEPETERSON_SETUP:
os_status = gatepeterson_ioctl_setup(&cargs);
status = gatepeterson_ioctl_setup(&cargs);
break;
case CMD_GATEPETERSON_DESTROY:
os_status = gatepeterson_ioctl_destroy(&cargs);
status = gatepeterson_ioctl_destroy(&cargs);
break;
case CMD_GATEPETERSON_PARAMS_INIT:
os_status = gatepeterson_ioctl_params_init(&cargs);
status = gatepeterson_ioctl_params_init(&cargs);
break;
case CMD_GATEPETERSON_CREATE:
os_status = gatepeterson_ioctl_create(&cargs);
status = gatepeterson_ioctl_create(&cargs);
break;
case CMD_GATEPETERSON_DELETE:
os_status = gatepeterson_ioctl_delete(&cargs);
status = gatepeterson_ioctl_delete(&cargs);
break;
case CMD_GATEPETERSON_OPEN:
os_status = gatepeterson_ioctl_open(&cargs);
status = gatepeterson_ioctl_open(&cargs);
break;
case CMD_GATEPETERSON_CLOSE:
os_status = gatepeterson_ioctl_close(&cargs);
status = gatepeterson_ioctl_close(&cargs);
break;
case CMD_GATEPETERSON_ENTER:
os_status = gatepeterson_ioctl_enter(&cargs);
status = gatepeterson_ioctl_enter(&cargs);
break;
case CMD_GATEPETERSON_LEAVE:
os_status = gatepeterson_ioctl_leave(&cargs);
status = gatepeterson_ioctl_leave(&cargs);
break;
case CMD_GATEPETERSON_SHAREDMEMREQ:
os_status = gatepeterson_ioctl_shared_memreq(&cargs);
status = gatepeterson_ioctl_shared_memreq(&cargs);
break;
default:
WARN_ON(cmd);
os_status = -ENOTTY;
status = -ENOTTY;
break;
}
......@@ -372,11 +373,11 @@ int gatepeterson_ioctl(struct inode *inode, struct file *filp,
size = copy_to_user(uarg, &cargs,
sizeof(struct gatepeterson_cmd_args));
if (size) {
os_status = -EFAULT;
status = -EFAULT;
goto exit;
}
exit:
return os_status;
return status;
}
......@@ -37,7 +37,7 @@ static int heapbuf_ioctl_alloc(struct heapbuf_cmd_args *cargs)
u32 *block_srptr = SHAREDREGION_INVALIDSRPTR;
void *block;
s32 index;
s32 osstatus = 0;
s32 status = 0;
block = heapbuf_alloc(cargs->args.alloc.handle,
cargs->args.alloc.size,
......@@ -53,7 +53,7 @@ static int heapbuf_ioctl_alloc(struct heapbuf_cmd_args *cargs)
*/
cargs->args.alloc.block_srptr = block_srptr;
cargs->api_status = 0;
return osstatus;
return status;
}
/*
......@@ -79,16 +79,16 @@ static int heapbuf_ioctl_free(struct heapbuf_cmd_args *cargs)
static int heapbuf_ioctl_params_init(struct heapbuf_cmd_args *cargs)
{
struct heapbuf_params params;
s32 osstatus = 0;
s32 status = 0;
u32 size;
heapbuf_params_init(cargs->args.params_init.handle, &params);
size = copy_to_user(cargs->args.params_init.params, &params,
sizeof(struct heapbuf_params));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
return osstatus;
return status;
}
/*
......@@ -99,14 +99,14 @@ static int heapbuf_ioctl_params_init(struct heapbuf_cmd_args *cargs)
static int heapbuf_ioctl_create(struct heapbuf_cmd_args *cargs)
{
struct heapbuf_params params;
s32 osstatus = 0;
s32 status = 0;
u32 size;
void *handle = NULL;
size = copy_from_user(&params, cargs->args.create.params,
sizeof(struct heapbuf_params));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
......@@ -114,7 +114,7 @@ static int heapbuf_ioctl_create(struct heapbuf_cmd_args *cargs)
params.name = kmalloc(cargs->args.create.name_len + 1,
GFP_KERNEL);
if (params.name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
......@@ -123,7 +123,7 @@ static int heapbuf_ioctl_create(struct heapbuf_cmd_args *cargs)
cargs->args.create.params->name,
cargs->args.create.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto name_from_usr_error;
}
}
......@@ -139,7 +139,7 @@ name_from_usr_error:
kfree(params.name);
exit:
return osstatus;
return status;
}
......@@ -163,13 +163,13 @@ static int heapbuf_ioctl_open(struct heapbuf_cmd_args *cargs)
{
struct heapbuf_params params;
void *handle = NULL;
s32 osstatus = 0;
s32 status = 0;
ulong size;
size = copy_from_user(&params, cargs->args.open.params,
sizeof(struct heapbuf_params));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
......@@ -177,7 +177,7 @@ static int heapbuf_ioctl_open(struct heapbuf_cmd_args *cargs)
params.name = kmalloc(cargs->args.open.name_len + 1,
GFP_KERNEL);
if (params.name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
......@@ -186,7 +186,7 @@ static int heapbuf_ioctl_open(struct heapbuf_cmd_args *cargs)
cargs->args.open.params->name,
cargs->args.open.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto free_name;
}
}
......@@ -201,7 +201,7 @@ static int heapbuf_ioctl_open(struct heapbuf_cmd_args *cargs)
size = copy_to_user(cargs->args.open.params, &params,
sizeof(struct heapbuf_params));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto copy_to_usr_error;
}
......@@ -218,7 +218,7 @@ free_name:
kfree(params.name);
exit:
return osstatus;
return status;
}
......@@ -241,14 +241,14 @@ static int heapbuf_ioctl_close(struct heapbuf_cmd_args *cargs)
static int heapbuf_ioctl_shared_memreq(struct heapbuf_cmd_args *cargs)
{
struct heapbuf_params params;
s32 osstatus = 0;
s32 status = 0;
ulong size;
u32 bytes;
size = copy_from_user(&params, cargs->args.shared_memreq.params,
sizeof(struct heapbuf_params));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
......@@ -257,7 +257,7 @@ static int heapbuf_ioctl_shared_memreq(struct heapbuf_cmd_args *cargs)
cargs->api_status = 0;
exit:
return osstatus;
return status;
}
......@@ -269,16 +269,16 @@ exit:
static int heapbuf_ioctl_get_config(struct heapbuf_cmd_args *cargs)
{
struct heap_config config;
s32 osstatus = 0;
s32 status = 0;
ulong size;
cargs->api_status = heapbuf_get_config(&config);
size = copy_to_user(cargs->args.get_config.config, &config,
sizeof(struct heap_config));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
return osstatus;
return status;
}
/*
......@@ -289,20 +289,20 @@ static int heapbuf_ioctl_get_config(struct heapbuf_cmd_args *cargs)
static int heapbuf_ioctl_setup(struct heapbuf_cmd_args *cargs)
{
struct heap_config config;
s32 osstatus = 0;
s32 status = 0;
ulong size;
size = copy_from_user(&config, cargs->args.setup.config,
sizeof(struct heap_config));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
cargs->api_status = heapbuf_setup(&config);
exit:
return osstatus;
return status;
}
/*
* ======== heapbuf_ioctl_destroy ========
......@@ -324,21 +324,21 @@ static int heapbuf_ioctl_destroy(struct heapbuf_cmd_args *cargs)
static int heapbuf_ioctl_get_stats(struct heapbuf_cmd_args *cargs)
{
struct memory_stats stats;
s32 osstatus = 0;
s32 status = 0;
ulong size;
cargs->api_status = heapbuf_get_stats(cargs->args.get_stats.handle,
&stats);
if (osstatus)
if (status)
goto exit;
size = copy_to_user(cargs->args.get_stats.stats, &stats,
sizeof(struct memory_stats));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
exit:
return osstatus;
return status;
}
/*
......@@ -349,7 +349,7 @@ exit:
static int heapbuf_ioctl_get_extended_stats(struct heapbuf_cmd_args *cargs)
{
struct heap_extended_stats stats;
s32 osstatus = 0;
s32 status = 0;
ulong size;
cargs->api_status = heapbuf_get_extended_stats(
......@@ -360,10 +360,10 @@ static int heapbuf_ioctl_get_extended_stats(struct heapbuf_cmd_args *cargs)
size = copy_to_user(cargs->args.get_extended_stats.stats, &stats,
sizeof(struct heap_extended_stats));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
exit:
return osstatus;
return status;
}
/*
......@@ -374,19 +374,19 @@ exit:
int heapbuf_ioctl(struct inode *pinode, struct file *filp,
unsigned int cmd, unsigned long args)
{
s32 os_status = 0;
s32 status = 0;
s32 size = 0;
struct heapbuf_cmd_args __user *uarg =
(struct heapbuf_cmd_args __user *)args;
struct heapbuf_cmd_args cargs;
if (_IOC_DIR(cmd) & _IOC_READ)
os_status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
else if (_IOC_DIR(cmd) & _IOC_WRITE)
os_status = !access_ok(VERIFY_READ, uarg, _IOC_SIZE(cmd));
status = !access_ok(VERIFY_READ, uarg, _IOC_SIZE(cmd));
if (os_status) {
os_status = -EFAULT;
if (status) {
status = -EFAULT;
goto exit;
}
......@@ -394,66 +394,66 @@ int heapbuf_ioctl(struct inode *pinode, struct file *filp,
size = copy_from_user(&cargs, uarg,
sizeof(struct heapbuf_cmd_args));
if (size) {
os_status = -EFAULT;
status = -EFAULT;
goto exit;
}
switch (cmd) {
case CMD_HEAPBUF_ALLOC:
os_status = heapbuf_ioctl_alloc(&cargs);
status = heapbuf_ioctl_alloc(&cargs);
break;
case CMD_HEAPBUF_FREE:
os_status = heapbuf_ioctl_free(&cargs);
status = heapbuf_ioctl_free(&cargs);
break;
case CMD_HEAPBUF_PARAMS_INIT:
os_status = heapbuf_ioctl_params_init(&cargs);
status = heapbuf_ioctl_params_init(&cargs);
break;
case CMD_HEAPBUF_CREATE:
os_status = heapbuf_ioctl_create(&cargs);
status = heapbuf_ioctl_create(&cargs);
break;
case CMD_HEAPBUF_DELETE:
os_status = heapbuf_ioctl_delete(&cargs);
status = heapbuf_ioctl_delete(&cargs);
break;
case CMD_HEAPBUF_OPEN:
os_status = heapbuf_ioctl_open(&cargs);
status = heapbuf_ioctl_open(&cargs);
break;
case CMD_HEAPBUF_CLOSE:
os_status = heapbuf_ioctl_close(&cargs);
status = heapbuf_ioctl_close(&cargs);
break;
case CMD_HEAPBUF_SHAREDMEMREQ:
os_status = heapbuf_ioctl_shared_memreq(&cargs);
status = heapbuf_ioctl_shared_memreq(&cargs);
break;
case CMD_HEAPBUF_GETCONFIG:
os_status = heapbuf_ioctl_get_config(&cargs);
status = heapbuf_ioctl_get_config(&cargs);
break;
case CMD_HEAPBUF_SETUP:
os_status = heapbuf_ioctl_setup(&cargs);
status = heapbuf_ioctl_setup(&cargs);
break;
case CMD_HEAPBUF_DESTROY:
os_status = heapbuf_ioctl_destroy(&cargs);
status = heapbuf_ioctl_destroy(&cargs);
break;
case CMD_HEAPBUF_GETSTATS:
os_status = heapbuf_ioctl_get_stats(&cargs);
status = heapbuf_ioctl_get_stats(&cargs);
break;
case CMD_HEAPBUF_GETEXTENDEDSTATS:
os_status = heapbuf_ioctl_get_extended_stats(&cargs);
status = heapbuf_ioctl_get_extended_stats(&cargs);
break;
default:
WARN_ON(cmd);
os_status = -ENOTTY;
status = -ENOTTY;
break;
}
......@@ -461,12 +461,12 @@ int heapbuf_ioctl(struct inode *pinode, struct file *filp,
size = copy_to_user(uarg, &cargs,
sizeof(struct heapbuf_cmd_args));
if (size) {
os_status = -EFAULT;
status = -EFAULT;
goto exit;
}
exit:
return os_status;
return status;
}
......@@ -36,7 +36,7 @@
static int nameserver_remotenotify_ioctl_get(
struct nameserver_remotenotify_cmd_args *cargs)
{
s32 osstatus = 0;
s32 status = 0;
ulong size;
char *instance_name = NULL;
char *name = NULL;
......@@ -46,7 +46,7 @@ static int nameserver_remotenotify_ioctl_get(
instance_name = kmalloc(cargs->args.get.instance_name_len + 1,
GFP_KERNEL);
if (instance_name == NULL) {
osstatus = ENOMEM;
status = ENOMEM;
goto exit;
}
......@@ -55,7 +55,7 @@ static int nameserver_remotenotify_ioctl_get(
cargs->args.get.instance_name,
cargs->args.get.instance_name_len);
if (size) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
}
......@@ -64,7 +64,7 @@ static int nameserver_remotenotify_ioctl_get(
name = kmalloc(cargs->args.get.name_len + 1,
GFP_KERNEL);
if (name == NULL) {
osstatus = ENOMEM;
status = ENOMEM;
goto exit;
}
......@@ -72,7 +72,7 @@ static int nameserver_remotenotify_ioctl_get(
size = copy_from_user(name, cargs->args.get.name,
cargs->args.get.name_len);
if (size) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
}
......@@ -83,7 +83,7 @@ static int nameserver_remotenotify_ioctl_get(
size = copy_from_user(value, cargs->args.get.value,
cargs->args.get.value_len);
if (size) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
}
......@@ -101,7 +101,7 @@ exit:
kfree(value);
kfree(name);
kfree(instance_name);
return osstatus;
return status;
}
/*
......@@ -113,7 +113,7 @@ static int nameserver_remotenotify_ioctl_shared_memreq(
struct nameserver_remotenotify_cmd_args *cargs)
{
struct nameserver_remotenotify_params params;
s32 osstatus = 0;
s32 status = 0;
ulong size;
/* params may be NULL. */
......@@ -122,7 +122,7 @@ static int nameserver_remotenotify_ioctl_shared_memreq(
cargs->args.shared_memreq.params,
sizeof(struct nameserver_remotenotify_params));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
}
......@@ -132,7 +132,7 @@ static int nameserver_remotenotify_ioctl_shared_memreq(
cargs->api_status = 0;
exit:
return osstatus;
return status;
}
/*
......@@ -144,7 +144,7 @@ static int nameserver_remotenotify_ioctl_params_init(
struct nameserver_remotenotify_cmd_args *cargs)
{
struct nameserver_remotenotify_params params;
s32 osstatus = 0;
s32 status = 0;
ulong size;
nameserver_remotenotify_params_init(cargs->args.params_init.handle,
......@@ -152,10 +152,10 @@ static int nameserver_remotenotify_ioctl_params_init(
size = copy_to_user(cargs->args.params_init.params, &params,
sizeof(struct nameserver_remotenotify_params));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
cargs->api_status = 0;
return osstatus;
return status;
}
/*
......@@ -167,12 +167,12 @@ static int nameserver_remotenotify_ioctl_create(
struct nameserver_remotenotify_cmd_args *cargs)
{
struct nameserver_remotenotify_params params;
s32 osstatus = 0;
s32 status = 0;
ulong size;
size = copy_from_user(&params, cargs->args.create.params,
sizeof(struct nameserver_remotenotify_params));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
......@@ -183,7 +183,7 @@ static int nameserver_remotenotify_ioctl_create(
&params);
cargs->api_status = 0;
exit:
return osstatus;
return status;
}
/*
......@@ -207,7 +207,7 @@ static int nameserver_remotenotify_ioctl_delete(
static int nameserver_remotenotify_ioctl_get_config(
struct nameserver_remotenotify_cmd_args *cargs)
{
s32 osstatus = 0;
s32 status = 0;
ulong size;
struct nameserver_remotenotify_config config;
......@@ -215,10 +215,10 @@ static int nameserver_remotenotify_ioctl_get_config(
size = copy_to_user(cargs->args.get_config.config, &config,
sizeof(struct nameserver_remotenotify_config));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
cargs->api_status = 0;
return osstatus;
return status;
}
/*
......@@ -230,19 +230,19 @@ static int nameserver_remotenotify_ioctl_setup(
struct nameserver_remotenotify_cmd_args *cargs)
{
struct nameserver_remotenotify_config config;
s32 osstatus = 0;
s32 status = 0;
ulong size;
size = copy_from_user(&config, cargs->args.setup.config,
sizeof(struct nameserver_remotenotify_config));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
cargs->api_status = nameserver_remotenotify_setup(&config);
exit:
return osstatus;
return status;
}
......@@ -266,19 +266,19 @@ static int nameserver_remotenotify_ioctl_destroy(
int nameserver_remotenotify_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long args)
{
s32 os_status = 0;
s32 status = 0;
s32 size = 0;
struct nameserver_remotenotify_cmd_args __user *uarg =
(struct nameserver_remotenotify_cmd_args __user *)args;
struct nameserver_remotenotify_cmd_args cargs;
if (_IOC_DIR(cmd) & _IOC_READ)
os_status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
else if (_IOC_DIR(cmd) & _IOC_WRITE)
os_status = !access_ok(VERIFY_READ, uarg, _IOC_SIZE(cmd));
status = !access_ok(VERIFY_READ, uarg, _IOC_SIZE(cmd));
if (os_status) {
os_status = -EFAULT;
if (status) {
status = -EFAULT;
goto exit;
}
......@@ -286,46 +286,46 @@ int nameserver_remotenotify_ioctl(struct inode *inode, struct file *filp,
size = copy_from_user(&cargs, uarg,
sizeof(struct nameserver_remotenotify_cmd_args));
if (size) {
os_status = -EFAULT;
status = -EFAULT;
goto exit;
}
switch (cmd) {
case CMD_NAMESERVERREMOTENOTIFY_GET:
os_status = nameserver_remotenotify_ioctl_get(&cargs);
status = nameserver_remotenotify_ioctl_get(&cargs);
break;
case CMD_NAMESERVERREMOTENOTIFY_SHAREDMEMREQ:
os_status = nameserver_remotenotify_ioctl_shared_memreq(&cargs);
status = nameserver_remotenotify_ioctl_shared_memreq(&cargs);
break;
case CMD_NAMESERVERREMOTENOTIFY_PARAMS_INIT:
os_status = nameserver_remotenotify_ioctl_params_init(&cargs);
status = nameserver_remotenotify_ioctl_params_init(&cargs);
break;
case CMD_NAMESERVERREMOTENOTIFY_CREATE:
os_status = nameserver_remotenotify_ioctl_create(&cargs);
status = nameserver_remotenotify_ioctl_create(&cargs);
break;
case CMD_NAMESERVERREMOTENOTIFY_DELETE:
os_status = nameserver_remotenotify_ioctl_delete(&cargs);
status = nameserver_remotenotify_ioctl_delete(&cargs);
break;
case CMD_NAMESERVERREMOTENOTIFY_GETCONFIG:
os_status = nameserver_remotenotify_ioctl_get_config(&cargs);
status = nameserver_remotenotify_ioctl_get_config(&cargs);
break;
case CMD_NAMESERVERREMOTENOTIFY_SETUP:
os_status = nameserver_remotenotify_ioctl_setup(&cargs);
status = nameserver_remotenotify_ioctl_setup(&cargs);
break;
case CMD_NAMESERVERREMOTENOTIFY_DESTROY:
os_status = nameserver_remotenotify_ioctl_destroy(&cargs);
status = nameserver_remotenotify_ioctl_destroy(&cargs);
break;
default:
WARN_ON(cmd);
os_status = -ENOTTY;
status = -ENOTTY;
break;
}
......@@ -333,13 +333,13 @@ int nameserver_remotenotify_ioctl(struct inode *inode, struct file *filp,
size = copy_to_user(uarg, &cargs,
sizeof(struct nameserver_remotenotify_cmd_args));
if (size) {
os_status = -EFAULT;
status = -EFAULT;
goto exit;
}
printk(KERN_ERR "\n");
exit:
return os_status;
return status;
}
......@@ -41,16 +41,16 @@ static int sharedregion_ioctl_get_config(struct sharedregion_cmd_args *cargs)
{
struct sharedregion_config config;
s32 osstatus = 0;
s32 status = 0;
s32 size;
cargs->api_status = sharedregion_get_config(&config);
size = copy_to_user(cargs->args.get_config.config, &config,
sizeof(struct sharedregion_config));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
return osstatus;
return status;
}
......@@ -62,20 +62,20 @@ static int sharedregion_ioctl_get_config(struct sharedregion_cmd_args *cargs)
static int sharedregion_ioctl_setup(struct sharedregion_cmd_args *cargs)
{
struct sharedregion_config config;
s32 osstatus = 0;
s32 status = 0;
s32 size;
size = copy_from_user(&config, cargs->args.setup.config,
sizeof(struct sharedregion_config));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
cargs->api_status = sharedregion_setup(&config);
exit:
return osstatus;
return status;
}
/*
......@@ -166,7 +166,7 @@ static int sharedregion_ioctl_get_table_info(
struct sharedregion_cmd_args *cargs)
{
struct sharedregion_info info;
s32 osstatus = 0;
s32 status = 0;
s32 size;
cargs->api_status = sharedregion_get_table_info(
......@@ -175,9 +175,9 @@ static int sharedregion_ioctl_get_table_info(
size = copy_to_user(cargs->args.get_table_info.info, &info,
sizeof(struct sharedregion_info));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
return osstatus;
return status;
}
......@@ -201,13 +201,13 @@ static int sharedregion_ioctl_set_table_info(
struct sharedregion_cmd_args *cargs)
{
struct sharedregion_info info;
s32 osstatus = 0;
s32 status = 0;
s32 size;
size = copy_from_user(&info, cargs->args.set_table_info.info,
sizeof(struct sharedregion_info));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto exit;
}
......@@ -216,7 +216,7 @@ static int sharedregion_ioctl_set_table_info(
cargs->args.set_table_info.proc_id, &info);
exit:
return osstatus;
return status;
}
/*
......@@ -227,19 +227,19 @@ exit:
int sharedregion_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long args)
{
s32 os_status = 0;
s32 status = 0;
s32 size = 0;
struct sharedregion_cmd_args __user *uarg =
(struct sharedregion_cmd_args __user *)args;
struct sharedregion_cmd_args cargs;
if (_IOC_DIR(cmd) & _IOC_READ)
os_status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
status = !access_ok(VERIFY_WRITE, uarg, _IOC_SIZE(cmd));
else if (_IOC_DIR(cmd) & _IOC_WRITE)
os_status = !access_ok(VERIFY_READ, uarg, _IOC_SIZE(cmd));
status = !access_ok(VERIFY_READ, uarg, _IOC_SIZE(cmd));
if (os_status) {
os_status = -EFAULT;
if (status) {
status = -EFAULT;
goto exit;
}
......@@ -247,54 +247,54 @@ int sharedregion_ioctl(struct inode *inode, struct file *filp,
size = copy_from_user(&cargs, uarg,
sizeof(struct sharedregion_cmd_args));
if (size) {
os_status = -EFAULT;
status = -EFAULT;
goto exit;
}
switch (cmd) {
case CMD_SHAREDREGION_GETCONFIG:
os_status = sharedregion_ioctl_get_config(&cargs);
status = sharedregion_ioctl_get_config(&cargs);
break;
case CMD_SHAREDREGION_SETUP:
os_status = sharedregion_ioctl_setup(&cargs);
status = sharedregion_ioctl_setup(&cargs);
break;
case CMD_SHAREDREGION_DESTROY:
os_status = sharedregion_ioctl_destroy(&cargs);
status = sharedregion_ioctl_destroy(&cargs);
break;
case CMD_SHAREDREGION_ADD:
os_status = sharedregion_ioctl_add(&cargs);
status = sharedregion_ioctl_add(&cargs);
break;
case CMD_SHAREDREGION_GETINDEX:
os_status = sharedregion_ioctl_get_index(&cargs);
status = sharedregion_ioctl_get_index(&cargs);
break;
case CMD_SHAREDREGION_GETPTR:
os_status = sharedregion_ioctl_get_ptr(&cargs);
status = sharedregion_ioctl_get_ptr(&cargs);
break;
case CMD_SHAREDREGION_GETSRPTR:
os_status = sharedregion_ioctl_get_srptr(&cargs);
status = sharedregion_ioctl_get_srptr(&cargs);
break;
case CMD_SHAREDREGION_GETTABLEINFO:
os_status = sharedregion_ioctl_get_table_info(&cargs);
status = sharedregion_ioctl_get_table_info(&cargs);
break;
case CMD_SHAREDREGION_REMOVE:
os_status = sharedregion_ioctl_remove(&cargs);
status = sharedregion_ioctl_remove(&cargs);
break;
case CMD_SHAREDREGION_SETTABLEINFO:
os_status = sharedregion_ioctl_set_table_info(&cargs);
status = sharedregion_ioctl_set_table_info(&cargs);
break;
default:
WARN_ON(cmd);
os_status = -ENOTTY;
status = -ENOTTY;
break;
}
......@@ -302,11 +302,11 @@ int sharedregion_ioctl(struct inode *inode, struct file *filp,
/* Copy the full args to the user-side. */
size = copy_to_user(uarg, &cargs, sizeof(struct sharedregion_cmd_args));
if (size) {
os_status = -EFAULT;
status = -EFAULT;
goto exit;
}
exit:
return os_status;
return status;
}
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