Commit 451ff373 authored by Jochen Maes's avatar Jochen Maes Committed by Greg Kroah-Hartman

staging: dream: another Codestyle patch

Fixed code style issues.
Signed-off-by: default avatarJochen Maes <jochen.maes@sejo.be>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent df16b962
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Copyright (C) 2008-2009 QUALCOMM Incorporated. * Copyright (C) 2008-2009 QUALCOMM Incorporated.
*/ */
//FIXME: most allocations need not be GFP_ATOMIC /* FIXME: most allocations need not be GFP_ATOMIC
/* FIXME: management of mutexes */ /* FIXME: management of mutexes */
/* FIXME: msm_pmem_region_lookup return values */ /* FIXME: msm_pmem_region_lookup return values */
/* FIXME: way too many copy to/from user */ /* FIXME: way too many copy to/from user */
...@@ -76,14 +76,14 @@ static LIST_HEAD(msm_sensors); ...@@ -76,14 +76,14 @@ static LIST_HEAD(msm_sensors);
list_del_init(&qcmd->list); \ list_del_init(&qcmd->list); \
kfree(qcmd); \ kfree(qcmd); \
}; \ }; \
} while(0) } while (0)
#define MSM_DRAIN_QUEUE(sync, name) do { \ #define MSM_DRAIN_QUEUE(sync, name) do { \
unsigned long flags; \ unsigned long flags; \
spin_lock_irqsave(&(sync)->name##_lock, flags); \ spin_lock_irqsave(&(sync)->name##_lock, flags); \
MSM_DRAIN_QUEUE_NOSYNC(sync, name); \ MSM_DRAIN_QUEUE_NOSYNC(sync, name); \
spin_unlock_irqrestore(&(sync)->name##_lock, flags); \ spin_unlock_irqrestore(&(sync)->name##_lock, flags); \
} while(0) } while (0)
static int check_overlap(struct hlist_head *ptype, static int check_overlap(struct hlist_head *ptype,
unsigned long paddr, unsigned long paddr,
...@@ -361,7 +361,7 @@ static int __msm_get_frame(struct msm_sync *sync, ...@@ -361,7 +361,7 @@ static int __msm_get_frame(struct msm_sync *sync,
if (!frame->buffer) { if (!frame->buffer) {
pr_err("%s: cannot get frame, invalid lookup address " pr_err("%s: cannot get frame, invalid lookup address "
"y=%x cbcr=%x offset=%d\n", "y=%x cbcr=%x offset=%d\n",
__FUNCTION__, __func__,
pphy->y_phy, pphy->y_phy,
pphy->cbcr_phy, pphy->cbcr_phy,
frame->y_off); frame->y_off);
...@@ -455,7 +455,7 @@ static int msm_disable_vfe(struct msm_sync *sync, void __user *arg) ...@@ -455,7 +455,7 @@ static int msm_disable_vfe(struct msm_sync *sync, void __user *arg)
return rc; return rc;
} }
static struct msm_queue_cmd* __msm_control(struct msm_sync *sync, static struct msm_queue_cmd *__msm_control(struct msm_sync *sync,
struct msm_control_device_queue *queue, struct msm_control_device_queue *queue,
struct msm_queue_cmd *qcmd, struct msm_queue_cmd *qcmd,
int timeout) int timeout)
...@@ -592,7 +592,6 @@ static int msm_control(struct msm_control_device *ctrl_pmsm, ...@@ -592,7 +592,6 @@ static int msm_control(struct msm_control_device *ctrl_pmsm,
* a result of a successful completion, we are freeing the qcmd that * a result of a successful completion, we are freeing the qcmd that
* we dequeued from queue->ctrl_status_q. * we dequeued from queue->ctrl_status_q.
*/ */
if (qcmd)
kfree(qcmd); kfree(qcmd);
CDBG("msm_control: end rc = %d\n", rc); CDBG("msm_control: end rc = %d\n", rc);
...@@ -670,7 +669,7 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg) ...@@ -670,7 +669,7 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg)
&(stats.fd)); &(stats.fd));
if (!stats.buffer) { if (!stats.buffer) {
pr_err("%s: msm_pmem_stats_ptov_lookup error\n", pr_err("%s: msm_pmem_stats_ptov_lookup error\n",
__FUNCTION__); __func__);
rc = -EINVAL; rc = -EINVAL;
goto failure; goto failure;
} }
...@@ -718,8 +717,7 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg) ...@@ -718,8 +717,7 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg)
buf.fmain.buffer = buf.fmain.buffer =
(unsigned long)region.vaddr; (unsigned long)region.vaddr;
buf.fmain.fd = region.fd; buf.fmain.fd = region.fd;
} } else {
else {
pr_err("%s: pmem lookup failed\n", pr_err("%s: pmem lookup failed\n",
__func__); __func__);
rc = -EINVAL; rc = -EINVAL;
...@@ -796,7 +794,6 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg) ...@@ -796,7 +794,6 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg)
} }
failure: failure:
if (qcmd)
kfree(qcmd); kfree(qcmd);
CDBG("msm_get_stats: %d\n", rc); CDBG("msm_get_stats: %d\n", rc);
...@@ -838,8 +835,8 @@ static int msm_ctrl_cmd_done(struct msm_control_device *ctrl_pmsm, ...@@ -838,8 +835,8 @@ static int msm_ctrl_cmd_done(struct msm_control_device *ctrl_pmsm,
kfree(qcmd); kfree(qcmd);
goto end; goto end;
} }
} } else
else ctrlcmd->value = NULL; ctrlcmd->value = NULL;
end: end:
CDBG("msm_ctrl_cmd_done: end rc = %d\n", rc); CDBG("msm_ctrl_cmd_done: end rc = %d\n", rc);
...@@ -869,14 +866,14 @@ static int msm_config_vfe(struct msm_sync *sync, void __user *arg) ...@@ -869,14 +866,14 @@ static int msm_config_vfe(struct msm_sync *sync, void __user *arg)
return -EFAULT; return -EFAULT;
} }
switch(cfgcmd.cmd_type) { switch (cfgcmd.cmd_type) {
case CMD_STATS_ENABLE: case CMD_STATS_ENABLE:
axi_data.bufnum1 = axi_data.bufnum1 =
msm_pmem_region_lookup(&sync->stats, msm_pmem_region_lookup(&sync->stats,
MSM_PMEM_AEC_AWB, &region[0], MSM_PMEM_AEC_AWB, &region[0],
NUM_WB_EXP_STAT_OUTPUT_BUFFERS); NUM_WB_EXP_STAT_OUTPUT_BUFFERS);
if (!axi_data.bufnum1) { if (!axi_data.bufnum1) {
pr_err("%s: pmem region lookup error\n", __FUNCTION__); pr_err("%s: pmem region lookup error\n", __func__);
return -EINVAL; return -EINVAL;
} }
axi_data.region = &region[0]; axi_data.region = &region[0];
...@@ -888,7 +885,7 @@ static int msm_config_vfe(struct msm_sync *sync, void __user *arg) ...@@ -888,7 +885,7 @@ static int msm_config_vfe(struct msm_sync *sync, void __user *arg)
MSM_PMEM_AF, &region[0], MSM_PMEM_AF, &region[0],
NUM_AF_STAT_OUTPUT_BUFFERS); NUM_AF_STAT_OUTPUT_BUFFERS);
if (!axi_data.bufnum1) { if (!axi_data.bufnum1) {
pr_err("%s: pmem region lookup error\n", __FUNCTION__); pr_err("%s: pmem region lookup error\n", __func__);
return -EINVAL; return -EINVAL;
} }
axi_data.region = &region[0]; axi_data.region = &region[0];
...@@ -899,7 +896,7 @@ static int msm_config_vfe(struct msm_sync *sync, void __user *arg) ...@@ -899,7 +896,7 @@ static int msm_config_vfe(struct msm_sync *sync, void __user *arg)
break; break;
default: default:
pr_err("%s: unknown command type %d\n", pr_err("%s: unknown command type %d\n",
__FUNCTION__, cfgcmd.cmd_type); __func__, cfgcmd.cmd_type);
return -EINVAL; return -EINVAL;
} }
...@@ -928,7 +925,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, ...@@ -928,7 +925,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync,
msm_pmem_region_lookup(&sync->frame, pmem_type, msm_pmem_region_lookup(&sync->frame, pmem_type,
&region[0], 8); &region[0], 8);
if (!axi_data.bufnum1) { if (!axi_data.bufnum1) {
pr_err("%s: pmem region lookup error\n", __FUNCTION__); pr_err("%s: pmem region lookup error\n", __func__);
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -939,7 +936,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, ...@@ -939,7 +936,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync,
msm_pmem_region_lookup(&sync->frame, pmem_type, msm_pmem_region_lookup(&sync->frame, pmem_type,
&region[0], 8); &region[0], 8);
if (!axi_data.bufnum2) { if (!axi_data.bufnum2) {
pr_err("%s: pmem region lookup error\n", __FUNCTION__); pr_err("%s: pmem region lookup error\n", __func__);
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -950,7 +947,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, ...@@ -950,7 +947,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync,
msm_pmem_region_lookup(&sync->frame, pmem_type, msm_pmem_region_lookup(&sync->frame, pmem_type,
&region[0], 8); &region[0], 8);
if (!axi_data.bufnum1) { if (!axi_data.bufnum1) {
pr_err("%s: pmem region lookup error\n", __FUNCTION__); pr_err("%s: pmem region lookup error\n", __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -959,7 +956,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, ...@@ -959,7 +956,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync,
msm_pmem_region_lookup(&sync->frame, pmem_type, msm_pmem_region_lookup(&sync->frame, pmem_type,
&region[axi_data.bufnum1], 8); &region[axi_data.bufnum1], 8);
if (!axi_data.bufnum2) { if (!axi_data.bufnum2) {
pr_err("%s: pmem region lookup error\n", __FUNCTION__); pr_err("%s: pmem region lookup error\n", __func__);
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -970,7 +967,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, ...@@ -970,7 +967,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync,
msm_pmem_region_lookup(&sync->frame, pmem_type, msm_pmem_region_lookup(&sync->frame, pmem_type,
&region[0], 8); &region[0], 8);
if (!axi_data.bufnum2) { if (!axi_data.bufnum2) {
pr_err("%s: pmem region lookup error\n", __FUNCTION__); pr_err("%s: pmem region lookup error\n", __func__);
return -EINVAL; return -EINVAL;
} }
break; break;
...@@ -981,7 +978,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync, ...@@ -981,7 +978,7 @@ static int msm_frame_axi_cfg(struct msm_sync *sync,
default: default:
pr_err("%s: unknown command type %d\n", pr_err("%s: unknown command type %d\n",
__FUNCTION__, cfgcmd->cmd_type); __func__, cfgcmd->cmd_type);
return -EINVAL; return -EINVAL;
} }
...@@ -1047,7 +1044,7 @@ static int __msm_put_frame_buf(struct msm_sync *sync, ...@@ -1047,7 +1044,7 @@ static int __msm_put_frame_buf(struct msm_sync *sync,
rc = sync->vfefn.vfe_config(&cfgcmd, &pphy); rc = sync->vfefn.vfe_config(&cfgcmd, &pphy);
} else { } else {
pr_err("%s: msm_pmem_frame_vtop_lookup failed\n", pr_err("%s: msm_pmem_frame_vtop_lookup failed\n",
__FUNCTION__); __func__);
rc = -EINVAL; rc = -EINVAL;
} }
...@@ -1131,7 +1128,7 @@ static int msm_stats_axi_cfg(struct msm_sync *sync, ...@@ -1131,7 +1128,7 @@ static int msm_stats_axi_cfg(struct msm_sync *sync,
break; break;
default: default:
pr_err("%s: unknown command type %d\n", pr_err("%s: unknown command type %d\n",
__FUNCTION__, cfgcmd->cmd_type); __func__, cfgcmd->cmd_type);
return -EINVAL; return -EINVAL;
} }
...@@ -1140,7 +1137,7 @@ static int msm_stats_axi_cfg(struct msm_sync *sync, ...@@ -1140,7 +1137,7 @@ static int msm_stats_axi_cfg(struct msm_sync *sync,
msm_pmem_region_lookup(&sync->stats, pmem_type, msm_pmem_region_lookup(&sync->stats, pmem_type,
&region[0], NUM_WB_EXP_STAT_OUTPUT_BUFFERS); &region[0], NUM_WB_EXP_STAT_OUTPUT_BUFFERS);
if (!axi_data.bufnum1) { if (!axi_data.bufnum1) {
pr_err("%s: pmem region lookup error\n", __FUNCTION__); pr_err("%s: pmem region lookup error\n", __func__);
return -EINVAL; return -EINVAL;
} }
axi_data.region = &region[0]; axi_data.region = &region[0];
...@@ -1177,7 +1174,7 @@ static int msm_put_stats_buffer(struct msm_sync *sync, void __user *arg) ...@@ -1177,7 +1174,7 @@ static int msm_put_stats_buffer(struct msm_sync *sync, void __user *arg)
cfgcmd.cmd_type = CMD_STATS_AF_BUF_RELEASE; cfgcmd.cmd_type = CMD_STATS_AF_BUF_RELEASE;
else { else {
pr_err("%s: invalid buf type %d\n", pr_err("%s: invalid buf type %d\n",
__FUNCTION__, __func__,
buf.type); buf.type);
rc = -EINVAL; rc = -EINVAL;
goto put_done; goto put_done;
...@@ -1223,7 +1220,7 @@ static int msm_axi_config(struct msm_sync *sync, void __user *arg) ...@@ -1223,7 +1220,7 @@ static int msm_axi_config(struct msm_sync *sync, void __user *arg)
default: default:
pr_err("%s: unknown command type %d\n", pr_err("%s: unknown command type %d\n",
__FUNCTION__, __func__,
cfgcmd.cmd_type); cfgcmd.cmd_type);
return -EINVAL; return -EINVAL;
} }
...@@ -1622,7 +1619,7 @@ static int msm_release_control(struct inode *node, struct file *filep) ...@@ -1622,7 +1619,7 @@ static int msm_release_control(struct inode *node, struct file *filep)
int rc; int rc;
struct msm_control_device *ctrl_pmsm = filep->private_data; struct msm_control_device *ctrl_pmsm = filep->private_data;
struct msm_device *pmsm = ctrl_pmsm->pmsm; struct msm_device *pmsm = ctrl_pmsm->pmsm;
printk("msm_camera: RELEASE %s\n", filep->f_path.dentry->d_name.name); printk(KERN_INFO "msm_camera: RELEASE %s\n", filep->f_path.dentry->d_name.name);
rc = __msm_release(pmsm->sync); rc = __msm_release(pmsm->sync);
if (!rc) { if (!rc) {
MSM_DRAIN_QUEUE(&ctrl_pmsm->ctrl_q, ctrl_status_q); MSM_DRAIN_QUEUE(&ctrl_pmsm->ctrl_q, ctrl_status_q);
...@@ -1636,7 +1633,7 @@ static int msm_release_frame(struct inode *node, struct file *filep) ...@@ -1636,7 +1633,7 @@ static int msm_release_frame(struct inode *node, struct file *filep)
{ {
int rc; int rc;
struct msm_device *pmsm = filep->private_data; struct msm_device *pmsm = filep->private_data;
printk("msm_camera: RELEASE %s\n", filep->f_path.dentry->d_name.name); printk(KERN_INFO "msm_camera: RELEASE %s\n", filep->f_path.dentry->d_name.name);
rc = __msm_release(pmsm->sync); rc = __msm_release(pmsm->sync);
if (!rc) { if (!rc) {
MSM_DRAIN_QUEUE(pmsm->sync, prev_frame_q); MSM_DRAIN_QUEUE(pmsm->sync, prev_frame_q);
...@@ -1720,7 +1717,7 @@ static void msm_vfe_sync(struct msm_vfe_resp *vdata, ...@@ -1720,7 +1717,7 @@ static void msm_vfe_sync(struct msm_vfe_resp *vdata,
qcmd->type = qtype; qcmd->type = qtype;
if (qtype == MSM_CAM_Q_VFE_MSG) { if (qtype == MSM_CAM_Q_VFE_MSG) {
switch(vdata->type) { switch (vdata->type) {
case VFE_MSG_OUTPUT1: case VFE_MSG_OUTPUT1:
case VFE_MSG_OUTPUT2: case VFE_MSG_OUTPUT2:
qcmd_frame = qcmd_frame =
...@@ -1931,7 +1928,7 @@ static int __msm_v4l2_control(struct msm_sync *sync, ...@@ -1931,7 +1928,7 @@ static int __msm_v4l2_control(struct msm_sync *sync,
memcpy(out->value, ctrl->value, ctrl->length); memcpy(out->value, ctrl->value, ctrl->length);
end: end:
if (rcmd) kfree(rcmd); kfree(rcmd);
CDBG("__msm_v4l2_control: end rc = %d\n", rc); CDBG("__msm_v4l2_control: end rc = %d\n", rc);
return rc; return rc;
} }
......
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