From: Luca Ellero Date: Thu, 10 Jul 2014 09:03:56 +0000 (+0200) Subject: staging: ced1401: fix ced_set_event() X-Git-Tag: v4.14-rc1~7109^2~987 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1b3ca658d3bae78b96f2764326772ada78d6211;p=platform%2Fkernel%2Flinux-rpi.git staging: ced1401: fix ced_set_event() Rename camel case arguments and locals in function ced_set_event() Signed-off-by: Luca Ellero Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c index f632d2f..f00aff6 100644 --- a/drivers/staging/ced1401/ced_ioc.c +++ b/drivers/staging/ced1401/ced_ioc.c @@ -821,33 +821,40 @@ int ced_unset_transfer(struct ced_data *ced, int area) ** pretend that whatever the user asked for was achieved, so we return 1 if ** try to create one, and 0 if they ask to remove (assuming all else was OK). ****************************************************************************/ -int ced_set_event(struct ced_data *ced, struct transfer_event __user *pTE) +int ced_set_event(struct ced_data *ced, struct transfer_event __user *ute) { - int iReturn = U14ERR_NOERROR; + int ret = U14ERR_NOERROR; struct transfer_event te; /* get a local copy of the data */ - if (copy_from_user(&te, pTE, sizeof(te))) + if (copy_from_user(&te, ute, sizeof(te))) return -EFAULT; if (te.wAreaNum >= MAX_TRANSAREAS) /* the area must exist */ return U14ERR_BADAREA; else { - struct transarea *pTA = &ced->trans_def[te.wAreaNum]; - mutex_lock(&ced->io_mutex); /* make sure we have no competitor */ + struct transarea *ta = &ced->trans_def[te.wAreaNum]; + + /* make sure we have no competitor */ + mutex_lock(&ced->io_mutex); spin_lock_irq(&ced->staged_lock); - if (pTA->used) { /* area must be in use */ - pTA->event_st = te.dwStart; /* set area regions */ - pTA->event_sz = te.dwLength; /* set size (0 cancels it) */ - pTA->event_to_host = te.wFlags & 1; /* set the direction */ - pTA->wake_up = 0; /* zero the wake up count */ + + if (ta->used) { /* area must be in use */ + ta->event_st = te.dwStart; /* set area regions */ + + /* set size (0 cancels it) */ + ta->event_sz = te.dwLength; + + /* set the direction */ + ta->event_to_host = te.wFlags & 1; + ta->wake_up = 0; /* zero the wake up count */ } else - iReturn = U14ERR_NOTSET; + ret = U14ERR_NOTSET; spin_unlock_irq(&ced->staged_lock); mutex_unlock(&ced->io_mutex); } - return iReturn == - U14ERR_NOERROR ? (te.iSetEvent ? 1 : U14ERR_NOERROR) : iReturn; + return ret == + U14ERR_NOERROR ? (te.iSetEvent ? 1 : U14ERR_NOERROR) : ret; } /**************************************************************************** diff --git a/drivers/staging/ced1401/usb1401.h b/drivers/staging/ced1401/usb1401.h index 2e88db8..d18755b 100644 --- a/drivers/staging/ced1401/usb1401.h +++ b/drivers/staging/ced1401/usb1401.h @@ -232,7 +232,8 @@ extern int ced_get_string(struct ced_data *ced, char __user *user, int n); extern int ced_set_transfer(struct ced_data *ced, struct transfer_area_desc __user *utd); extern int ced_unset_transfer(struct ced_data *ced, int area); -extern int ced_set_event(struct ced_data *ced, struct transfer_event __user *pTE); +extern int ced_set_event(struct ced_data *ced, + struct transfer_event __user *ute); extern int ced_stat_1401(struct ced_data *ced); extern int ced_line_count(struct ced_data *ced); extern int ced_get_out_buf_space(struct ced_data *ced);