Message ID | 20231002111207.513297-6-suijingfeng@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1353558vqb; Mon, 2 Oct 2023 04:23:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6QDgYPWegzDBUZUAB52+O0wamcpd2CQehKj1Du52Rn2lBcyLM82IsO4k4cS93vbMHAAI8 X-Received: by 2002:a17:902:ec83:b0:1c7:27a1:a9e5 with SMTP id x3-20020a170902ec8300b001c727a1a9e5mr18296992plg.33.1696245797112; Mon, 02 Oct 2023 04:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696245797; cv=none; d=google.com; s=arc-20160816; b=AcbTjAWy/2EiMdEsxuhyP83SQCpXmtgtZVOo29/tL21HIWRjrhvrLNyqTEEbof0t2n M8EL0TljHQh2nyG+8QG/A8APgtM9UoYonbsFu5DlBex6weylBi/FWbqSK3oxMYFJdr6g ZrIXhTlHdwOO93QdTkFgW0kg2p1PI217tReJ7wCRmut5NfWEKuAfWU+Y/qS75w2S3nSq VZK4flgnq6/6lVBeeRA9gT7tFkARJ4KN/r4Q0tmxudZQoNvt7jBX2GjNRmE4JnHU3WCg +gdh7FtHB/Tp8NC/Aa8xaqeRkI9LrK/fum8pR6+aut8MvLfejajVx7PLKyOAfMrkBSw9 Fr4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tGRaVmecOH4f68dzWRXz7jrmwE1S3BnpFJFkLY8Jr1o=; fh=zB/Le29j84eF2EWMM5mMCmgRJzHNI4kLocpkF47EhQo=; b=wwMx1/nyVp0BPUoodoUenFY4U8Sra+QFdA8c6on2X3iMr9Jui0xygIJ/X8liIqh4JW ppkkzK6eCvsPffeDPCdDECfg2IwvTEfQjAk5XmFdZe191TEoHpw8Uc0F3WC8Yk9gyy/2 xjNO3GwtjdypqQzX/JBiajB/tPeL+Co6Gw3wS6rT2Bg/kz0zy8rqVEmjLAjmr+lq9I5h ZSeI/hhPlBh2zGWYAp8udykD0fb/OWlPsMeVQXeklF2c2C2ZG9hgN3xEiRn/CF8gLAIY d4Gnga5HKbWpWc3GeBojh9zj6m84k2p8BiBqUlbLRGUWNHjAeuWfR3OLVFi96OSLEaog 5BiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i1-20020a17090332c100b001c3da86939csi27636476plr.546.2023.10.02.04.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 04:23:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 78747804BDCC; Mon, 2 Oct 2023 04:12:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236672AbjJBLMY (ORCPT <rfc822;chrisfriedt@gmail.com> + 17 others); Mon, 2 Oct 2023 07:12:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236516AbjJBLMN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 2 Oct 2023 07:12:13 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7FC3FDD for <linux-kernel@vger.kernel.org>; Mon, 2 Oct 2023 04:12:10 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8BxY_CIpRplNJIuAA--.23684S3; Mon, 02 Oct 2023 19:12:08 +0800 (CST) Received: from openarena.loongson.cn (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxE+SHpRplEh4XAA--.50320S7; Mon, 02 Oct 2023 19:12:08 +0800 (CST) From: Sui Jingfeng <suijingfeng@loongson.cn> To: Lucas Stach <l.stach@pengutronix.de> Cc: Christian Gmeiner <christian.gmeiner@gmail.com>, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/5] drm/etnaviv: Using 'dev' instead of 'etnaviv_obj->base.dev' Date: Mon, 2 Oct 2023 19:12:07 +0800 Message-Id: <20231002111207.513297-6-suijingfeng@loongson.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231002111207.513297-1-suijingfeng@loongson.cn> References: <20231002111207.513297-1-suijingfeng@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8BxE+SHpRplEh4XAA--.50320S7 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj93XoW7uF1rZF48Jr4DtFWkZryktFc_yoW8Gry7pF s7JFyqkr1jvFyjk347Awn5CF13Gw43XFWSkF97G3s09w45JryktrZ8KFyDGrs8JryfCFW2 qr4ayF17WF1j93gCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkYb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1a6r1DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4j6r4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280aVAF wI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IUbCzuJUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 04:12:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778642632852835486 X-GMAIL-MSGID: 1778642632852835486 |
Series |
drm/etnaviv: Various cleanup
|
|
Commit Message
Sui Jingfeng
Oct. 2, 2023, 11:12 a.m. UTC
As in the etnaviv_gem_get_pages() function, the point to the drm_device
has already been cached to the 'dev' local variable. We can use it
directly, While at it, using 'unsigned int' type to count the number of
pages. As the drm_prime_pages_to_sg() function takes an unsigned int type
for its third argument. No functional change.
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
drivers/gpu/drm/etnaviv/etnaviv_gem.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gem.c b/drivers/gpu/drm/etnaviv/etnaviv_gem.c index be2f459c66b5..71a6d2b1c80f 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gem.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gem.c @@ -100,11 +100,10 @@ struct page **etnaviv_gem_get_pages(struct etnaviv_gem_object *etnaviv_obj) if (!etnaviv_obj->sgt) { struct drm_device *dev = etnaviv_obj->base.dev; - int npages = etnaviv_obj->base.size >> PAGE_SHIFT; + unsigned int npages = etnaviv_obj->base.size >> PAGE_SHIFT; struct sg_table *sgt; - sgt = drm_prime_pages_to_sg(etnaviv_obj->base.dev, - etnaviv_obj->pages, npages); + sgt = drm_prime_pages_to_sg(dev, etnaviv_obj->pages, npages); if (IS_ERR(sgt)) { dev_err(dev->dev, "failed to allocate sgt: %ld\n", PTR_ERR(sgt));