Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp927467rdb; Fri, 20 Oct 2023 03:46:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3+hRFDJecLD4UbrrZIkQg7GrOlsyD/dyWtHzVfJABEo7+kE9Wms6baBMYYXR+OzvohCD1 X-Received: by 2002:a17:903:32d2:b0:1c3:83e2:d0a9 with SMTP id i18-20020a17090332d200b001c383e2d0a9mr1679688plr.58.1697798799601; Fri, 20 Oct 2023 03:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697798799; cv=none; d=google.com; s=arc-20160816; b=kPT8CYGeKCz6xUhItwGmG60B3xG7JKvdtJ9p75bRR9RP0kmDXDjpQJxjxG/DHKM6pX TqG/wLpaTHXubDIKf5bxQI2QVD0iNUPspF1UIaPZnYTvVMLmcTpJpRoKEIq/zZyJZopb 4EOn77nsnTkMe80b9keMpgPjFC9Ge5+HLFITxsrjyzeg/SuKDCJ45xJlMBPrwzouprXA YPktiT0P655k3k/hbDfG7orSgsUJ3oN8aocK/oNVpvUxNOkra4ryfkQtUbOn3VQZsPic s0Y/RN1OvZ9SgMCZWbDmaF/hPvGywYge19BnZ24kIhUf3pzN5fsAGTnHxCjiPfx8JXSH 4SxQ== 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 :message-id:date:subject:cc:to:from; bh=OmSHY2sqQ3fzdkjohBWCkoloDorACCoo1uvNlgfYJxU=; fh=qu0d9QoE7nTizpodKaDk97THYkZX6zRDZn1j+RYMd+4=; b=0Zh9rwp+N2Opc9L2ZApKeP7MyZ5E6XABS4MTyNC54mCb2IwaTvWAV6CTIUOiONgDhp jbayR2sI7XQOmJebWhpLAZs7ErzSbxNpx8x1MqdxSId2ONRCFWpuiq9sTLI9VhtjHBCf MkFd7c2OAQTWp8GWpAXeZplRmYBqlQa+DCWEboPtvRQuLwWvlnXNh0MJXIYlJFAE4fNe A5RgQM6YQFfKoefyvyVjGnD9yppWcKXRhMVgXk5dQDJBx5FiITpgTTURz83QCZwVchUP UxCPu8VRqUAxR4NuzX3R5uolcnRt2Fk7P43FiwLioDePCXQZhWWLkL9XSU5mNo1uu8Ae HIHA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id q15-20020a17090311cf00b001c9ad8ca211si1479945plh.18.2023.10.20.03.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:46:39 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id DBB8681BDF2E; Fri, 20 Oct 2023 03:46:00 -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 S1377193AbjJTKpu (ORCPT + 99 others); Fri, 20 Oct 2023 06:45:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377184AbjJTKpb (ORCPT ); Fri, 20 Oct 2023 06:45:31 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 610921BF9 for ; Fri, 20 Oct 2023 03:44:35 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A8D792F4; Fri, 20 Oct 2023 03:45:15 -0700 (PDT) Received: from e122027.cambridge.arm.com (e122027.cambridge.arm.com [10.1.34.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 390923F5A1; Fri, 20 Oct 2023 03:44:33 -0700 (PDT) From: Steven Price To: Boris Brezillon , Rob Herring Cc: Steven Price , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Adri=C3=A1n=20Larumbe?= , Dan Carpenter Subject: [PATCH] drm/panfrost: Remove incorrect IS_ERR() check Date: Fri, 20 Oct 2023 11:44:05 +0100 Message-Id: <20231020104405.53992-1-steven.price@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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]); Fri, 20 Oct 2023 03:46:01 -0700 (PDT) sg_page_iter_page() doesn't return an error code, so the IS_ERR() check is wrong and the error path will never be executed. This also allows simplifying the code to remove the local variable 'page'. CC: Adrián Larumbe Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/376713ff-9a4f-4ea3-b097-fb5efb685d95@moroto.mountain Signed-off-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_dump.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_dump.c b/drivers/gpu/drm/panfrost/panfrost_dump.c index e7942ac449c6..47751302f1bc 100644 --- a/drivers/gpu/drm/panfrost/panfrost_dump.c +++ b/drivers/gpu/drm/panfrost/panfrost_dump.c @@ -220,16 +220,8 @@ void panfrost_core_dump(struct panfrost_job *job) iter.hdr->bomap.data[0] = bomap - bomap_start; - for_each_sgtable_page(bo->base.sgt, &page_iter, 0) { - struct page *page = sg_page_iter_page(&page_iter); - - if (!IS_ERR(page)) { - *bomap++ = page_to_phys(page); - } else { - dev_err(pfdev->dev, "Panfrost Dump: wrong page\n"); - *bomap++ = 0; - } - } + for_each_sgtable_page(bo->base.sgt, &page_iter, 0) + *bomap++ = page_to_phys(sg_page_iter_page(&page_iter)); iter.hdr->bomap.iova = mapping->mmnode.start << PAGE_SHIFT; -- 2.34.1