From patchwork Tue Dec 20 03:11:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 34886 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2747737wrn; Mon, 19 Dec 2022 19:14:57 -0800 (PST) X-Google-Smtp-Source: AA0mqf5ahfYWfopTPrIc8E6wjvqVVz5jBI4r9oWypdZckTJLWah91gmiuj8uNuRky9p0n/y1Tp5K X-Received: by 2002:a05:6a20:a588:b0:af:757d:a8b0 with SMTP id bc8-20020a056a20a58800b000af757da8b0mr23060055pzb.9.1671506097562; Mon, 19 Dec 2022 19:14:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1671506097; cv=pass; d=google.com; s=arc-20160816; b=MrrqEXEmiPTiNTCuQq2tv2e7IQY4857K9/askyR5CdG1neOdxa2T+jFyA9/c04dCpv psce2o/GYc6CIJpn60RmYK8QRmTjw9NtxVuk8h4DNsskzirWbzSz8ruTX5LXEDGFDVOj 5JE0QT/vTw2j3o46YDWggfmp/uqC2AyNybSDdegjOsDKcGq2mlWnikNWGeSe/Q/Ofg/J DIVecnABX3C/9etswIl79T1CmN60gFsNE+5VY2yELOu6WnEukwCCp4rxotkuhLbDdy1B 67nApx+h3atR08kq7gEc8Vdz4/O687/RJbIQrZnsKqV/wHjkvOY9MgDpbCB1ED+n2D4d +6/Q== 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=zbIcPoq9RrGMWVbDtmtLrCDuucGY+RLJ/fv0HBuvT00=; b=ycqTX54EYoFBp0ykbWq/yU/GEFaOyanvAfGWAEHXW0AtNcM18RGyMd7St+fayvZPDU EeALHmStJQqOFv1T200fKMDLUYkwGPeXxSsiI6MJ4Txr4vKKb0Do6QWuKbmf84h1fezc HnLn+O2dPSZzruK2zYvyY+SUzpeApe9GLNpDUDf8tbBn9wiWfzRpKD3U6N7CW+7aMO8y 8kRqbU+kS+l5H2mdb4TUHN/yVYYCfbKefGIUReK2dq80ZUYU/U9IdSUkbyJciITT93Ow 3nw6DYnfqE123rbuvuds7zMMOdRSJFnfoIzAgDB2XGE7+C3qe7OQqrOKRz/FNl4Z63Qf Et3A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=s7d5c+RU; 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 c3-20020a633503000000b0047715beb2a5si13028521pga.150.2022.12.19.19.14.45; Mon, 19 Dec 2022 19:14:57 -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=@nxp.com header.s=selector2 header.b=s7d5c+RU; 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 S233180AbiLTDOG (ORCPT + 99 others); Mon, 19 Dec 2022 22:14:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233102AbiLTDNg (ORCPT ); Mon, 19 Dec 2022 22:13:36 -0500 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2078.outbound.protection.outlook.com [40.107.15.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05BB115A3B; Mon, 19 Dec 2022 19:13:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ST8sWCtc3VC0En/NDOinaPW7Kuc/XJM6cF3/W/gXFXvQ9YwxCvjpgC2zNVsKEB9zeVLH3925AcyZhdNE41Yyq1+E+1OzCvOiHbi3+RNSKaeKg1v2azANTi4xUvDjd/UERAUh1ndxb6u6GE3KJ+RW/9o5Liksm95N+VsXkqFILTQtRfLAGnH0AtA/vY7wvfJqJrQ0htqe6ikFko1x91I+rjBfR4HRozzXThf61GJejx+MyhlaEXVCC/HX4ZsAKu8AOZj9KtCFizC2lHkI7F78ejblahUFjZDmzQWyQU4tYLQY3jzK7M9yBOk8G0fBj2ktZoCIyDlrN3eZgNn5y/dWvw== 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=zbIcPoq9RrGMWVbDtmtLrCDuucGY+RLJ/fv0HBuvT00=; b=lMP6On115SxhNNIdLwlEhAsNTWYrADfSdcKbK7zxoHpyufo15/jEpuyqBhePKTCbtJJwuQjJv/EGt06DEUlPQD3bEMB6tNaJOgQpbTuzWO6InEwpt19vVFrrlhsNmDMZO5jj+j3/j2RPjDHs29+Cmomm+g+RE0YsaYL4QGcDTEGR88VC98b0a+1dLHTvX/9AZIk/Rm+pQt+MmpWczcFxbpkyDU+2yXOUHPRzz1+cR6/J4l07QvEap9quZVrgL3L9niD4vThg11OrVuWHOqPGOK8r2gK0KIlE2Ld+nvJnfdI7tPhh+t0eThmaTAKKVvSMK4qHw8sY+shV9+t7Mzketg== 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=zbIcPoq9RrGMWVbDtmtLrCDuucGY+RLJ/fv0HBuvT00=; b=s7d5c+RUm/NwaK2lyYKP/rV6u8pNkhxNrGKP7y8RRFsU49hYiK+cCoKYUMAo2IQeR4VG3u3Jjvi5RMGB8CYfKytwbjA0UTv1xd+DilDVrDt8W874HXyoR1wdfDBTtWTUgZIoFWg3jKTNy164xQtE5Ml6QCxDJ0sCQkhtAr/hYyY= 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 AS1PR04MB9405.eurprd04.prod.outlook.com (2603:10a6:20b:4db::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.16; Tue, 20 Dec 2022 03:12:44 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::3a82:42b3:f1ed:5c3d]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::3a82:42b3:f1ed:5c3d%7]) with mapi id 15.20.5924.016; Tue, 20 Dec 2022 03:12:43 +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 07/10] media: imx-jpeg: Refine the function mxc_jpeg_find_format Date: Tue, 20 Dec 2022 11:11:37 +0800 Message-Id: <2aab9e89d5e0ef398fd6e218e11db6ad47f0082b.1671071730.git.ming.qian@nxp.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR04CA0014.apcprd04.prod.outlook.com (2603:1096:4:197::18) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|AS1PR04MB9405:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b0975b0-59e0-46ff-80bf-08dae2380fcd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RGBPo9dqkZwNGlVctwgiaGglrBA7kyo3p5AhjLvzEHiJ/IImQkMpXhTBxJWaNd0G00dtYMQEsFTbh4tZF0MkGEqp+PSs9H0N3a5DC3+50vnZY27Py2ORi/qvaICiih2v2prn3hZ/tJ9hnsxbZygWgAflYFz70LRtfgjaH1kj/E77rBxvO71UM9EQoAy5OyAj7RjNidL74gtjFMxTjIllccK4Ao7jE3htsZxntnyI2jd4/TgCbOiVDFewQeAjlJWetAMQR7XVNRjcS75v+xQ3ek8dYD31MuiMMONtCHgOCHhjaEsnJq98TRTgDDexzWCt4+obrWJFiMbd70qzZG1OuYCONkqYkg95UmIWFDXPq9AHw23UPdGCn3w2Mk0ahDcZFOsXgA1qW+9xVZgk2YWT3MUsqbkwLhw3N/WbcA7k5Lyl5B3rkbT5mdKMSA2uKC3fq8o0vu29ejeQjMlruLOKzqdpaoX0QWOMNPV+H5GtZsWD+EYULwHSAxPIY+3mgqQHjRfyHUN+Yea9O+TNjfY+Aa01dkiu/h9/BubULrz1VFKSykhtUBVwIk8tktglC0/WH9GmdhnWJNWL+pQ7MeQF6q6jdb76fCvSdN84ZyYT2GlsoMA6Je7FCyUjBm61wPPkVPtxuR/9Bl0W12pCKXB1aE0YvD/BIyj0qGa5e3yLew8vVsPtBJJrMjhygwUamZEMtBW8jTcEb4xrMK9DGB163w== 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:(13230022)(4636009)(136003)(376002)(396003)(366004)(39860400002)(346002)(451199015)(36756003)(86362001)(478600001)(316002)(6486002)(66476007)(8676002)(52116002)(7416002)(2906002)(6666004)(5660300002)(44832011)(66946007)(41300700001)(8936002)(66556008)(4326008)(6506007)(38100700002)(26005)(38350700002)(6512007)(186003)(83380400001)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4f2VWHFLHoONDzYmA/fV0Ew3M1whoVNZS6ser8kDs2ESmTHM0h9f1pZVw/35h1GKJBO7scX5q3WAd54SvFqbJ5AYLdwAuSLoipRNX3quqr3Be+Ie+6kaQ5sgikctXC6jDhKxJU8TtGWUkCNeWsHCxIvVDdb1cbL/+gK1RYzFXWV9nb/Csbqf9/ELFxsUkwQOzc+EYhP39ldfYNfCSmAjyEHBXokLxGiwiSU2WJngNHlpjdsA2c2G25dgxWxe9iZiStEgKaxfl3CXF+5uaJeRXdeJBcbsdj23P3XUOv7nrTI8m3EfsOiuZMzIkjKjQZ/sZdXQr3/kygyPT76K7LiOdEXNEu8ObW5ADqgxLzrn3d5b0vfM69/shJcHTYMDER7WT3ZJWQV0VFnp3fSBvDqTTkmpvExAdTGdqN/3qfFSoUbSkIJ1M0bBVyfTklHUeIfM7+mqXoYWzqpgQbZVs6tfI599oDsurO3gHI3cx1F3MfawBVM88sHR3KxRfEcDeB1WlAxd/SMhPwe3MkEQycGCaSydCTl/QPD6THIg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ange-CrossTenant-Network-Message-Id: 1b0975b0-59e0-46ff-80bf-08dae2380fcd X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2022 03:12:43.9237 (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: oUwXiKcDy4NPsqIduKejRMN/0RGTWlj5ka3x2LLIotTiUE2qVyFx+bXCM9xX9gPUIVv3RsX3LdgTawdv3jVTgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9405 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752701177453179878?= X-GMAIL-MSGID: =?utf-8?q?1752701177453179878?= 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 6cd015a35f7c..97e61e28c649 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;