From patchwork Tue Feb 27 15:40:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10245693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5AC4D60211 for ; Tue, 27 Feb 2018 15:42:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4184E28A0F for ; Tue, 27 Feb 2018 15:42:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 401FF28E1F; Tue, 27 Feb 2018 15:42:18 +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=-6.9 required=2.0 tests=BAYES_00,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 D1E1F28A0F for ; Tue, 27 Feb 2018 15:40:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753423AbeB0Pku (ORCPT ); Tue, 27 Feb 2018 10:40:50 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50359 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753163AbeB0Pku (ORCPT ); Tue, 27 Feb 2018 10:40:50 -0500 Received: from w540.lan (unknown [IPv6:2001:b07:2e0:f265:b1a6:a124:afcf:59d5]) (Authenticated sender: jacopo@jmondi.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 458CA172104; Tue, 27 Feb 2018 16:40:47 +0100 (CET) From: Jacopo Mondi To: mchehab@s-opensource.com, laurent.pinchart@ideasonboard.com, hans.verkuil@cisco.com, g.liakhovetski@gmx.de, bhumirks@gmail.com Cc: Jacopo Mondi , linux-media@vger.kernel.org Subject: [PATCH 04/13] media: tw9910: Re-order variables declaration Date: Tue, 27 Feb 2018 16:40:21 +0100 Message-Id: <1519746030-15407-5-git-send-email-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519746030-15407-1-git-send-email-jacopo+renesas@jmondi.org> References: <1519746030-15407-1-git-send-email-jacopo+renesas@jmondi.org> 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 Re-order variables declaration to respect 'reverse christmas tree' ordering whenever possible. Signed-off-by: Jacopo Mondi --- drivers/media/i2c/tw9910.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/media/i2c/tw9910.c b/drivers/media/i2c/tw9910.c index 45afdb9..f88cc93 100644 --- a/drivers/media/i2c/tw9910.c +++ b/drivers/media/i2c/tw9910.c @@ -406,9 +406,9 @@ static void tw9910_reset(struct i2c_client *client) static int tw9910_power(struct i2c_client *client, int enable) { - int ret; u8 acntl1; u8 acntl2; + int ret; if (enable) { acntl1 = 0; @@ -428,8 +428,8 @@ static int tw9910_power(struct i2c_client *client, int enable) static const struct tw9910_scale_ctrl *tw9910_select_norm(v4l2_std_id norm, u32 width, u32 height) { - const struct tw9910_scale_ctrl *scale; const struct tw9910_scale_ctrl *ret = NULL; + const struct tw9910_scale_ctrl *scale; __u32 diff = 0xffffffff, tmp; int size, i; @@ -462,8 +462,8 @@ static int tw9910_s_stream(struct v4l2_subdev *sd, int enable) { struct i2c_client *client = v4l2_get_subdevdata(sd); struct tw9910_priv *priv = to_tw9910(client); - u8 val; int ret; + u8 val; if (!enable) { switch (priv->revision) { @@ -512,10 +512,10 @@ static int tw9910_s_std(struct v4l2_subdev *sd, v4l2_std_id norm) { struct i2c_client *client = v4l2_get_subdevdata(sd); struct tw9910_priv *priv = to_tw9910(client); - const unsigned int hact = 720; const unsigned int hdelay = 15; - unsigned int vact; + const unsigned int hact = 720; unsigned int vdelay; + unsigned int vact; int ret; if (!(norm & (V4L2_STD_NTSC | V4L2_STD_PAL))) @@ -761,8 +761,8 @@ static int tw9910_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *format) { - struct v4l2_mbus_framefmt *mf = &format->format; struct i2c_client *client = v4l2_get_subdevdata(sd); + struct v4l2_mbus_framefmt *mf = &format->format; struct tw9910_priv *priv = to_tw9910(client); if (format->pad) @@ -813,8 +813,8 @@ static int tw9910_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg, struct v4l2_subdev_format *format) { - struct v4l2_mbus_framefmt *mf = &format->format; struct i2c_client *client = v4l2_get_subdevdata(sd); + struct v4l2_mbus_framefmt *mf = &format->format; struct tw9910_priv *priv = to_tw9910(client); const struct tw9910_scale_ctrl *scale; @@ -851,8 +851,8 @@ static int tw9910_set_fmt(struct v4l2_subdev *sd, static int tw9910_video_probe(struct i2c_client *client) { struct tw9910_priv *priv = to_tw9910(client); - s32 id; int ret; + s32 id; /* * tw9910 only use 8 or 16 bit bus width @@ -949,10 +949,9 @@ static int tw9910_probe(struct i2c_client *client, const struct i2c_device_id *did) { - struct tw9910_priv *priv; - struct tw9910_video_info *info; - struct i2c_adapter *adapter = - to_i2c_adapter(client->dev.parent); + struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); + struct tw9910_video_info *info; + struct tw9910_priv *priv; int ret; if (!client->dev.platform_data) {