Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp173370rdb; Wed, 14 Feb 2024 17:14:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWP1f/4o1aYCXBOGALqnq+PzxS/fbJ02nzoVB29YmEODfAdL6pVLzQqlDbhi4kc8/ZQLtE8VcjcdnyGXoIoJ0eYmkpGy6N+jduuQXcvCg== X-Google-Smtp-Source: AGHT+IEgPiexHFcDPrbpG+SdSOgf5TTGZGdM88O6FBGgTJr8y4Jf/OWdIT0NEZ5QZPC4FOT29jgb X-Received: by 2002:a05:6808:10d2:b0:3c0:3db0:55eb with SMTP id s18-20020a05680810d200b003c03db055ebmr641740ois.49.1707959697268; Wed, 14 Feb 2024 17:14:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707959697; cv=pass; d=google.com; s=arc-20160816; b=XzOmO9xc99969Z7c8gwhpytGHhxqq/98gabnIVpuDmRbijdDoz8dTxpRksrf4YWqHO XFt1qbJUsADy8yCrj8jewZ0BEZ6kk0J4QbBD/fdCWBc1gzjrkozflPbaJ/fq27ueP91m uON6azXXJ3tFW6qk3EK//RuGCsIL2cssJmF03kPKo4SI66KizJrw0gGd9wkUXEeRjC2u iPxmis5esyueWsh3mZ/dF7JsZ76cEEioRnh9prF5n9JfspFR0zUHiK0jOs4radBVF6uD IvV3rSR+tej6NQvlv25iH3spp9clP8kdraXM91q3CA2k5mL7e15rDYswAvjPlTGC7kSM C69A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=I/kGTTkBNPrJCHYkMUusHdDnrTmca1yjn2qBOierNbU=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=UJpXMYtOvpgCAZyxjKpqWZU+z4z+D+QEl8Oud48R8YWelTp8s7vTdiM54m/iZYwkQO IalUHFpeb8HH35kWuKnNj4AHV6MtPN0E3lbFRn8saZskpru+I1YgRwkGK7pCopGpavJ+ +k9SQELP1DCzrxJvlw7mw0UGOKuKJgZXRvWeuhtdFmYIdIJ8OCmeUxlR+eubI6FJ4HkA M0wH47NI+gjtfkP7WAvRGACR3c82ZoUInqeroBdhhm72q7oApbQ1uElOE57RuxSgjuyu pS9PfeKt7t7o0icQayFRJlTTcdLFbTjz81W3UR6baBxwe5e77iYhX+hZIEKcNTKta6fu PgEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sA9i2nL5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66204-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 31-20020a63145f000000b005dc5069298fsi116094pgu.711.2024.02.14.17.14.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 17:14:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66204-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sA9i2nL5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66204-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66204-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EB476B296D4 for ; Thu, 15 Feb 2024 00:52:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD3B713FE0; Thu, 15 Feb 2024 00:50:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sA9i2nL5" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EB82F17C9; Thu, 15 Feb 2024 00:50:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958223; cv=none; b=cDxAu97ObkaHDUN4DJkDtvEmTs0EPXVhh/1SMfk76KxDVg6WkiN6dHJGBI/JdQdp6mmZtoIs7Ow5ojV16vpUriLX3OGESzokjDKcMCCAuPS3ZdGSXgE90LualFw62LclULK3K/NA0KM+HUkkHLgTiIsMl/J3ynuca+70E9D2XXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958223; c=relaxed/simple; bh=Nd1NDjS7PBGCZG08y1pbAZotjpMonshTocV35vaQvPk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ReuxusgrJGmRxvNPcCwP69frpM4sIE+ZSrhEHTE7qu7b8fq5WHFJBV+TrWmap4NeU2LP+bSdLKthMzX5bdPCfsSyztIyUPOYiqQDCHpU9vC0RpjR7tqxGA7ud7Ilhaqxe7uOUTNflAQ7u5KgRgGs1aQRAvPerHx6IEmWoAu8F6w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sA9i2nL5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3104C43390; Thu, 15 Feb 2024 00:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958222; bh=Nd1NDjS7PBGCZG08y1pbAZotjpMonshTocV35vaQvPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sA9i2nL58Za9xrOfR+gqXKLVZ0NKkmamnkgCtT0P5X4TWIOo6ibmYISUE7llg9e+u tuCatNrBIrc6+xUJfvduqvXb2nBh0JUYUq2BWQlA4FzjD1bMRLelrwrrTWPmEpWNLK bYN+RU6kIpY5wdWugtL3RfkFhThv/2LMw1ZrO2+iao7mk0JT8t4mdZ8rn9ANWMW0aI eiVdeCSWceN6PO5VZSK7X77B7ZTAYKrmV+OYbPbGl1VcQv1sxoVnJ38OUBET1ZRcSX ewu0//pYNU77x6grOglmUCuv+FYRUODlSfu4xvn24rvLrtDSVbEFee1m7YbLXzFmIw 4vO8WodC74HXw== From: Chun-Kuang Hu To: Matthias Brugger , AngeloGioacchino Del Regno , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Chun-Kuang Hu Subject: [PATCH 9/9] media: platform: mtk-mdp3: do not store struct cmdq_client in struct cmdq_pkt Date: Thu, 15 Feb 2024 00:49:31 +0000 Message-Id: <20240215004931.3808-10-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240215004931.3808-1-chunkuang.hu@kernel.org> References: <20240215004931.3808-1-chunkuang.hu@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit MediaTek mdp3 driver has the struct cmdq_client information, so it's not necessary to store struct cmdq_client in struct cmdq_pkt. Signed-off-by: Chun-Kuang Hu --- drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c index a420d492d879..6aa32ab018b4 100644 --- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c +++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-cmdq.c @@ -298,7 +298,6 @@ static int mdp_cmdq_pkt_create(struct cmdq_client *client, struct cmdq_pkt *pkt, return -ENOMEM; pkt->buf_size = size; - pkt->cl = (void *)client; dev = client->chan->mbox->dev; dma_addr = dma_map_single(dev, pkt->va_base, pkt->buf_size, @@ -314,10 +313,8 @@ static int mdp_cmdq_pkt_create(struct cmdq_client *client, struct cmdq_pkt *pkt, return 0; } -static void mdp_cmdq_pkt_destroy(struct cmdq_pkt *pkt) +static void mdp_cmdq_pkt_destroy(struct cmdq_client *client, struct cmdq_pkt *pkt) { - struct cmdq_client *client = (struct cmdq_client *)pkt->cl; - dma_unmap_single(client->chan->mbox->dev, pkt->pa_base, pkt->buf_size, DMA_TO_DEVICE); kfree(pkt->va_base); @@ -341,7 +338,7 @@ static void mdp_auto_release_work(struct work_struct *work) atomic_dec(&mdp->job_count); wake_up(&mdp->callback_wq); - mdp_cmdq_pkt_destroy(&cmd->pkt); + mdp_cmdq_pkt_destroy(mdp->cmdq_clt, &cmd->pkt); kfree(cmd->comps); cmd->comps = NULL; kfree(cmd); @@ -388,7 +385,7 @@ static void mdp_handle_cmdq_callback(struct mbox_client *cl, void *mssg) atomic_dec(&mdp->job_count); wake_up(&mdp->callback_wq); - mdp_cmdq_pkt_destroy(&cmd->pkt); + mdp_cmdq_pkt_destroy(mdp->cmdq_clt, &cmd->pkt); kfree(cmd->comps); cmd->comps = NULL; kfree(cmd); @@ -513,7 +510,7 @@ int mdp_cmdq_send(struct mdp_dev *mdp, struct mdp_cmdq_param *param) err_free_comps: kfree(comps); err_destroy_pkt: - mdp_cmdq_pkt_destroy(&cmd->pkt); + mdp_cmdq_pkt_destroy(mdp->cmdq_clt, &cmd->pkt); err_free_cmd: kfree(cmd); err_cancel_job: -- 2.34.1