Message ID | 20221122132330.30408-1-lukas.bulwahn@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2199297wrr; Tue, 22 Nov 2022 05:29:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf5+oCISR2++X/7wo/o9n5X1+RwxKr9mG3PMsQsZfs3V82C4Fs+M8a9qn8MKxVrkuexpYB0i X-Received: by 2002:a63:f34c:0:b0:477:b473:9693 with SMTP id t12-20020a63f34c000000b00477b4739693mr417677pgj.471.1669123787527; Tue, 22 Nov 2022 05:29:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669123787; cv=none; d=google.com; s=arc-20160816; b=U4yYWoqCSyj9iuLrtEXLedc5qvlWKKd3v441Ou/9YiN37qNDQ9VejLqRmfOzZryN5Y uCCDwDgnCg7DbpotnXstyD8cqd+sbc0fNbUIsuvg911GpLrEsvmfpHP5ycUkGn6d85Bs Nyyw1RI+SPeIv2jTDpVREUXj7yc2cOYcN/olUkDRfDlH8IWjqsOTy+IoW/tuitYkvo/p Abz8cH0qNm/c7YH+V+uhKu29LiHuAaGBky9rdagcNJRFnDuS30dR+YWBgJ//NJ3PqOOV SGv7HCwvs/Nra04GUGH5r68FFKnAFqRzu9Dl3gv294Vk1HBKbVognwo3kLDKef6X4nsL z4fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=WV4i7O8BzgnNi9s3HIsw9M8JIdyfTKAykF37RMUEeDI=; b=KUoOU08B28IgZy0aKgKXGdoRMczXyhpbgdIaSra41qCjkbJEaC7EXGy1y8dT8yreSO QupAcNEu8x6ok9k35BGuD42vBplMCuMKrKaAUtFBqCmx2cOPyMNJtVaIiqplf4pzj3b3 mbkpY7+MdPxOp4mPCCqnY/hZnE7pnubpQZOOWAjtBGjlWndG8/Ink/Uuq9F/Nz85JoKd 0NR/wFi+TtBfkVz1MxDc+hYb5P75VKcnN94L+lU1SbFTPMbVa8NT26FAiKopucsnTAiC k3Sv82Q/Z1KjZ3A0sBMXyWv87CyswxUas0WFZtY0uH2kD4CvwIvkEag2Q1ZlRkJWBFRl XIwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FmwPwbnr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t185-20020a6381c2000000b0047715beb2a5si887515pgd.150.2022.11.22.05.29.11; Tue, 22 Nov 2022 05:29:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FmwPwbnr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233768AbiKVNYH (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Tue, 22 Nov 2022 08:24:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233721AbiKVNX6 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 22 Nov 2022 08:23:58 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C4D81A07D; Tue, 22 Nov 2022 05:23:51 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id m22so35688067eji.10; Tue, 22 Nov 2022 05:23:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WV4i7O8BzgnNi9s3HIsw9M8JIdyfTKAykF37RMUEeDI=; b=FmwPwbnr0QiwbN9cFi0HeIzq91QfJ9NAmquz0Iv6i36HQBqvOLp7Xbg/fMhtUACapS 2W5H6W73OAc6rbsdatD8MTqCkgrmhxEPVkoQwhbQwq7frlPhDLzqs7IWxoWcEcmlZAOt hZPaLY0H6iDWRRpzclVQuU8j/nK0rI7fWRYG5uaHTCpz8W6UhCP2WpdQXBd1kFC5ZglH OH/pWbbGqFRMuIZkp9PeHgOlTUuGf8mBarEUFQvkfarXgHildhXmJzv0/R7ZX4bMB9aS XPkuXpLV7mDnnF5mxRoJRm1OuiwRmL1/PJGZ0UxNKkdWkTHtRPIopDZziAAA7DnxWNLm UaWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WV4i7O8BzgnNi9s3HIsw9M8JIdyfTKAykF37RMUEeDI=; b=SeoH4GLIMknVVJ67q8a4MeO7+K5Iq4uufNvAxVuTGDp40SBob0hAuodzzJznL3Q0n7 BzC9loyhnfjls0OqyebgWfsLAZW08DoQrOhwSCdyceFsKoSm7NPGm5KQIc68KLdrGhxZ JxUNfGJwCr5yEYSSD1exdPK0RN5Rw68FsvRbZb1ZBty3TJeOkW7drjnmqfWtSp3jGuIi UQQkMIteDX7Q4aYJHd3lKNtyLsiLG54V1FcI0Sa0W071lyN651nW5ZGWo5Hdm8BzMSNK ghyAYj1uFOrR+FiwsIuHhI7AzhZcODi8Fxa8wCn7vv9GBMPFsB+0m7Dzx4PITPnhePOU TvmA== X-Gm-Message-State: ANoB5pnpeqsPcA4vOV8lnmyYdSylwEjWM6TTt77FFRd4YigdUxYqgkk0 z6wirOGrakAu9RYKHuC9/Bk= X-Received: by 2002:a17:906:1244:b0:78d:d4ca:21f7 with SMTP id u4-20020a170906124400b0078dd4ca21f7mr20059292eja.128.1669123430366; Tue, 22 Nov 2022 05:23:50 -0800 (PST) Received: from felia.fritz.box (200116b8267b3700c41d4e99e424db57.dip.versatel-1u1.de. [2001:16b8:267b:3700:c41d:4e99:e424:db57]) by smtp.gmail.com with ESMTPSA id bd27-20020a056402207b00b004585eba4baesm5429717edb.80.2022.11.22.05.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 05:23:49 -0800 (PST) From: Lukas Bulwahn <lukas.bulwahn@gmail.com> To: Steve Longerbeam <slongerbeam@gmail.com>, Philipp Zabel <p.zabel@pengutronix.de>, Mauro Carvalho Chehab <mchehab@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Lukas Bulwahn <lukas.bulwahn@gmail.com> Subject: [PATCH] media: imx: remove code for non-existing config IMX_GPT_ICAP Date: Tue, 22 Nov 2022 14:23:30 +0100 Message-Id: <20221122132330.30408-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750203144763595752?= X-GMAIL-MSGID: =?utf-8?q?1750203144763595752?= |
Series |
media: imx: remove code for non-existing config IMX_GPT_ICAP
|
|
Commit Message
Lukas Bulwahn
Nov. 22, 2022, 1:23 p.m. UTC
There never was a config IMX_GPT_ICAP in the repository. So remove the code
conditional on this config and simplify the callers that just called empty
functions.
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
drivers/staging/media/imx/imx-media-fim.c | 54 -----------------------
1 file changed, 54 deletions(-)
Comments
Hi Lukas, On Tue, Nov 22, 2022 at 02:23:30PM +0100, Lukas Bulwahn wrote: > There never was a config IMX_GPT_ICAP in the repository. So remove the code > conditional on this config and simplify the callers that just called empty > functions. > > Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> > --- > drivers/staging/media/imx/imx-media-fim.c | 54 ----------------------- > 1 file changed, 54 deletions(-) > > diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c > index 3a9182933508..19a48eb445fd 100644 > --- a/drivers/staging/media/imx/imx-media-fim.c > +++ b/drivers/staging/media/imx/imx-media-fim.c > @@ -187,54 +187,6 @@ static void frame_interval_monitor(struct imx_media_fim *fim, > send_fim_event(fim, error_avg); > } > > -#ifdef CONFIG_IMX_GPT_ICAP > -/* > - * Input Capture method of measuring frame intervals. Not subject > - * to interrupt latency. > - */ > -static void fim_input_capture_handler(int channel, void *dev_id, > - ktime_t timestamp) > -{ > - struct imx_media_fim *fim = dev_id; > - unsigned long flags; > - > - spin_lock_irqsave(&fim->lock, flags); > - > - frame_interval_monitor(fim, timestamp); > - > - if (!completion_done(&fim->icap_first_event)) > - complete(&fim->icap_first_event); > - > - spin_unlock_irqrestore(&fim->lock, flags); > -} > - > -static int fim_request_input_capture(struct imx_media_fim *fim) > -{ > - init_completion(&fim->icap_first_event); > - > - return mxc_request_input_capture(fim->icap_channel, > - fim_input_capture_handler, > - fim->icap_flags, fim); > -} > - > -static void fim_free_input_capture(struct imx_media_fim *fim) > -{ > - mxc_free_input_capture(fim->icap_channel, fim); > -} > - > -#else /* CONFIG_IMX_GPT_ICAP */ > - > -static int fim_request_input_capture(struct imx_media_fim *fim) > -{ > - return 0; > -} > - > -static void fim_free_input_capture(struct imx_media_fim *fim) > -{ > -} > - > -#endif /* CONFIG_IMX_GPT_ICAP */ > - > /* > * In case we are monitoring the first frame interval after streamon > * (when fim->num_skip = 0), we need a valid fim->last_ts before we > @@ -435,14 +387,8 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim, > spin_unlock_irqrestore(&fim->lock, flags); > > if (icap_enabled(fim)) { > - ret = fim_request_input_capture(fim); > - if (ret) > - goto out; > fim_acquire_first_ts(fim); > } As suggested by the checkpatch.pl: WARNING: braces {} are not necessary for single statement blocks > - } else { > - if (icap_enabled(fim)) > - fim_free_input_capture(fim); > } > > fim->stream_on = on; > -- > 2.17.1 > Apart of this, patch looks good to me. Thanks. Regards, Tommaso
On Tue, Nov 22, 2022 at 5:09 PM Tommaso Merciai <tommaso.merciai@amarulasolutions.com> wrote: > > Hi Lukas, > > On Tue, Nov 22, 2022 at 02:23:30PM +0100, Lukas Bulwahn wrote: > > There never was a config IMX_GPT_ICAP in the repository. So remove the code > > conditional on this config and simplify the callers that just called empty > > functions. > > > > Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> > > --- > > drivers/staging/media/imx/imx-media-fim.c | 54 ----------------------- > > 1 file changed, 54 deletions(-) > > > > diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c > > index 3a9182933508..19a48eb445fd 100644 > > --- a/drivers/staging/media/imx/imx-media-fim.c > > +++ b/drivers/staging/media/imx/imx-media-fim.c > > @@ -187,54 +187,6 @@ static void frame_interval_monitor(struct imx_media_fim *fim, > > send_fim_event(fim, error_avg); > > } > > > > -#ifdef CONFIG_IMX_GPT_ICAP > > -/* > > - * Input Capture method of measuring frame intervals. Not subject > > - * to interrupt latency. > > - */ > > -static void fim_input_capture_handler(int channel, void *dev_id, > > - ktime_t timestamp) > > -{ > > - struct imx_media_fim *fim = dev_id; > > - unsigned long flags; > > - > > - spin_lock_irqsave(&fim->lock, flags); > > - > > - frame_interval_monitor(fim, timestamp); > > - > > - if (!completion_done(&fim->icap_first_event)) > > - complete(&fim->icap_first_event); > > - > > - spin_unlock_irqrestore(&fim->lock, flags); > > -} > > - > > -static int fim_request_input_capture(struct imx_media_fim *fim) > > -{ > > - init_completion(&fim->icap_first_event); > > - > > - return mxc_request_input_capture(fim->icap_channel, > > - fim_input_capture_handler, > > - fim->icap_flags, fim); > > -} > > - > > -static void fim_free_input_capture(struct imx_media_fim *fim) > > -{ > > - mxc_free_input_capture(fim->icap_channel, fim); > > -} > > - > > -#else /* CONFIG_IMX_GPT_ICAP */ > > - > > -static int fim_request_input_capture(struct imx_media_fim *fim) > > -{ > > - return 0; > > -} > > - > > -static void fim_free_input_capture(struct imx_media_fim *fim) > > -{ > > -} > > - > > -#endif /* CONFIG_IMX_GPT_ICAP */ > > - > > /* > > * In case we are monitoring the first frame interval after streamon > > * (when fim->num_skip = 0), we need a valid fim->last_ts before we > > @@ -435,14 +387,8 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim, > > spin_unlock_irqrestore(&fim->lock, flags); > > > > if (icap_enabled(fim)) { > > - ret = fim_request_input_capture(fim); > > - if (ret) > > - goto out; > > fim_acquire_first_ts(fim); > > } > > As suggested by the checkpatch.pl: > WARNING: braces {} are not necessary for single statement blocks > > > - } else { > > - if (icap_enabled(fim)) > > - fim_free_input_capture(fim); > > } > > > > fim->stream_on = on; > > -- > > 2.17.1 > > > Strangely, my checkpatch invocation on next-20221116 did not show that warning and I am unaware that I made any specific changes to checkpatch or its configuration. Anyway, checkpatch and you, Tommaso, are right and the patch can of course be improved. I sent out a patch v2: https://lore.kernel.org/all/20221123075216.28193-1-lukas.bulwahn@gmail.com/ I hope to get an Acked-by: tag from you now. Thanks. Lukas > Apart of this, patch looks good to me. > Thanks. > > Regards, > Tommaso > > -- > Tommaso Merciai > Embedded Linux Engineer > tommaso.merciai@amarulasolutions.com > __________________________________ > > Amarula Solutions SRL > Via Le Canevare 30, 31100 Treviso, Veneto, IT > T. +39 042 243 5310 > info@amarulasolutions.com > www.amarulasolutions.com
On Wed, Nov 23, 2022 at 08:56:06AM +0100, Lukas Bulwahn wrote: > > Strangely, my checkpatch invocation on next-20221116 did not show that > warning and I am unaware that I made any specific changes to > checkpatch or its configuration. > I think you need to apply the patch and retest with the -f option. regards, dan carpenter
Hi Lukas, On Wed, Nov 23, 2022 at 08:56:06AM +0100, Lukas Bulwahn wrote: > On Tue, Nov 22, 2022 at 5:09 PM Tommaso Merciai > <tommaso.merciai@amarulasolutions.com> wrote: > > > > Hi Lukas, > > > > On Tue, Nov 22, 2022 at 02:23:30PM +0100, Lukas Bulwahn wrote: > > > There never was a config IMX_GPT_ICAP in the repository. So remove the code > > > conditional on this config and simplify the callers that just called empty > > > functions. > > > > > > Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> > > > --- > > > drivers/staging/media/imx/imx-media-fim.c | 54 ----------------------- > > > 1 file changed, 54 deletions(-) > > > > > > diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c > > > index 3a9182933508..19a48eb445fd 100644 > > > --- a/drivers/staging/media/imx/imx-media-fim.c > > > +++ b/drivers/staging/media/imx/imx-media-fim.c > > > @@ -187,54 +187,6 @@ static void frame_interval_monitor(struct imx_media_fim *fim, > > > send_fim_event(fim, error_avg); > > > } > > > > > > -#ifdef CONFIG_IMX_GPT_ICAP > > > -/* > > > - * Input Capture method of measuring frame intervals. Not subject > > > - * to interrupt latency. > > > - */ > > > -static void fim_input_capture_handler(int channel, void *dev_id, > > > - ktime_t timestamp) > > > -{ > > > - struct imx_media_fim *fim = dev_id; > > > - unsigned long flags; > > > - > > > - spin_lock_irqsave(&fim->lock, flags); > > > - > > > - frame_interval_monitor(fim, timestamp); > > > - > > > - if (!completion_done(&fim->icap_first_event)) > > > - complete(&fim->icap_first_event); > > > - > > > - spin_unlock_irqrestore(&fim->lock, flags); > > > -} > > > - > > > -static int fim_request_input_capture(struct imx_media_fim *fim) > > > -{ > > > - init_completion(&fim->icap_first_event); > > > - > > > - return mxc_request_input_capture(fim->icap_channel, > > > - fim_input_capture_handler, > > > - fim->icap_flags, fim); > > > -} > > > - > > > -static void fim_free_input_capture(struct imx_media_fim *fim) > > > -{ > > > - mxc_free_input_capture(fim->icap_channel, fim); > > > -} > > > - > > > -#else /* CONFIG_IMX_GPT_ICAP */ > > > - > > > -static int fim_request_input_capture(struct imx_media_fim *fim) > > > -{ > > > - return 0; > > > -} > > > - > > > -static void fim_free_input_capture(struct imx_media_fim *fim) > > > -{ > > > -} > > > - > > > -#endif /* CONFIG_IMX_GPT_ICAP */ > > > - > > > /* > > > * In case we are monitoring the first frame interval after streamon > > > * (when fim->num_skip = 0), we need a valid fim->last_ts before we > > > @@ -435,14 +387,8 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim, > > > spin_unlock_irqrestore(&fim->lock, flags); > > > > > > if (icap_enabled(fim)) { > > > - ret = fim_request_input_capture(fim); > > > - if (ret) > > > - goto out; > > > fim_acquire_first_ts(fim); > > > } > > > > As suggested by the checkpatch.pl: > > WARNING: braces {} are not necessary for single statement blocks > > > > > - } else { > > > - if (icap_enabled(fim)) > > > - fim_free_input_capture(fim); > > > } > > > > > > fim->stream_on = on; > > > -- > > > 2.17.1 > > > > > > > Strangely, my checkpatch invocation on next-20221116 did not show that > warning and I am unaware that I made any specific changes to > checkpatch or its configuration. > > Anyway, checkpatch and you, Tommaso, are right and the patch can of > course be improved. I sent out a patch v2: > > https://lore.kernel.org/all/20221123075216.28193-1-lukas.bulwahn@gmail.com/ > > I hope to get an Acked-by: tag from you now. Thanks. Sorry I miss the tag :) Acked-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com> Apply the patch then run: scripts/checkpatch.pl -f drivers/staging/media/imx/imx-media-fim.c Regards, Tommaso > > Lukas > > > Apart of this, patch looks good to me. > > Thanks. > > > > Regards, > > Tommaso > > > > -- > > Tommaso Merciai > > Embedded Linux Engineer > > tommaso.merciai@amarulasolutions.com > > __________________________________ > > > > Amarula Solutions SRL > > Via Le Canevare 30, 31100 Treviso, Veneto, IT > > T. +39 042 243 5310 > > info@amarulasolutions.com > > www.amarulasolutions.com
On Wed, Nov 23, 2022 at 9:21 AM Tommaso Merciai <tommaso.merciai@amarulasolutions.com> wrote: > > Hi Lukas, > > On Wed, Nov 23, 2022 at 08:56:06AM +0100, Lukas Bulwahn wrote: > > On Tue, Nov 22, 2022 at 5:09 PM Tommaso Merciai > > <tommaso.merciai@amarulasolutions.com> wrote: > > > > > > Hi Lukas, > > > > > > On Tue, Nov 22, 2022 at 02:23:30PM +0100, Lukas Bulwahn wrote: > > > > There never was a config IMX_GPT_ICAP in the repository. So remove the code > > > > conditional on this config and simplify the callers that just called empty > > > > functions. > > > > > > > > Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> > > > > --- > > > > drivers/staging/media/imx/imx-media-fim.c | 54 ----------------------- > > > > 1 file changed, 54 deletions(-) > > > > > > > > diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c > > > > index 3a9182933508..19a48eb445fd 100644 > > > > --- a/drivers/staging/media/imx/imx-media-fim.c > > > > +++ b/drivers/staging/media/imx/imx-media-fim.c > > > > @@ -187,54 +187,6 @@ static void frame_interval_monitor(struct imx_media_fim *fim, > > > > send_fim_event(fim, error_avg); > > > > } > > > > > > > > -#ifdef CONFIG_IMX_GPT_ICAP > > > > -/* > > > > - * Input Capture method of measuring frame intervals. Not subject > > > > - * to interrupt latency. > > > > - */ > > > > -static void fim_input_capture_handler(int channel, void *dev_id, > > > > - ktime_t timestamp) > > > > -{ > > > > - struct imx_media_fim *fim = dev_id; > > > > - unsigned long flags; > > > > - > > > > - spin_lock_irqsave(&fim->lock, flags); > > > > - > > > > - frame_interval_monitor(fim, timestamp); > > > > - > > > > - if (!completion_done(&fim->icap_first_event)) > > > > - complete(&fim->icap_first_event); > > > > - > > > > - spin_unlock_irqrestore(&fim->lock, flags); > > > > -} > > > > - > > > > -static int fim_request_input_capture(struct imx_media_fim *fim) > > > > -{ > > > > - init_completion(&fim->icap_first_event); > > > > - > > > > - return mxc_request_input_capture(fim->icap_channel, > > > > - fim_input_capture_handler, > > > > - fim->icap_flags, fim); > > > > -} > > > > - > > > > -static void fim_free_input_capture(struct imx_media_fim *fim) > > > > -{ > > > > - mxc_free_input_capture(fim->icap_channel, fim); > > > > -} > > > > - > > > > -#else /* CONFIG_IMX_GPT_ICAP */ > > > > - > > > > -static int fim_request_input_capture(struct imx_media_fim *fim) > > > > -{ > > > > - return 0; > > > > -} > > > > - > > > > -static void fim_free_input_capture(struct imx_media_fim *fim) > > > > -{ > > > > -} > > > > - > > > > -#endif /* CONFIG_IMX_GPT_ICAP */ > > > > - > > > > /* > > > > * In case we are monitoring the first frame interval after streamon > > > > * (when fim->num_skip = 0), we need a valid fim->last_ts before we > > > > @@ -435,14 +387,8 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim, > > > > spin_unlock_irqrestore(&fim->lock, flags); > > > > > > > > if (icap_enabled(fim)) { > > > > - ret = fim_request_input_capture(fim); > > > > - if (ret) > > > > - goto out; > > > > fim_acquire_first_ts(fim); > > > > } > > > > > > As suggested by the checkpatch.pl: > > > WARNING: braces {} are not necessary for single statement blocks > > > > > > > - } else { > > > > - if (icap_enabled(fim)) > > > > - fim_free_input_capture(fim); > > > > } > > > > > > > > fim->stream_on = on; > > > > -- > > > > 2.17.1 > > > > > > > > > > > Strangely, my checkpatch invocation on next-20221116 did not show that > > warning and I am unaware that I made any specific changes to > > checkpatch or its configuration. > > > > Anyway, checkpatch and you, Tommaso, are right and the patch can of > > course be improved. I sent out a patch v2: > > > > https://lore.kernel.org/all/20221123075216.28193-1-lukas.bulwahn@gmail.com/ > > > > I hope to get an Acked-by: tag from you now. Thanks. > > Sorry I miss the tag :) > > Acked-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com> > > Apply the patch then run: > scripts/checkpatch.pl -f drivers/staging/media/imx/imx-media-fim.c > I see. I usually just run checkpatch.pl on the patch, but do not apply the patch and run checkpatch on the file. That explains the difference of observations. Good to know. Lukas > Regards, > Tommaso > > > > > Lukas > > > > > Apart of this, patch looks good to me. > > > Thanks. > > > > > > Regards, > > > Tommaso > > > > > > -- > > > Tommaso Merciai > > > Embedded Linux Engineer > > > tommaso.merciai@amarulasolutions.com > > > __________________________________ > > > > > > Amarula Solutions SRL > > > Via Le Canevare 30, 31100 Treviso, Veneto, IT > > > T. +39 042 243 5310 > > > info@amarulasolutions.com > > > www.amarulasolutions.com > > -- > Tommaso Merciai > Embedded Linux Engineer > tommaso.merciai@amarulasolutions.com > __________________________________ > > Amarula Solutions SRL > Via Le Canevare 30, 31100 Treviso, Veneto, IT > T. +39 042 243 5310 > info@amarulasolutions.com > www.amarulasolutions.com
On Wed, Nov 23, 2022 at 8:59 AM Dan Carpenter <error27@gmail.com> wrote: > > On Wed, Nov 23, 2022 at 08:56:06AM +0100, Lukas Bulwahn wrote: > > > > Strangely, my checkpatch invocation on next-20221116 did not show that > > warning and I am unaware that I made any specific changes to > > checkpatch or its configuration. > > > > I think you need to apply the patch and retest with the -f option. > Thanks, Dan, for the hint. Now, I know. I need to see if this can become part of my usual patch submission workflow. Lukas > regards, > dan carpenter >
On Wed, Nov 23, 2022 at 09:24:42AM +0100, Lukas Bulwahn wrote: > On Wed, Nov 23, 2022 at 9:21 AM Tommaso Merciai > <tommaso.merciai@amarulasolutions.com> wrote: > > > > I see. I usually just run checkpatch.pl on the patch, but do not apply > the patch and run checkpatch on the file. That explains the difference > of observations. Good to know. There is a section "Git post-commit hooks" on this [1] web-link that is useful to configure auto-checkpatch verification at the time of commit. Hope this is useful. [1] https://kernelnewbies.org/Outreachyfirstpatch ./drv > > Lukas
diff --git a/drivers/staging/media/imx/imx-media-fim.c b/drivers/staging/media/imx/imx-media-fim.c index 3a9182933508..19a48eb445fd 100644 --- a/drivers/staging/media/imx/imx-media-fim.c +++ b/drivers/staging/media/imx/imx-media-fim.c @@ -187,54 +187,6 @@ static void frame_interval_monitor(struct imx_media_fim *fim, send_fim_event(fim, error_avg); } -#ifdef CONFIG_IMX_GPT_ICAP -/* - * Input Capture method of measuring frame intervals. Not subject - * to interrupt latency. - */ -static void fim_input_capture_handler(int channel, void *dev_id, - ktime_t timestamp) -{ - struct imx_media_fim *fim = dev_id; - unsigned long flags; - - spin_lock_irqsave(&fim->lock, flags); - - frame_interval_monitor(fim, timestamp); - - if (!completion_done(&fim->icap_first_event)) - complete(&fim->icap_first_event); - - spin_unlock_irqrestore(&fim->lock, flags); -} - -static int fim_request_input_capture(struct imx_media_fim *fim) -{ - init_completion(&fim->icap_first_event); - - return mxc_request_input_capture(fim->icap_channel, - fim_input_capture_handler, - fim->icap_flags, fim); -} - -static void fim_free_input_capture(struct imx_media_fim *fim) -{ - mxc_free_input_capture(fim->icap_channel, fim); -} - -#else /* CONFIG_IMX_GPT_ICAP */ - -static int fim_request_input_capture(struct imx_media_fim *fim) -{ - return 0; -} - -static void fim_free_input_capture(struct imx_media_fim *fim) -{ -} - -#endif /* CONFIG_IMX_GPT_ICAP */ - /* * In case we are monitoring the first frame interval after streamon * (when fim->num_skip = 0), we need a valid fim->last_ts before we @@ -435,14 +387,8 @@ int imx_media_fim_set_stream(struct imx_media_fim *fim, spin_unlock_irqrestore(&fim->lock, flags); if (icap_enabled(fim)) { - ret = fim_request_input_capture(fim); - if (ret) - goto out; fim_acquire_first_ts(fim); } - } else { - if (icap_enabled(fim)) - fim_free_input_capture(fim); } fim->stream_on = on;