From patchwork Wed Mar 22 05:13:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 73202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2169011wrt; Tue, 21 Mar 2023 22:21:15 -0700 (PDT) X-Google-Smtp-Source: AK7set/6SPUCyWXKMMxWTmw2gS1rUEA0egr6PDT68GHGV02sKehgZQ57QXbgwmTK/fWMIt2nZVSy X-Received: by 2002:a17:907:7666:b0:931:dcd4:4ff0 with SMTP id kk6-20020a170907766600b00931dcd44ff0mr5475087ejc.75.1679462475753; Tue, 21 Mar 2023 22:21:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679462475; cv=pass; d=google.com; s=arc-20160816; b=M5IBSpp3tICpzJ3HmjMj1stV3VySLo+Ra3VwaalGhy48fvYUX30OApH4zTVEoxHuJV hNnElXJ7Pr+CU+n9PE8dUB8f7Vtm2yJKAjhIZd5NAmcx7jljkwSW4K19pf6SPP9FGNUr GkYNTjPehLTky98i+Xc9YFqJdCA6O3kOvBbyDEc0SQJAE3s5Ta0njFZ346ZAWxNIlD4W lgcVPp0jC+CKfaaNH8pq2XXeHju0swejXOqL24pbXgOAL/YaHgOpqCHoHyR5Y8Npw4ch 5UjdJ4GNJdfhxuTTXVc2Cfg6xlCy6WRTSU2H3C3g5kcdxOZ0Hoqzdw+SaMNIIa+d1gL2 si5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8HtPUGDrL90dDHNDgqSHbRFOdqqqZXS5JUCzQX0fw9o=; b=Xsxf6hBfGlKC89H6yUce+07/YwWEvOtYaS3HbqNXP4Td9p0fRdr+cf7N0K0RLVNCYL HP+pDaa6iBWwtGkNG3yszorGwL7gdHyG77wRZlMJLaiywQ0b2LJREpK8hn4wLiWNcz0q ciO1jWPMVmZ2BfynchUwoTLr9LnvY9YASNtTpm6Q40aE5rSsaMybsGfn6TO6sHbE2kO2 eWecTygOdr0CY/9mLblJWKlwuLA6StJ28nyRqIWA2IUlApaSYMj91FmBu79J+m8zLIDb Y1MuPmQ5LDJIvWslK1YxBv6fxuPSbAzfFVy9aFbHvoBnBa220xH+XojDnLQn8QJdflZg zBpA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=UG0WnjVK; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a170906762900b008bf6a0f7ecasi14762142ejn.110.2023.03.21.22.20.52; Tue, 21 Mar 2023 22:21:15 -0700 (PDT) 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=@nxp.com header.s=selector2 header.b=UG0WnjVK; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229846AbjCVFP0 (ORCPT + 99 others); Wed, 22 Mar 2023 01:15:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbjCVFPT (ORCPT ); Wed, 22 Mar 2023 01:15:19 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2070.outbound.protection.outlook.com [40.107.20.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC78459E63; Tue, 21 Mar 2023 22:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XK1P5NY7W7I7LF9/c4BngySiUUTxbeeTGApE06A/9DTSpdFCo+QU1WjkkI0i8OLvmIDziHcUQ1CPW/bGUbu42XMW06TCtDTx8o6Oi2ipPkdDpI78t5S23L/RYwfvbWgXStrZNshN/aBR3V18asMjln3tkk05oNb2srvRresXliDGS7CQVexks/G5bael/6hR8Kt9EyfQ6/0DJvvVXBoUpz7f+5ozfzDbwM5wJx4AVYtrZnV2IP2twZjV0Kg0IHWluWpy4XGfKBYrhF5eTfbQBU9kUaDaap4dDlTNKrlHW1M8I2X2c8pOYfK3VvKtwHo2f34MKViaNXLkF+sjYUrL1A== 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=8HtPUGDrL90dDHNDgqSHbRFOdqqqZXS5JUCzQX0fw9o=; b=mgRtP13uEzcG8c48DVHYbeMj4HnCeH+emgodQstn/4+gXU4d82XR3nMekH6Q1mC6jPgd2+sgLIDiVnAYyqt/qNVctwNN46uQhiLBWrDI8RE5yjef0i110Z0VJRJKyJz5g0rF5kPVSi/r4Y1Gk22Q5WD7l1t9p/tLq4qvdIuf+3Ay5yZ9IyTDAF6xic0gRioMZH56stvyIzpHgdpWcmMpiiQ8PKxG9wr1BiYL10T5kJkDhtD0Z4++gJ2R6XfCP6Fb+OitlGP/kzrRtuSS+smWjc46zs55awi5MAyh5O6cPtpffePIDj+Q7fiMwmGcWDWFTgt+mOY5+pa63j0v3OrvBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8HtPUGDrL90dDHNDgqSHbRFOdqqqZXS5JUCzQX0fw9o=; b=UG0WnjVK3ollsitj+b9FnK49ekEKVddWYXysybozD3dlm9MhTyVWi2/pjoV25r1+34hzGaQSkfZaGbR8shZmLDU8EBc1397kN1cS3uCLLVl8ke/Lf0NMF/RL3RyJlwblLOZL+2UVUiTQn7JCOXOODB3uk5yKIwpKY1yt1y4nluI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by AM9PR04MB8100.eurprd04.prod.outlook.com (2603:10a6:20b:3e3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 05:14:09 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::89aa:9204:790d:e46b]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::89aa:9204:790d:e46b%5]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 05:14:09 +0000 From: Ming Qian To: mchehab@kernel.org, mirela.rabulea@oss.nxp.com, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, xiahong.bao@nxp.com, linux-imx@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 07/10] media: imx-jpeg: Refine the function mxc_jpeg_find_format Date: Wed, 22 Mar 2023 13:13:10 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI1PR02CA0021.apcprd02.prod.outlook.com (2603:1096:4:1f4::14) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|AM9PR04MB8100:EE_ X-MS-Office365-Filtering-Correlation-Id: b6b7a76a-5879-40ab-fe64-08db2a944465 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 42KAB3Z7aMBKBC19/JPyYsODAWKaCRQmyOlTam+kfR38PvWKUyjNeng17aIHDqmnw6IF5o28CD+vMRc6tyZUbXdYfNCibebgLkGomjXapm1IlmBZPe8qZZQICMhlW/F0vCoUTSNdAQ6gKIIE4h5H+WFmNdNcWfw1SIEMrDyNrHBtY4GH1q3o+GWP9P1czkeTdUGA1RbZRx3Wdd4FbIEXI5gKJ7hzNMHPjTI6x97eniDcRIzXxj5BvhZVEUkvQ4fHR8N0Uuv9SH8e82bpf3S/d9bPwzc7i+btAbEexcAZHnLEi01qjmmQEn+DV0j4vTXb2UgXcjYQ1uZ335t9ALjDhPrjCJCiimrYoXrf0lwWju0rQ3KH+YhW9kFyXIVRk2b07TqvEGco+M+KtERl3ndPawzuTId7C+WEz6pYSP5uMe/C6lJbzp3W9RSkRYLf0AqCtIcTK4Qhlyd3rRtRRQ/SC/9oGe9JBSjPgFAENR4Vltd8FuuVxgnyIuUUICN1yxn50fW4dVM2hNJu2Nlz+V5b4H9CoUYX2gncJ2oOQDgOSizF0MAiHd3qRacgeGtEXj+JC0gL6ENvfnfmmRP9bvKljBPyPm+B+1BApXnRCld0H/9HmtKnk8En/poh/yQlOZ6fc3sxhQAqnmP7maQF2QUplEpBCx2PrOJeqCQgzpWzD1FrO8WjSRwLzjySJaMH4iy8NfuIiQQT/8T0Gv0T3qHj9Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB6341.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(366004)(136003)(39860400002)(376002)(396003)(451199018)(6486002)(66556008)(41300700001)(52116002)(66476007)(7416002)(478600001)(66946007)(5660300002)(8936002)(8676002)(316002)(44832011)(4326008)(36756003)(86362001)(6506007)(6512007)(186003)(26005)(6666004)(2616005)(2906002)(38350700002)(38100700002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Wrin2dCmIfInAwww+FEYLA0c3FlMviHihPfS6AeL04Lsi1DXFCy5DV41KlNiW6hyN5BPZM82E+iGGi2wmEnbODkiVjZMwFG61CpgtCmQbmeh4lgCCzx4IjIdgf6dj/y+ZBqpl/iypTSv9FGPy7NB+oGwnKWn2lO1tsiK5mWx54Ra379bCPHJ0k1ZB/Xd0etLn4mauX3QeJffzPjT7rZtKzMPv349IZ82evwu8cmS6EG0jisoUZkHfdLC8nubM/wAB4YRBR7E2H/QsX8sRjt2ljIz/V0eF+qiLBNOOADFKMA7kJ9oKiIOSM9XPCCKw0XSTHZdyGKeja/KQfw8nTfDLaFPKj1779aWyy1WVoFbii7Sw7S9KlX4Vj8Ro5YSqY3f/0rbHC6pzPnOW/aUypixJIooImShk1MW3696ZZpLXXoqDEsk7aY5LqjVh0ExXBxTCCUpVHaq6/B9Z2Ld7FLR+Ecd+70Jy5lbQw41OhbovC3+rnwzhQ7nZu3qN/lI11iLw61ZpqAC1ZGwMRTVF/AGScUG5pZ3+pnbNOM1+jacHKNe8/ue2wBWx9MqwF9PeR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: b6b7a76a-5879-40ab-fe64-08db2a944465 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 05:14:09.5837 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Yk7DWZKMP1DDuXlghn6tagJcJ1vEFnQB6KYMk8peRERefG745HxLGR7jex311s2gRu/0QJXYNQowMOp1MMIuNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8100 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761044044679700419?= X-GMAIL-MSGID: =?utf-8?q?1761044044679700419?= remove the unused parameter ctx Signed-off-by: Ming Qian --- drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c index f085f14d676a..70b6eea733e7 100644 --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c @@ -420,8 +420,7 @@ static int enum_fmt(const struct mxc_jpeg_fmt *mxc_formats, int n, return 0; } -static const struct mxc_jpeg_fmt *mxc_jpeg_find_format(struct mxc_jpeg_ctx *ctx, - u32 pixelformat) +static const struct mxc_jpeg_fmt *mxc_jpeg_find_format(u32 pixelformat) { unsigned int k; @@ -1562,7 +1561,7 @@ static int mxc_jpeg_parse(struct mxc_jpeg_ctx *ctx, struct vb2_buffer *vb) if (fourcc == 0) return -EINVAL; - jpeg_src_buf->fmt = mxc_jpeg_find_format(ctx, fourcc); + jpeg_src_buf->fmt = mxc_jpeg_find_format(fourcc); jpeg_src_buf->w = header.frame.width; jpeg_src_buf->h = header.frame.height; ctx->header_parsed = true; @@ -1702,11 +1701,11 @@ static void mxc_jpeg_set_default_params(struct mxc_jpeg_ctx *ctx) int i; if (ctx->mxc_jpeg->mode == MXC_JPEG_ENCODE) { - out_q->fmt = mxc_jpeg_find_format(ctx, MXC_JPEG_DEFAULT_PFMT); - cap_q->fmt = mxc_jpeg_find_format(ctx, V4L2_PIX_FMT_JPEG); + out_q->fmt = mxc_jpeg_find_format(MXC_JPEG_DEFAULT_PFMT); + cap_q->fmt = mxc_jpeg_find_format(V4L2_PIX_FMT_JPEG); } else { - out_q->fmt = mxc_jpeg_find_format(ctx, V4L2_PIX_FMT_JPEG); - cap_q->fmt = mxc_jpeg_find_format(ctx, MXC_JPEG_DEFAULT_PFMT); + out_q->fmt = mxc_jpeg_find_format(V4L2_PIX_FMT_JPEG); + cap_q->fmt = mxc_jpeg_find_format(MXC_JPEG_DEFAULT_PFMT); } for (i = 0; i < 2; i++) { @@ -1950,7 +1949,7 @@ static int mxc_jpeg_try_fmt(struct v4l2_format *f, pix_mp->height : MXC_JPEG_MAX_HEIGHT; int i; - fmt = mxc_jpeg_find_format(ctx, fourcc); + fmt = mxc_jpeg_find_format(fourcc); if (!fmt || fmt->flags != mxc_jpeg_get_fmt_type(ctx, f->type)) { dev_warn(ctx->mxc_jpeg->dev, "Format not supported: %c%c%c%c, use the default.\n", (fourcc & 0xff), @@ -1958,7 +1957,7 @@ static int mxc_jpeg_try_fmt(struct v4l2_format *f, (fourcc >> 16) & 0xff, (fourcc >> 24) & 0xff); fourcc = mxc_jpeg_get_default_fourcc(ctx, f->type); - fmt = mxc_jpeg_find_format(ctx, fourcc); + fmt = mxc_jpeg_find_format(fourcc); if (!fmt) return -EINVAL; f->fmt.pix_mp.pixelformat = fourcc;