Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1256183rdb; Mon, 2 Oct 2023 04:23:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE05JOleC5AOw+OWw0LwpSHfOyW8Gllue8rDYZpzD03rxAxeCuQE8ffp2eGPfofnP7HrKAW X-Received: by 2002:a17:902:f541:b0:1b0:3ab6:5140 with SMTP id h1-20020a170902f54100b001b03ab65140mr18295652plf.4.1696245796955; Mon, 02 Oct 2023 04:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696245796; cv=none; d=google.com; s=arc-20160816; b=ig5952HlVLTbmRSL9PO1mK9WKzP+eKbJifTb3ShRxnmD1eHjQ1251VUqejeVH4jSvl Fty8BM77DF9Ogi+BjOk48g3H4YuRN4YAOFaamf/+pCQJqh7e7C3PgE2LjhAr6ywnSe8R /e+1uMcZm4UNG6f0xYfNPaC3NgFcNhpChF1tQZibNlUFia25moodVD0rVQYtmqqgDh0M nb1nWp9Pffu+t/IfwnBVJznk3VGsoFOw82xOC89Z8mZsCFx45KyB1PD19JrmMG7GyARJ 0VUEvJxQysqWtbv0/gZZdpsKI+HWMsslOptYF+rGoior0RUo46qoAILZNZKmMA/jyfKn fBSg== 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 Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b2-20020a170903228200b001c60e273252si15896712plh.25.2023.10.02.04.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 04:23:16 -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 E9FA0809ABDB; Mon, 2 Oct 2023 04:12:28 -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 S236671AbjJBLMX (ORCPT + 99 others); Mon, 2 Oct 2023 07:12:23 -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 ); 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 ; 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 To: Lucas Stach Cc: Christian Gmeiner , 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: 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:29 -0700 (PDT) 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 --- 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)); -- 2.34.1