Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7016879rwb; Wed, 23 Nov 2022 00:31:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf420++H/UcKdFShFBFwtm85CEBxlYIHcpoCluPK3SrQ+sLeAHUT8p6ISNDBHkPSBlNFHG/O X-Received: by 2002:a05:6402:5517:b0:461:c563:defa with SMTP id fi23-20020a056402551700b00461c563defamr24371556edb.72.1669192311865; Wed, 23 Nov 2022 00:31:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669192311; cv=none; d=google.com; s=arc-20160816; b=nF8IjwxagmGQKh5Z8/FIGnxsRYJF3gCPhnq0KrESpj67k0AhQ32STY/LNLuAK+HSsi E6fyPHfO148TGd+UvGw1EuSx/pUYkDWb36uthBDWkcQibZKcPnOZRI1hC24uIRhYETUX Xpr4Tb3fgwZQOwlwCynyDR2GzgkQmvECI9atKuWQXfPZvdlbfC8fXApA2LX/1R+JyPM8 SXXid9qHDF1nr5V38MTJnG/1iUgN351XgpRiTeQcxm8Hud23MgO0NjYzL+BJaKsLV26+ rdGQAVo5XlWwjjRK77cqhPB63i54CmacD6Vmdi1Kxbtnn6B55px/NQQQoT3rKNzYaCnW 25OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=V+KTB0yCVy00ksfR0u4Zctg6mmMhF4ijcHC1EOhuum4=; b=0Wm35ad8Vl8kQXpjU1ANnGB8jy2JvydWyINpJY6GDZrx4EVZEMk30of+3ZRy2fP6aR 4wR7rLXQNHUwUH5q5ng2xleScKBIphLbFAghQyuD7YMfZMNNBoJ7eH8x34aQQ51y7QpU B+8uVNGON/bzLSYdyet9qI27RsMVm+dblIP4FeyUh2PrPIceik81nh633nb7FsH0aUx7 J+c+RY1snJCip1f8gPbvs/Izp3f1KeKSqbO59xH7QAeQsLrlWyWpMz0xssiRmUDIbiHO 2yHLhNIAVHGg/hYFeu4l8KQh8PUsXPK9yPslgVdLBdl2Wn38EOqnKEYBP7nQ746lQeQJ d9OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ci9XwZGC; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a056402148700b00461f7a7a797si4529830edv.292.2022.11.23.00.31.30; Wed, 23 Nov 2022 00:31:51 -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=ci9XwZGC; 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 S236072AbiKWH6Y (ORCPT + 89 others); Wed, 23 Nov 2022 02:58:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236363AbiKWH4d (ORCPT ); Wed, 23 Nov 2022 02:56:33 -0500 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E35926AD0; Tue, 22 Nov 2022 23:56:18 -0800 (PST) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-3a7081e3b95so62949697b3.1; Tue, 22 Nov 2022 23:56:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=V+KTB0yCVy00ksfR0u4Zctg6mmMhF4ijcHC1EOhuum4=; b=ci9XwZGCABJJ8P+PbOMoIT+tN/dhXjJWbSRrY2gBs92AJpBEC9TUtqnwYYja0qnpau n467+caVA8Ir5xqj0D+47K9ZuAmHGV3qpy/kPa+igWfzvGIARrKeH+kBke87eb5gwWEP OxyWmZda7fEY1WYcyzoyZpnMbMUKx1ZZoWG9Hf/Ba/0qEVmRZkgyaTNjkjYdkY3gV97u /ZkfFVj6CiwNXENvnu6UYPiZ3GLZN9oNKKWj4BuvK4JHRi1OHjx05i3VmMc1aoBJtlpy X2KZRpm8Ed6pnjzNCqY897MShEgoSmCRM1T2hD6T9DtvcHfxifeYUI7lx+a4Y2q3TDbQ 9Krw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V+KTB0yCVy00ksfR0u4Zctg6mmMhF4ijcHC1EOhuum4=; b=A6wdwibztIijGSj2HYZYdQuKKrIIYrrwIGNzv+xDy/c4erqwwAV/Vv7pLmwj5V81a/ Z+gKa211dBRBpLIDvKYY63wnv0NCD+uyLPOXyNecNM+icC/TTSCuQSnKTrh9mXYbNRCF DkJIuDMWWla0bL3WE0uNo4+GUGD2KhQ8bltWk+C9P6BNz9XbsQRsubUfazrzr/q9BGeu XXWaWTUcPJGTZ0pRNL9Mnln+H/BfMStMM6X59DwXPlQI7onVqCJu7yZggPW2R6hZ64pv DnOjAeQ0wRfJBGi0MELs4acaG3YScMzxjyUEZ1MSJk1l0Jw05YM3O1nZFsoXAfiUF9fa t7/A== X-Gm-Message-State: ANoB5plYpdY2fkxkOIF2eUcIHIVmaPJk/f5j4azSR5CuDaoMSUi8gitH DDbUSc0pX62jNxKivPd7df8W7PkN8lW65NhzknxBBitsTjM= X-Received: by 2002:a0d:ca05:0:b0:3af:60cc:7496 with SMTP id m5-20020a0dca05000000b003af60cc7496mr1903074ywd.510.1669190177606; Tue, 22 Nov 2022 23:56:17 -0800 (PST) MIME-Version: 1.0 References: <20221122132330.30408-1-lukas.bulwahn@gmail.com> <20221122160937.GB39395@tom-ThinkPad-T14s-Gen-2i> In-Reply-To: <20221122160937.GB39395@tom-ThinkPad-T14s-Gen-2i> From: Lukas Bulwahn Date: Wed, 23 Nov 2022 08:56:06 +0100 Message-ID: Subject: Re: [PATCH] media: imx: remove code for non-existing config IMX_GPT_ICAP To: Tommaso Merciai Cc: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 22, 2022 at 5:09 PM Tommaso Merciai 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 > > --- > > 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