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;
}
......@@ -61,16 +61,16 @@ static int nameserver_ioctl_destroy(
static int nameserver_ioctl_params_init(struct nameserver_cmd_args *cargs)
{
struct nameserver_params params;
s32 osstatus = 0;
s32 status = 0;
ulong size;
cargs->api_status = nameserver_params_init(&params);
size = copy_to_user(cargs->args.params_init.params, &params,
sizeof(struct nameserver_params));
if (size)
osstatus = -EFAULT;
status = -EFAULT;
return osstatus;
return status;
}
/*
......@@ -83,12 +83,12 @@ static int nameserver_ioctl_get_handle(struct nameserver_cmd_args *cargs)
{
void *handle = NULL;
char *name = NULL;
s32 osstatus = 0;
s32 status = 0;
ulong size;
name = kmalloc(cargs->args.get_handle.name_len + 1, GFP_KERNEL);
if (name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
......@@ -96,7 +96,7 @@ static int nameserver_ioctl_get_handle(struct nameserver_cmd_args *cargs)
size = copy_from_user(name, cargs->args.get_handle.name,
cargs->args.get_handle.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto name_from_usr_error;
}
......@@ -108,7 +108,7 @@ name_from_usr_error:
kfree(name);
exit:
return osstatus;
return status;
}
/*
......@@ -122,12 +122,12 @@ static int nameserver_ioctl_create(struct nameserver_cmd_args *cargs)
struct nameserver_params params;
void *handle = NULL;
char *name = NULL;
s32 osstatus = 0;
s32 status = 0;
ulong size;
name = kmalloc(cargs->args.create.name_len + 1, GFP_KERNEL);
if (name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
......@@ -135,14 +135,14 @@ static int nameserver_ioctl_create(struct nameserver_cmd_args *cargs)
size = copy_from_user(name, cargs->args.create.name,
cargs->args.create.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto copy_from_usr_error;
}
size = copy_from_user(&params, cargs->args.create.params,
sizeof(struct nameserver_params));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto copy_from_usr_error;
}
......@@ -154,7 +154,7 @@ copy_from_usr_error:
kfree(name);
exit:
return osstatus;
return status;
}
......@@ -182,12 +182,12 @@ static int nameserver_ioctl_add(struct nameserver_cmd_args *cargs)
char *name = NULL;
char *buf = NULL;
void *entry;
s32 osstatus = 0;
s32 status = 0;
ulong size;
name = kmalloc(cargs->args.add.name_len + 1, GFP_KERNEL);
if (name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
......@@ -195,20 +195,20 @@ static int nameserver_ioctl_add(struct nameserver_cmd_args *cargs)
size = copy_from_user(name, cargs->args.add.name,
cargs->args.add.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto name_from_usr_error;
}
buf = kmalloc(cargs->args.add.len, GFP_KERNEL);
if (buf == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto buf_alloc_error;
}
size = copy_from_user(buf, cargs->args.add.buf,
cargs->args.add.len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto buf_from_usr_error;
}
......@@ -226,7 +226,7 @@ name_from_usr_error:
kfree(name);
exit:
return osstatus;
return status;
}
......@@ -240,12 +240,12 @@ static int nameserver_ioctl_add_uint32(struct nameserver_cmd_args *cargs)
{
char *name = NULL;
void *entry;
s32 osstatus = 0;
s32 status = 0;
ulong size;
name = kmalloc(cargs->args.addu32.name_len + 1, GFP_KERNEL);
if (name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
......@@ -253,7 +253,7 @@ static int nameserver_ioctl_add_uint32(struct nameserver_cmd_args *cargs)
size = copy_from_user(name, cargs->args.addu32.name,
cargs->args.addu32.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto name_from_usr_error;
}
......@@ -266,7 +266,7 @@ name_from_usr_error:
kfree(name);
exit:
return osstatus;
return status;
}
......@@ -281,12 +281,12 @@ static int nameserver_ioctl_match(struct nameserver_cmd_args *cargs)
{
char *name = NULL;
u32 buf;
s32 osstatus = 0;
s32 status = 0;
ulong size;
name = kmalloc(cargs->args.match.name_len + 1, GFP_KERNEL);
if (name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
......@@ -294,7 +294,7 @@ static int nameserver_ioctl_match(struct nameserver_cmd_args *cargs)
size = copy_from_user(name, cargs->args.match.name,
cargs->args.match.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto name_from_usr_error;
}
......@@ -302,7 +302,7 @@ static int nameserver_ioctl_match(struct nameserver_cmd_args *cargs)
nameserver_match(cargs->args.match.handle, name, &buf);
size = copy_to_user(cargs->args.match.value, &buf, sizeof(u32 *));
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto buf_to_usr_error;
}
......@@ -311,7 +311,7 @@ name_from_usr_error:
kfree(name);
exit:
return osstatus;
return status;
}
/*
......@@ -323,12 +323,12 @@ exit:
static int nameserver_ioctl_remove(struct nameserver_cmd_args *cargs)
{
char *name = NULL;
s32 osstatus = 0;
s32 status = 0;
ulong size;
name = kmalloc(cargs->args.remove.name_len + 1, GFP_KERNEL);
if (name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
......@@ -336,7 +336,7 @@ static int nameserver_ioctl_remove(struct nameserver_cmd_args *cargs)
size = copy_from_user(name, cargs->args.remove.name,
cargs->args.remove.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto name_from_usr_error;
}
......@@ -347,7 +347,7 @@ name_from_usr_error:
kfree(name);
exit:
return osstatus;
return status;
}
......@@ -375,26 +375,26 @@ static int nameserver_ioctl_get_local(struct nameserver_cmd_args *cargs)
{
char *name = NULL;
char *buf = NULL;
s32 osstatus = 0;
s32 status = 0;
ulong size;
name = kmalloc(cargs->args.get_local.name_len + 1, GFP_KERNEL);
if (name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
name[cargs->args.get_handle.name_len] = '\0';
buf = kmalloc(cargs->args.get_local.len, GFP_KERNEL);
if (buf == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto buf_alloc_error;
}
size = copy_from_user(name, cargs->args.get_local.name,
cargs->args.get_local.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto name_from_usr_error;
}
......@@ -404,7 +404,7 @@ static int nameserver_ioctl_get_local(struct nameserver_cmd_args *cargs)
size = copy_to_user(cargs->args.get_local.buf, buf,
cargs->args.get_local.len);
if (size)
osstatus = -EFAULT;
status = -EFAULT;
name_from_usr_error:
kfree(buf);
......@@ -413,7 +413,7 @@ buf_alloc_error:
kfree(name);
exit:
return osstatus;
return status;
}
......@@ -428,39 +428,39 @@ static int nameserver_ioctl_get(struct nameserver_cmd_args *cargs)
char *name = NULL;
char *buf = NULL;
u16 *proc_id = NULL;
s32 osstatus = 0;
s32 status = 0;
ulong size;
name = kmalloc(cargs->args.get.name_len + 1, GFP_KERNEL);
if (name == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto exit;
}
name[cargs->args.get_handle.name_len] = '\0';
buf = kmalloc(cargs->args.get.len, GFP_KERNEL);
if (buf == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto buf_alloc_error;
}
proc_id = kmalloc(cargs->args.get.proc_len, GFP_KERNEL);
if (proc_id == NULL) {
osstatus = -ENOMEM;
status = -ENOMEM;
goto proc_alloc_error;
}
size = copy_from_user(name, cargs->args.get.name,
cargs->args.get.name_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto name_from_usr_error;
}
osstatus = copy_from_user(proc_id, cargs->args.get.proc_id,
status = copy_from_user(proc_id, cargs->args.get.proc_id,
cargs->args.get.proc_len);
if (size) {
osstatus = -EFAULT;
status = -EFAULT;
goto proc_from_usr_error;
}
......@@ -469,7 +469,7 @@ static int nameserver_ioctl_get(struct nameserver_cmd_args *cargs)
size = copy_to_user(cargs->args.get.buf, buf,
cargs->args.get.len);
if (size)
osstatus = -EFAULT;
status = -EFAULT;
proc_from_usr_error: /* Fall through */
......@@ -483,7 +483,7 @@ buf_alloc_error:
kfree(name);
exit:
return osstatus;
return status;
}
/*
......@@ -494,7 +494,7 @@ exit:
int nameserver_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_cmd_args __user *uarg =
(struct nameserver_cmd_args __user *)args;
......@@ -502,12 +502,12 @@ int nameserver_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;
}
......@@ -515,66 +515,66 @@ int nameserver_ioctl(struct inode *inode, struct file *filp,
size = copy_from_user(&cargs, uarg,
sizeof(struct nameserver_cmd_args));
if (size) {
os_status = -EFAULT;
status = -EFAULT;
goto exit;
}
switch (cmd) {
case CMD_NAMESERVER_ADD:
os_status = nameserver_ioctl_add(&cargs);
status = nameserver_ioctl_add(&cargs);
break;
case CMD_NAMESERVER_ADDUINT32:
os_status = nameserver_ioctl_add_uint32(&cargs);
status = nameserver_ioctl_add_uint32(&cargs);
break;
case CMD_NAMESERVER_GET:
os_status = nameserver_ioctl_get(&cargs);
status = nameserver_ioctl_get(&cargs);
break;
case CMD_NAMESERVER_GETLOCAL:
os_status = nameserver_ioctl_get_local(&cargs);
status = nameserver_ioctl_get_local(&cargs);
break;
case CMD_NAMESERVER_MATCH:
os_status = nameserver_ioctl_match(&cargs);
status = nameserver_ioctl_match(&cargs);
break;
case CMD_NAMESERVER_REMOVE:
os_status = nameserver_ioctl_remove(&cargs);
status = nameserver_ioctl_remove(&cargs);
break;
case CMD_NAMESERVER_REMOVEENTRY:
os_status = nameserver_ioctl_remove_entry(&cargs);
status = nameserver_ioctl_remove_entry(&cargs);
break;
case CMD_NAMESERVER_PARAMS_INIT:
os_status = nameserver_ioctl_params_init(&cargs);
status = nameserver_ioctl_params_init(&cargs);
break;
case CMD_NAMESERVER_CREATE:
os_status = nameserver_ioctl_create(&cargs);
status = nameserver_ioctl_create(&cargs);
break;
case CMD_NAMESERVER_DELETE:
os_status = nameserver_ioctl_delete(&cargs);
status = nameserver_ioctl_delete(&cargs);
break;
case CMD_NAMESERVER_GETHANDLE:
os_status = nameserver_ioctl_get_handle(&cargs);
status = nameserver_ioctl_get_handle(&cargs);
break;
case CMD_NAMESERVER_SETUP:
os_status = nameserver_ioctl_setup(&cargs);
status = nameserver_ioctl_setup(&cargs);
break;
case CMD_NAMESERVER_DESTROY:
os_status = nameserver_ioctl_destroy(&cargs);
status = nameserver_ioctl_destroy(&cargs);
break;
default:
WARN_ON(cmd);
os_status = -ENOTTY;
status = -ENOTTY;
break;
}
......@@ -582,11 +582,11 @@ int nameserver_ioctl(struct inode *inode, struct file *filp,
/* Copy the full args to the user-side. */
size = copy_to_user(uarg, &cargs, sizeof(struct nameserver_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