Message ID | 20231227133516.1356553-1-bhavin.sharma@siliconsignals.io |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-12038-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1433947dyb; Wed, 27 Dec 2023 05:36:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IH4vhjWhNf8rhwRnehj1mb5DCNhLImKYwtelVKbLa/4JcffOUOHEmtrIc5h+CVvPvjYxmTX X-Received: by 2002:a17:906:3e18:b0:a1d:4f5c:57f5 with SMTP id k24-20020a1709063e1800b00a1d4f5c57f5mr3548780eji.78.1703684178313; Wed, 27 Dec 2023 05:36:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703684178; cv=pass; d=google.com; s=arc-20160816; b=F7bAjJE03B8yvpFKeDpXzVRiOIey0P1tiW4QiScdA/a+c9Pl53GRcpB/P6wVW1WZL/ 9A92XgmjJVG2It0tpCi31gf7QXZG6mzujVUTQOFT+35JWNMNpCV0Gao8AqyYywB19RcZ 5Xu9TSS/pXt7fts4Xm66erz12Gx6lyBGOL18R7eqjMHFqkpf66XcKYqA2FIs7MrgpSmL 7+L43ZvBOFiEpKJCWuAMogyYEtJci7xnlLflXuypbXWW4dhkOFI0Jq7Kw/5dWwqTyBwR WbfbAChfwt9Y1vM0EL0s7O7bUF2kdA6icaYL0yODe2MEXEVX/0lrH9wZxgd4Wcpdy71M MKPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:message-id:date:subject:cc:to:from; bh=r3cgDzAw48TGeTPr5ou9ig6S3k5bZk1qzBNtZOrIB4c=; fh=Ba8YAjmPxw7t6/MEvLwF8Boyj67/gxb6tyLRZUrDA7c=; b=SYnOVTwVJk/KItDVgyeq05WWJT1TpTUm9f+C7AIv/wWo6nY1bOyjeOKgs3mXxnTtyl CKquB6qgIlc5btYI53wN96hI1Bx6WMDq/ADqI/cIwZal4/zqVA5X89PJlJPPINFRAS7q RxerTzorSvhR7woqNFyvYEt/Sg5rW2xErdqhcnC5JgzURm4rCCJXUraNLPcH7NBPCCkh epRQFzilKScyLY6piX8WhVfVvOWnQTKu9nzBKA2m0K9pWLACpr24x1u29CZKdPUopts3 VRp6+dOJFKDPJFtq7n5soP43SkyhASwmg9rpGtQbBanxYSo5axvydBGHPzwTp2OIMx9C 9jWQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=siliconsignals.io dkim=pass dkdomain=siliconsignals.io dmarc=pass fromdomain=siliconsignals.io); spf=pass (google.com: domain of linux-kernel+bounces-12038-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12038-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gh7-20020a1709073c0700b00a2331cf051asi5817016ejc.95.2023.12.27.05.36.18 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 05:36:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12038-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=siliconsignals.io dkim=pass dkdomain=siliconsignals.io dmarc=pass fromdomain=siliconsignals.io); spf=pass (google.com: domain of linux-kernel+bounces-12038-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12038-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C3CB71F21692 for <ouuuleilei@gmail.com>; Wed, 27 Dec 2023 13:36:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5884D4502C; Wed, 27 Dec 2023 13:36:01 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from IND01-MAX-obe.outbound.protection.outlook.com (mail-maxind01on2082.outbound.protection.outlook.com [40.107.222.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48035446B3; Wed, 27 Dec 2023 13:35:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=siliconsignals.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=siliconsignals.io ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CGUNGRmPOcTw5Vq4MXA/8J0GLYlBf+70DWljl8pg2pQnukHVoeoZz6mjEr+Kbt/qKI4/H/KYSUIrf/VWwmIB7jUoBemQHcy3q6B+g7klSvB2BNL20lZU0nCrqBhEa3LVjpDCjh1u5zS3iLL/qGwnOXD5l/Li6clEfSM/3f857BiICmHKYOAqDegG2w1R2JPRbdZWomk6U30mCH4VsCx7S2SBBs64jLW5rIxp6VzXISU10xEpyUPbEJaqxnERrO/Y0vLGspEytyigNVydn62SvRw87P2a8nCpDi3K0nnE71hY0TY2EaU/5a4C76fII6G2p8+Bvpk/U0p60fMlNGrLbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r3cgDzAw48TGeTPr5ou9ig6S3k5bZk1qzBNtZOrIB4c=; b=IfvcWgx7C16yJeB6xNb/ndFWIS4wJQ9aAgo4rZIRdvocg+Czzo+fSxPctH32u1WSHn5QavTknN9i7bIflG6sps3CdCBvSLYM1oMNFL/778mIWUbRROqfl8NRnJ4Qj6cZLWBRWEPxYy8PcA3h47fU7aQlbp/MnVHmPY/S6CcdohtzZtCiCv0czyeCqN3PosTe1C4FHP+Z4l4yTdqDo2o1epypqwpQHaE5JY/YeUrYel0UtJHD0C009Ntk/cWBaK1fzvzLFbHdut1qQGXG4RQ60/y9q0FRzqdTfYg7swrTK/hl5GEYHhBMgpvnv5iDt1E+n6OMB6Ma5HH7naMShcq6/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siliconsignals.io; dmarc=pass action=none header.from=siliconsignals.io; dkim=pass header.d=siliconsignals.io; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siliconsignals.io; Received: from MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:42::6) by PN3PR01MB9565.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:105::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Wed, 27 Dec 2023 13:35:54 +0000 Received: from MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM ([fe80::c1b:b2aa:7fc0:6532]) by MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM ([fe80::c1b:b2aa:7fc0:6532%7]) with mapi id 15.20.7113.027; Wed, 27 Dec 2023 13:35:54 +0000 From: Bhavin Sharma <bhavin.sharma@siliconsignals.io> To: lars@metafoo.de, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: bhavin.sharma@siliconsignals.io Subject: [PATCH] media: adv7180: Fix cppcheck warnings and errors Date: Wed, 27 Dec 2023 19:05:16 +0530 Message-Id: <20231227133516.1356553-1-bhavin.sharma@siliconsignals.io> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PN3PR01CA0144.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:bf::11) To MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:42::6) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MAZPR01MB6957:EE_|PN3PR01MB9565:EE_ X-MS-Office365-Filtering-Correlation-Id: ee1605d0-4143-4a71-353c-08dc06e0bf96 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wVDkY2eF1E2dHpoxKlNyzdKYkdO7dUWnfwYYL69q213SVOqrch6yNxgBndPrwA29bTriVz2+KmEq1Dn4j3bEf4WgLJg2BaWI07zRdOiWpILlm252sVt8rE6246SRLT32OKukXoX+tltNdgWUsCrwRK6xzppCl6f9Ou1bhnfrvB1JVN2A4mWPSFTwwwu79fB1kIAndyy3gmjptWBk0VIpmHxzLLq9aQJ0MpB1OJ61embHQGg5eDsdFuJ2tc0uIh1GYPiI1EwwfvgdAb2f68UUhy8550G4QdAbGjtIsAOwQYTYVG4wj16ZA6yUQGOKl7njsidxzgBB5MQ4rwdmdresNr7jMBqKH8WxSo0jx//O0MH+yM1HuQuq5MylRjKNRNnzkbzZu/FpbL2mc5Rgg4S9urE/6gHeXAGZuXhb0ZwfCokWUm8vajtsEIncc4l8jMNKMNlNwTsSEYlxelxprdBjGLZCOYnCDwbnPJ7vFAMC1+9QKgndodmOcMhcLBifmdiS22EXhSpuYFeKiv5XAQxYJReapU4V+wrbVVhcGRk4GlIaf+iVh53SHRGRG387xt2To8fqccvOc9siULE6+9+l8m/xKARsal2gH7VnZc15PDfnX8sZgN/PpQeLjHeDJ2OJDcjL8Kyvy+O3UE0+RiGrku1Yl4dz1yYLtII9NQj5Pr0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(396003)(376002)(346002)(39830400003)(230173577357003)(230922051799003)(230273577357003)(186009)(451199024)(64100799003)(1800799012)(38350700005)(83380400001)(66556008)(316002)(66476007)(66946007)(6666004)(44832011)(8676002)(8936002)(4326008)(6506007)(6512007)(52116002)(107886003)(1076003)(478600001)(2616005)(38100700002)(26005)(6486002)(41300700001)(5660300002)(2906002)(4744005)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3/lrf5MmLXqeDpIDiOFE/+bmJ7XT3NBTG94StFjH4oUb25JFRvHIPvP9GafG88rHCmcjT7tmjxXhRMywPBGxoQxQTxWTxcv7PtS5Qm3qB+4Bw2tKchu8UODjINSZx3dJFYGL44AQtyNRTJofRzf9K0YaV2sU0QPZc5UxdyqfTBl4DLq0TRq8Ays+UPy8hOGmSrYy5YznEBNG8sKwVa4n61GTEb/wE2rxsCkMNy9cHizFeYMTR1s1gpIHhh8qoGzUSnfSTgwbHMYhYeeUBrK0LWa6OzbpZ8N54zeWeNNJ9sn396tDvGvkgCixNYaN57mjgmLyLUBY/YXko7J9zIv+AqisDV+D+jboz+JPpjjdkjKMIpPufH5nKLrop4BfahauhbIxJuZ9PtWlR3xlZftLGMmJU+p2yhmX37T2/ARCa149m2ovd8XFh2Fu6ao5BXwpm6LNH8vZ2sHqq7KLkgse7srawaYv+TPRRrB2heq4hp4ePCU7oMT0wxwhW9AXpkFAaK9pgFGxZr1VWhL8f54geQUV5v8IF3gwgS9QYe6XkMmjGd00PAN1N5wVbAdZIbbQrE1tSxyiPZGsslCXf+g+SdXDgG7/Yt21yNISPweiv9CeLPgxq/ymP9eH9LtrVNW0YvlK9CpjUZd3LEMl8BpRYsRyvLPAdpWvkpfZL7m1Lm3E621g3NGWETvnwm9Y+2jBWCAwAu2xqwNbFlmwxgmPSsnS+3WF8tQoP4VYExZFm0T2MigNz/jOuMywFqfFCjw0vAHt7+NFmrPwWmPYHs3Xfpjqs+v3q60VOheuPzVpVugkTR4H8n9iom0eT2Le9DwIiHHvCXzmtBfBbDMKiL6oTPa6gZnsSEaHed9Vzm3oz3jbDMlbeeuuqaOHF7/OwSJOkzQkQfELnfdRaFQJXDIOjtAzS7e+WgxwD7VUF6zuQgh0RawFrURAZgCQ9Vq70gg0uT/n8tSs+196GsqODH/NyOAMeC+viWSltWKI0rJfN8DVMSF8JlvxQzkuOoSVDVrv8OhYWMy/3fgHurLpV2i5MFHvgCQDrBgDP3Hwq4p99gcS/34GGm0cvCQS1J8rq8MWu6ndIO6+LEEu8WMpOCDzVu5ss7D/YyhTQWQrW4ZgYZG3YVMvOXDEkfIF8ESnS9ZLGy28aJtpA+dTBKzcXNSDAZTCREkoDmXZ7/0YBSmPQbFpbLrR7gmvU1PtMYfkUHnKUCyMSQlTGerjGL7gzMIY0YWc6JaWpCgpnJbCo1bvlzGiwOUVn3H27EEqSLQ4rH9dbtQ06JpaQ4qkoyRzDu+uXPZ4hAR9dvW3rlNADNhumqhjZI7VPFLIvfOqU5SPAApJPAGU2a5KeSyAu1XLRDtjxjopV4YDFONzRvgdxoiJyd+1yNn2QVzsAudXXBSaVCCLji+rnEjna+1a4PHgOV2K2fFJKWQIEDoJgohQdd+tNPsnRHnQKH1W+H8fzchIC7lnLJBUCZJvgyL8QEvocmgMnM40jwvzXq54/9nSGXGfo7WHR5RQcdJ3/ndTJC5LGYWFLuyk/B7HoxYBR72JkcjY1DPT/O8vBuLn+uEJgFLmns/9NCy3mYgfr/e+hUXPBm0BS2/5y0+UJeyWoLyT89MtTBac/cJo7i5Qv5s2iRPsw1s= X-OriginatorOrg: siliconsignals.io X-MS-Exchange-CrossTenant-Network-Message-Id: ee1605d0-4143-4a71-353c-08dc06e0bf96 X-MS-Exchange-CrossTenant-AuthSource: MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2023 13:35:54.1412 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 7ec5089e-a433-4bd1-a638-82ee62e21d37 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6cS3DR0b91/zQiHqDj7WG4xx4TdxOK5BxzheKkKo6A55nG8SrFXyDkWRdV5TDpl63NRdRmLfK4Og/42fT8DQ3HDDBzj2Z8dHGNbYyfKVgHs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN3PR01MB9565 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786442340918627801 X-GMAIL-MSGID: 1786442340918627801 |
Series |
media: adv7180: Fix cppcheck warnings and errors
|
|
Commit Message
Bhavin Sharma
Dec. 27, 2023, 1:35 p.m. UTC
WARNING: Missing a blank line after declarations
ERROR: else should follow close brace '}'
Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
Comments
Quoting Bhavin Sharma (2023-12-27 13:35:16) > WARNING: Missing a blank line after declarations > ERROR: else should follow close brace '}' > > Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io> > > diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c > index 54134473186b..91756116eff7 100644 > --- a/drivers/media/i2c/adv7180.c > +++ b/drivers/media/i2c/adv7180.c > @@ -357,6 +357,7 @@ static int adv7180_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) > { > struct adv7180_state *state = to_state(sd); Personally, I would keep the if (err) hugging the line it's associated with. > int err = mutex_lock_interruptible(&state->mutex); > + > if (err) > return err; > > @@ -411,6 +412,7 @@ static int adv7180_g_input_status(struct v4l2_subdev *sd, u32 *status) > { > struct adv7180_state *state = to_state(sd); > int ret = mutex_lock_interruptible(&state->mutex); > + > if (ret) > return ret; > > @@ -1046,8 +1048,7 @@ static int adv7182_init(struct adv7180_state *state) > ADV7180_REG_EXTENDED_OUTPUT_CONTROL, > 0x17); > } > - } > - else > + } else I think kernel code style requires an else clause following a multiline scope to also have its scope enclosed in braces even if it's a single statement. -- Kieran > adv7180_write(state, > ADV7180_REG_EXTENDED_OUTPUT_CONTROL, > 0x07); > -- > 2.25.1 >
Thanks for the reply, Kieran >> WARNING: Missing a blank line after declarations >> ERROR: else should follow close brace '}' >> >> Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io> >> >> diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c >> index 54134473186b..91756116eff7 100644 >> --- a/drivers/media/i2c/adv7180.c >> +++ b/drivers/media/i2c/adv7180.c >> @@ -357,6 +357,7 @@ static int adv7180_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) >> { >> struct adv7180_state *state = to_state(sd); >>Personally, I would keep the if (err) hugging the line it's associated with. If we follow the code base pattern for this diver, we are getting same online space in conditional if statements. So, we need to make changes there also. >> int err = mutex_lock_interruptible(&state->mutex); >> + >> if (err) >> return err; >> >> @@ -411,6 +412,7 @@ static int adv7180_g_input_status(struct v4l2_subdev *sd, u32 *status) >> { >> struct adv7180_state *state = to_state(sd); >> int ret = mutex_lock_interruptible(&state->mutex); >> + >> if (ret) >> return ret; >> >> @@ -1046,8 +1048,7 @@ static int adv7182_init(struct adv7180_state *state) >> ADV7180_REG_EXTENDED_OUTPUT_CONTROL, >> 0x17); >> } >> - } >> - else >> + } else >>I think kernel code style requires an else clause following a multiline scope to also have its scope enclosed in braces even if it's a single statement. On many places in driver there is single statement after else without closing So, we have to make changes in those places also. So, better I should make changes in all places and make version V2 patch. Please give your suggestions. -- Bhavin Sharma >> adv7180_write(state, >> ADV7180_REG_EXTENDED_OUTPUT_CONTROL, >> 0x07); >> -- >> 2.25.1 >>
Quoting Bhavin Sharma (2023-12-29 13:37:14) > Thanks for the reply,�Kieran > > >> WARNING: Missing a blank line after declarations > >> ERROR: else should follow close brace '}' > >> > >> Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io> > >> > >> diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c > >> index 54134473186b..91756116eff7 100644 > >> --- a/drivers/media/i2c/adv7180.c > >> +++ b/drivers/media/i2c/adv7180.c > >> @@ -357,6 +357,7 @@ static int adv7180_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) > >>� { > >>�������� struct adv7180_state *state = to_state(sd); > > >>Personally, I would keep the if (err) hugging the line it's associated > with. > > If we follow the code base pattern for this diver, we are getting same online space in conditional if statements. > So, we need to make changes there also. If there are multiple places in a file for the same fixup, then indeed - make them all in a single patch as a single cleanup. > >>�������� int err = mutex_lock_interruptible(&state->mutex); > >> + > >>�������� if (err) > >>���������������� return err; > >>� > >> @@ -411,6 +412,7 @@ static int adv7180_g_input_status(struct v4l2_subdev *sd, u32 *status) > >>� { > >>�������� struct adv7180_state *state = to_state(sd); > >>�������� int ret = mutex_lock_interruptible(&state->mutex); > >> + > >>�������� if (ret) > >>���������������� return ret; > >>� > >> @@ -1046,8 +1048,7 @@ static int adv7182_init(struct adv7180_state *state) > >>���������������������������������������������� ADV7180_REG_EXTENDED_OUTPUT_CONTROL, > >>���������������������������������������������� 0x17); > >>������������������������ } > >> -�������������� } > >> -�������������� else > >> +�������������� } else > > >>I think kernel code style requires an else clause following a multiline > scope to also have its scope enclosed in braces even if it's a single > statement. > > On many places in driver there is single statement after else without closing� > So, we have to make changes in those places also. > > So, better I should make changes in all places and make version V2 patch. Yes, but you should probably tackle both cleanups as two patches covering the whole file for each cleanup. -- Kieran > > Please give your suggestions. > > -- > Bhavin Sharma > > >>������������������������ adv7180_write(state, > >>�������������������������������������� ADV7180_REG_EXTENDED_OUTPUT_CONTROL, > >>�������������������������������������� 0x07); > >> -- > >> 2.25.1 > >>
Hi, > Quoting Bhavin Sharma (2023-12-29 13:37:14) >> Thanks for the reply,�Kieran >> >> >> WARNING: Missing a blank line after declarations >> >> ERROR: else should follow close brace '}' >> >> >> >> Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io> >> >> >> >> diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c >> >> index 54134473186b..91756116eff7 100644 >> >> --- a/drivers/media/i2c/adv7180.c >> >> +++ b/drivers/media/i2c/adv7180.c >> >> @@ -357,6 +357,7 @@ static int adv7180_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) >> >>� { >> >>�������� struct adv7180_state *state = to_state(sd); >> >> >>Personally, I would keep the if (err) hugging the line it's associated >> with. >> >> If we follow the code base pattern for this diver, we are getting same online space in conditional if statements. >> So, we need to make changes there also. > If there are multiple places in a file for the same fixup, then indeed - > make them all in a single patch as a single cleanup. >> >>�������� int err = mutex_lock_interruptible(&state->mutex); >> >> + >> >>�������� if (err) >> >>���������������� return err; >> >>� >> >> @@ -411,6 +412,7 @@ static int adv7180_g_input_status(struct v4l2_subdev *sd, u32 *status) >> >>� { >> >>�������� struct adv7180_state *state = to_state(sd); >> >>�������� int ret = mutex_lock_interruptible(&state->mutex); >> >> + >> >>�������� if (ret) >> >>���������������� return ret; >> >>� >> >> @@ -1046,8 +1048,7 @@ static int adv7182_init(struct adv7180_state *state) >> >>���������������������������������������������� ADV7180_REG_EXTENDED_OUTPUT_CONTROL, >> >>���������������������������������������������� 0x17); >> >>������������������������ } >> >> -�������������� } >> >> -�������������� else >> >> +�������������� } else >> >> >>I think kernel code style requires an else clause following a multiline >> scope to also have its scope enclosed in braces even if it's a single >> statement. >> >> On many places in driver there is single statement after else without closing� >> So, we have to make changes in those places also. >> >> So, better I should make changes in all places and make version V2 patch. > Yes, but you should probably tackle both cleanups as two patches > covering the whole file for each cleanup. I have submitted two different patches each for separate cleanups. Any update on those patches? Thank you, Bhavin Sharma
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c index 54134473186b..91756116eff7 100644 --- a/drivers/media/i2c/adv7180.c +++ b/drivers/media/i2c/adv7180.c @@ -357,6 +357,7 @@ static int adv7180_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) { struct adv7180_state *state = to_state(sd); int err = mutex_lock_interruptible(&state->mutex); + if (err) return err; @@ -411,6 +412,7 @@ static int adv7180_g_input_status(struct v4l2_subdev *sd, u32 *status) { struct adv7180_state *state = to_state(sd); int ret = mutex_lock_interruptible(&state->mutex); + if (ret) return ret; @@ -1046,8 +1048,7 @@ static int adv7182_init(struct adv7180_state *state) ADV7180_REG_EXTENDED_OUTPUT_CONTROL, 0x17); } - } - else + } else adv7180_write(state, ADV7180_REG_EXTENDED_OUTPUT_CONTROL, 0x07);