From 57dbbdd7af87c78c2d94157583ac2101e709be55 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 21 Feb 2012 13:43:04 +0200 Subject: [PATCH] atomisp: mt9m114: remove useless braces and spaces BZ: 24615 There is no need to use braces in case of oneline conditions. Also this patch fix indentation of some structures and condition lines. No functional change. Change-Id: I9802eb69374e807b9571296a281c4a4514235e16 Signed-off-by: Andy Shevchenko Reviewed-on: http://android.intel.com:8080/36102 Reviewed-by: Shevchenko, Andriy Reviewed-by: Cohen, David A Tested-by: Koski, Anttu Reviewed-by: buildbot Tested-by: buildbot --- drivers/media/video/atomisp/atomisp_cmd.c | 14 +++---- drivers/media/video/atomisp/atomisp_csi2.c | 27 +++++++------- drivers/media/video/atomisp/atomisp_ioctl.c | 2 +- drivers/media/video/atomisp/atomisp_subdev.c | 55 ++++++++++++++-------------- drivers/media/video/atomisp/hmm/hmm.c | 4 +- drivers/media/video/mt9m114.c | 4 +- 6 files changed, 53 insertions(+), 53 deletions(-) diff --git a/drivers/media/video/atomisp/atomisp_cmd.c b/drivers/media/video/atomisp/atomisp_cmd.c index 54dc1be..2cc5147 100644 --- a/drivers/media/video/atomisp/atomisp_cmd.c +++ b/drivers/media/video/atomisp/atomisp_cmd.c @@ -272,9 +272,8 @@ irqreturn_t atomisp_isr(int irq, void *dev) isp->isp3a_stat_ready = true; irq_infos &= ~SH_CSS_IRQ_INFO_STATISTICS_READY; } - if (irq_infos & SH_CSS_IRQ_INFO_FW_ACC_DONE) { + if (irq_infos & SH_CSS_IRQ_INFO_FW_ACC_DONE) signal_acceleration = true; - } } else if (irq_infos & SH_CSS_IRQ_INFO_CSS_RECEIVER_ERROR) { /* handle mipi receiver error*/ u32 rx_infos; @@ -1274,13 +1273,12 @@ bool atomisp_is_viewfinder_support(struct atomisp_device *isp) */ static void atomisp_update_capture_mode(struct atomisp_device *isp) { - if (isp->params.low_light) { + if (isp->params.low_light) sh_css_capture_set_mode(SH_CSS_CAPTURE_MODE_LOW_LIGHT); - } else if (isp->params.gdc_cac_en ) { + else if (isp->params.gdc_cac_en) sh_css_capture_set_mode(SH_CSS_CAPTURE_MODE_ADVANCED); - } else { + else sh_css_capture_set_mode(SH_CSS_CAPTURE_MODE_PRIMARY); - } } /* @@ -3923,9 +3921,11 @@ void flush_acc_api_arguments(struct sh_css_acc_fw *fw) enum atomisp_acc_arg_type type = sh_css_argument_type(fw, i); union host *host; size_t size; + switch (type) { case SH_CSS_ACC_ARG_PTR_STABLE: - if (sh_css_acc_is_stable(fw, i)) break; + if (sh_css_acc_is_stable(fw, i)) + break; /* Fall through */ case SH_CSS_ACC_ARG_FRAME: case SH_CSS_ACC_ARG_PTR_IN: diff --git a/drivers/media/video/atomisp/atomisp_csi2.c b/drivers/media/video/atomisp/atomisp_csi2.c index 0619db3..a20c8fa 100644 --- a/drivers/media/video/atomisp/atomisp_csi2.c +++ b/drivers/media/video/atomisp/atomisp_csi2.c @@ -82,24 +82,24 @@ csi2_try_format(struct atomisp_mipi_csi2_device *csi2, switch (pad) { case CSI2_PAD_SINK: - /* Clamp the width and height to valid range (1-8191). */ - for (i = 0; i < ARRAY_SIZE(csi2_input_fmts); i++) { + /* Clamp the width and height to valid range (1-8191). */ + for (i = 0; i < ARRAY_SIZE(csi2_input_fmts); i++) { if (fmt->code == csi2_input_fmts[i]) break; - } + } - /* If not found, use SGRBG10 as default */ - if (i >= ARRAY_SIZE(csi2_input_fmts)) + /* If not found, use SGRBG10 as default */ + if (i >= ARRAY_SIZE(csi2_input_fmts)) fmt->code = V4L2_MBUS_FMT_SBGGR10_1X10; - fmt->width = clamp_t(u32, fmt->width, 1, 4608); - fmt->height = clamp_t(u32, fmt->height, 1, 8191); - break; + fmt->width = clamp_t(u32, fmt->width, 1, 4608); + fmt->height = clamp_t(u32, fmt->height, 1, 8191); + break; case CSI2_PAD_SOURCE: /* Source format same as sink format, except for DPCM - * compression. - */ + * compression. + */ pixelcode = fmt->code; format = __csi2_get_format(csi2, fh, CSI2_PAD_SINK, which); memcpy(fmt, format, sizeof(*fmt)); @@ -109,6 +109,7 @@ csi2_try_format(struct atomisp_mipi_csi2_device *csi2, fmt->code = pixelcode; break; + default: break; } @@ -311,9 +312,9 @@ static int csi2_link_setup(struct media_entity *entity, if (flags & MEDIA_LNK_FL_ENABLED) { if (csi2->output & ~CSI2_OUTPUT_ISP_SUBDEV) return -EBUSY; - csi2->output |= CSI2_OUTPUT_ISP_SUBDEV; - } else { - csi2->output &= ~CSI2_OUTPUT_ISP_SUBDEV; + csi2->output |= CSI2_OUTPUT_ISP_SUBDEV; + } else { + csi2->output &= ~CSI2_OUTPUT_ISP_SUBDEV; } break; diff --git a/drivers/media/video/atomisp/atomisp_ioctl.c b/drivers/media/video/atomisp/atomisp_ioctl.c index 2359de5..d49a8f7 100644 --- a/drivers/media/video/atomisp/atomisp_ioctl.c +++ b/drivers/media/video/atomisp/atomisp_ioctl.c @@ -1664,7 +1664,7 @@ static long atomisp_vidioc_default(struct file *file, void *fh, case ATOMISP_IOC_S_DIS_VECTOR: return atomisp_set_dis_vector(isp, - (struct atomisp_dis_vector*) arg); + (struct atomisp_dis_vector *) arg); case ATOMISP_IOC_G_ISP_PARM: return atomisp_param(isp, 0, arg); diff --git a/drivers/media/video/atomisp/atomisp_subdev.c b/drivers/media/video/atomisp/atomisp_subdev.c index b749cb5..3ea75f9 100644 --- a/drivers/media/video/atomisp/atomisp_subdev.c +++ b/drivers/media/video/atomisp/atomisp_subdev.c @@ -68,8 +68,8 @@ static const unsigned int isp_subdev_mo_output_fmts[] = { }; /* -* V4L2 subdev operations -*/ + * V4L2 subdev operations + */ /* * isp_subdev_get_ctrl - V4L2 control get handler @@ -77,7 +77,7 @@ static const unsigned int isp_subdev_mo_output_fmts[] = { * @ctrl: V4L2 control * * Return 0 on success or a negative error code otherwise. -*/ + */ static int isp_subdev_get_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) { @@ -90,7 +90,7 @@ static int isp_subdev_get_ctrl(struct v4l2_subdev *sd, * @ctrl: V4L2 control * * Return 0 on success or a negative error code otherwise. -*/ + */ static int isp_subdev_set_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) { @@ -104,7 +104,7 @@ static int isp_subdev_set_ctrl(struct v4l2_subdev *sd, * @arg: ioctl argument * * Return 0 on success or a negative error code otherwise. -*/ + */ static long isp_subdev_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) { @@ -119,7 +119,7 @@ static long isp_subdev_ioctl(struct v4l2_subdev *sd, * @on: power on/off * * Return 0 on success or a negative error code otherwise. -*/ + */ static int isp_subdev_set_power(struct v4l2_subdev *sd, int on) { return 0; @@ -183,7 +183,7 @@ __isp_subdev_get_format(struct atomisp_sub_device *isp_subdev, * @fh : V4L2 subdev file handle * @pad: Pad number * @fmt: Format -*/ + */ static void isp_subdev_try_format(struct atomisp_sub_device *isp_subdev, struct v4l2_subdev_fh *fh, @@ -291,7 +291,7 @@ isp_subdev_try_format(struct atomisp_sub_device *isp_subdev, * @fh : V4L2 subdev file handle * @code: pointer to v4l2_subdev_pad_mbus_code_enum structure * return -EINVAL or zero on success -*/ + */ static int isp_subdev_enum_mbus_code(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, struct v4l2_subdev_mbus_code_enum *code) @@ -367,7 +367,7 @@ static int isp_subdev_enum_frame_size(struct v4l2_subdev *sd, * * Return 0 on success or -EINVAL if the pad is invalid or doesn't correspond * to the format type. -*/ + */ static int isp_subdev_get_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, struct v4l2_subdev_format *fmt) { @@ -393,7 +393,7 @@ static int isp_subdev_get_format(struct v4l2_subdev *sd, * * Return 0 on success or -EINVAL if the pad is invalid or doesn't correspond * to the format type. -*/ + */ static int isp_subdev_set_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, struct v4l2_subdev_format *fmt) { @@ -426,40 +426,39 @@ static int isp_subdev_set_format(struct v4l2_subdev *sd, return 0; } - /* V4L2 subdev core operations */ - static const struct v4l2_subdev_core_ops isp_subdev_v4l2_core_ops = { +/* V4L2 subdev core operations */ +static const struct v4l2_subdev_core_ops isp_subdev_v4l2_core_ops = { .g_ctrl = isp_subdev_get_ctrl, .s_ctrl = isp_subdev_set_ctrl, .ioctl = isp_subdev_ioctl, .s_power = isp_subdev_set_power, .subscribe_event = isp_subdev_subscribe_event, .unsubscribe_event = isp_subdev_unsubscribe_event, - }; +}; - /* V4L2 subdev video operations */ - static const struct v4l2_subdev_video_ops isp_subdev_v4l2_video_ops = { +/* V4L2 subdev video operations */ +static const struct v4l2_subdev_video_ops isp_subdev_v4l2_video_ops = { .s_stream = isp_subdev_set_stream, - }; +}; - /* V4L2 subdev pad operations */ - static const struct v4l2_subdev_pad_ops isp_subdev_v4l2_pad_ops = { +/* V4L2 subdev pad operations */ +static const struct v4l2_subdev_pad_ops isp_subdev_v4l2_pad_ops = { .enum_mbus_code = isp_subdev_enum_mbus_code, .enum_frame_size = isp_subdev_enum_frame_size, .get_fmt = isp_subdev_get_format, .set_fmt = isp_subdev_set_format, - }; +}; - /* V4L2 subdev operations */ - static const struct v4l2_subdev_ops isp_subdev_v4l2_ops = { +/* V4L2 subdev operations */ +static const struct v4l2_subdev_ops isp_subdev_v4l2_ops = { .core = &isp_subdev_v4l2_core_ops, .video = &isp_subdev_v4l2_video_ops, .pad = &isp_subdev_v4l2_pad_ops, - }; +}; static void isp_subdev_init_params(struct atomisp_sub_device *isp_subdev) { /* parameters initialization */ - } /* @@ -527,18 +526,18 @@ static int isp_subdev_link_setup(struct media_entity *entity, return 0; } - /* media operations */ - static const struct media_entity_operations isp_subdev_media_ops = { +/* media operations */ +static const struct media_entity_operations isp_subdev_media_ops = { .link_setup = isp_subdev_link_setup, /* .set_power = v4l2_subdev_set_power, */ - }; +}; /* * isp_subdev_init_entities - Initialize V4L2 subdev and media entity * @isp_subdev: ISP CCDC module * * Return 0 on success and a negative error code on failure. -*/ + */ static int isp_subdev_init_entities(struct atomisp_sub_device *isp_subdev) { struct v4l2_subdev *sd = &isp_subdev->subdev; @@ -664,7 +663,7 @@ error: * TODO: Get the initialisation values from platform data. * * Return 0 on success or a negative error code otherwise. -*/ + */ int atomisp_subdev_init(struct atomisp_device *isp) { struct atomisp_sub_device *isp_subdev = &isp->isp_subdev; diff --git a/drivers/media/video/atomisp/hmm/hmm.c b/drivers/media/video/atomisp/hmm/hmm.c index 2121ef6..e099591 100644 --- a/drivers/media/video/atomisp/hmm/hmm.c +++ b/drivers/media/video/atomisp/hmm/hmm.c @@ -242,13 +242,13 @@ int hmm_load(void *virt, void *data, unsigned int bytes) "hmm_load NULL argument\n"); return -EINVAL; } - return load_and_flush (virt, data, bytes); + return load_and_flush(virt, data, bytes); } /*Flush hmm data from the data cache*/ int hmm_flush(void *virt, unsigned int bytes) { - return load_and_flush (virt, NULL, bytes); + return load_and_flush(virt, NULL, bytes); } /*Write function in ISP memory management*/ diff --git a/drivers/media/video/mt9m114.c b/drivers/media/video/mt9m114.c index 490a269..72f9bb8 100644 --- a/drivers/media/video/mt9m114.c +++ b/drivers/media/video/mt9m114.c @@ -1168,9 +1168,9 @@ static int mt9m114_s_stream(struct v4l2_subdev *sd, int enable) */ if (mt9m114_wait_3a(sd)) v4l2_warn(c, "3A can not finish!"); - } - else + } else { ret = mt9m114_set_suspend(sd); + } return ret; } -- 2.7.4