From patchwork Fri Nov 23 10:13:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10695523 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 794AD1750 for ; Fri, 23 Nov 2018 10:13:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A47928516 for ; Fri, 23 Nov 2018 10:13:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C81E2851D; Fri, 23 Nov 2018 10:13:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDAA82C4DB for ; Fri, 23 Nov 2018 10:13:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390316AbeKWU5I (ORCPT ); Fri, 23 Nov 2018 15:57:08 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:55752 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390102AbeKWU5I (ORCPT ); Fri, 23 Nov 2018 15:57:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=zDHUPgOZUtUr2P4M5Y6R8qDKHfPbtPettjMx2qupsTQ=; b=m69C00yc4eXn450Y/NSIJz3D+ p5FuckD22oyAOsQShWyuPJrso+MuM6wWKi0T61YZr0W3y0zj3PVuJQFSBxtl12BYO0enppOGMyFXI s1Jz7CV+cIECDMitl3AaNkyi5TDqjtTP0hUjostPuqghlffwhZDm+hITs5c11TqJq+iordjZiOcas TqDWq1UOqifzJaTZCsQJrmxvQEIApxca1mND0inoOf5Q2lD/fBq40Eur522DPCSW66Bh+bGE8SOrV LZ3LZELfrhyti/e75fi1IUmy/t8boSkTXlutN3aLd0JFvyVlUwZOpBjAy86By7a3CwyOZ7nq5EQLI dzEUZGFIg==; Received: from 201.47.163.210.dynamic.adsl.gvt.net.br ([201.47.163.210] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gQ8Sm-0006hM-7z; Fri, 23 Nov 2018 10:13:28 +0000 Received: from mchehab by bombadil.infradead.org with local (Exim 4.91) (envelope-from ) id 1gQ8Si-0000i3-6U; Fri, 23 Nov 2018 05:13:24 -0500 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Mauro Carvalho Chehab , Yong Deng , Maxime Ripard , Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] media: sum6i-csi: Fix a few coding style issues Date: Fri, 23 Nov 2018 05:13:22 -0500 Message-Id: X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make checkpatch.pl happier by running it on strict mode and using the --fix-inline to solve some issues. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 9 ++++----- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h | 2 +- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_reg.h | 2 +- drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c | 10 +++++----- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c index 7af55ad142dc..89fe2c1e21a8 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c @@ -279,7 +279,6 @@ static enum csi_output_fmt get_csi_output_format(struct sun6i_csi_dev *sdev, static enum csi_input_seq get_csi_input_seq(struct sun6i_csi_dev *sdev, u32 mbus_code, u32 pixformat) { - switch (pixformat) { case V4L2_PIX_FMT_HM12: case V4L2_PIX_FMT_NV12: @@ -543,7 +542,7 @@ int sun6i_csi_update_config(struct sun6i_csi *csi, { struct sun6i_csi_dev *sdev = sun6i_csi_to_dev(csi); - if (config == NULL) + if (!config) return -EINVAL; memcpy(&csi->config, config, sizeof(csi->config)); @@ -644,7 +643,7 @@ static int sun6i_subdev_notify_complete(struct v4l2_async_notifier *notifier) dev_dbg(csi->dev, "notify complete, all subdevs registered\n"); sd = list_first_entry(&v4l2_dev->subdevs, struct v4l2_subdev, list); - if (sd == NULL) + if (!sd) return -EINVAL; ret = sun6i_csi_link_entity(csi, &sd->entity, sd->fwnode); @@ -810,7 +809,7 @@ static int sun6i_csi_resource_request(struct sun6i_csi_dev *sdev, return PTR_ERR(io_base); sdev->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "bus", io_base, - &sun6i_csi_regmap_config); + &sun6i_csi_regmap_config); if (IS_ERR(sdev->regmap)) { dev_err(&pdev->dev, "Failed to init register map\n"); return PTR_ERR(sdev->regmap); @@ -853,7 +852,7 @@ static int sun6i_csi_resource_request(struct sun6i_csi_dev *sdev, /* * PHYS_OFFSET isn't available on all architectures. In order to - * accomodate for COMPILE_TEST, let's define it to something dumb. + * accommodate for COMPILE_TEST, let's define it to something dumb. */ #if defined(CONFIG_COMPILE_TEST) && !defined(PHYS_OFFSET) #define PHYS_OFFSET 0 diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h index bd9be36aabfe..0bb000712c33 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.h @@ -55,7 +55,7 @@ struct sun6i_csi { * @mbus_code: media bus format code (MEDIA_BUS_FMT_*) */ bool sun6i_csi_is_format_supported(struct sun6i_csi *csi, u32 pixformat, - u32 mbus_code); + u32 mbus_code); /** * sun6i_csi_set_power() - power on/off the csi diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_reg.h b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_reg.h index 3a55836a5a4d..d9b6d89f1927 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_reg.h +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_reg.h @@ -37,7 +37,7 @@ #define CSI_IF_CFG_IF_DATA_WIDTH_12BIT ((2 << 8) & CSI_IF_CFG_IF_DATA_WIDTH_MASK) #define CSI_IF_CFG_MIPI_IF_MASK BIT(7) #define CSI_IF_CFG_MIPI_IF_CSI (0 << 7) -#define CSI_IF_CFG_MIPI_IF_MIPI (1 << 7) +#define CSI_IF_CFG_MIPI_IF_MIPI BIT(7) #define CSI_IF_CFG_CSI_IF_MASK GENMASK(4, 0) #define CSI_IF_CFG_CSI_IF_YUV422_INTLV ((0 << 0) & CSI_IF_CFG_CSI_IF_MASK) #define CSI_IF_CFG_CSI_IF_YUV422_16BIT ((1 << 0) & CSI_IF_CFG_CSI_IF_MASK) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c index e1901a38726f..306b9d2aeafb 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c @@ -86,9 +86,9 @@ sun6i_video_remote_subdev(struct sun6i_video *video, u32 *pad) } static int sun6i_video_queue_setup(struct vb2_queue *vq, - unsigned int *nbuffers, unsigned int *nplanes, - unsigned int sizes[], - struct device *alloc_devs[]) + unsigned int *nbuffers, unsigned int *nplanes, + unsigned int sizes[], + struct device *alloc_devs[]) { struct sun6i_video *video = vb2_get_drv_priv(vq); unsigned int size = video->fmt.fmt.pix.sizeimage; @@ -308,7 +308,7 @@ static const struct vb2_ops sun6i_csi_vb2_ops = { }; static int vidioc_querycap(struct file *file, void *priv, - struct v4l2_capability *cap) + struct v4l2_capability *cap) { struct sun6i_video *video = video_drvdata(file); @@ -403,7 +403,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, } static int vidioc_enum_input(struct file *file, void *fh, - struct v4l2_input *inp) + struct v4l2_input *inp) { if (inp->index != 0) return -EINVAL;