Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1473425rwb; Fri, 7 Oct 2022 13:12:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM47hTz0we7PdLfwL0nGyWY2/mMw/rLpLZRVqkLy4HTXWyZgAzqECxrCcgEl9m9mGCrS+L59 X-Received: by 2002:a17:907:70a:b0:741:78ab:dce5 with SMTP id xb10-20020a170907070a00b0074178abdce5mr5485019ejb.527.1665173535063; Fri, 07 Oct 2022 13:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665173535; cv=none; d=google.com; s=arc-20160816; b=KCa4FwpjCVoHjstIfd5Fh24aI4wccQ/5ysD4zHugv45dGTk9je3wFkmoOXkwVp+sxR juioR/VvN7Y5tg+c3ecihKSMHc2sgmsLfOWFN74ZCibbqoYc9CrsgIXHtjx0lizwuWx8 BQ0zSZU5ZqHUg2v7B4dNQCJuDsK+2PTG5mIoAJl1kd9EH9wsvDEY8+woHaR/G785zJxQ ijEIq83EzU1lHy43e19zQOwWXJW9OVOrMBGrjxI0/09WFtZdPfG0r+qiIsClUTxFckPS MkSBvsLA92BQiWtH1QashShswr5/Zk+4biuhen5/bG24OADXyPrXq5d5oWz50zUOYCE7 cZyg== 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:dkim-signature; bh=aQIAtfxw9qFz9Hl/XRNhdWvv/WP4PsamsNA94vPOScw=; b=nFOLkZHKiNUEGen5R5zFF9WxJgorTYIPnlCb9CshL15A1H87Imasn56rCpVHFkzHZL wHnIpp47zDzrhS0hIVLsPOK992VDNPsYlLFls+C0se0lSwLN052rBcU9yLxR2KSAeSMf jIwgZFTRu20bhdVb36bI/5tMynzQhwh21FFDhhdjzwVdUoZZNrOlmFmPSPEDewHrhz1b cSRscSYe7AkII/KVlOprHMgtpY6APMqLrzgwlsD3uNboBsA/lKS1ERe6QHj94SYPCiGJ O1Xo3HqbsRKJvwFdM/Ut4/cUQPtAC33P7SnbQ2RdovZpdCxkwyNzcbqRIJL7ma5c2WP2 03zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CWEz1G2S; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa36-20020a1709076d2400b0078d8cc2006csi1232875ejc.697.2022.10.07.13.11.47; Fri, 07 Oct 2022 13:12:15 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=CWEz1G2S; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229559AbiJGTrv (ORCPT + 99 others); Fri, 7 Oct 2022 15:47:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbiJGTru (ORCPT ); Fri, 7 Oct 2022 15:47:50 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6112103D98; Fri, 7 Oct 2022 12:47:48 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id l8so3486004wmi.2; Fri, 07 Oct 2022 12:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aQIAtfxw9qFz9Hl/XRNhdWvv/WP4PsamsNA94vPOScw=; b=CWEz1G2S7PpTw3YqmzToiMwiNbuD1Drf7WmIgIG8V7JJvKYsk/ZIOpnPDfjkqNtj4u x30Wo/rBxvwnjxsrYw4VshH3VQRaJNJBS9dwf2gCSam8zVwT0x57jLY0PkzPhtjRvgru yS4DFP4pSMkpeCuO9D5YZWKbdxEPxQ7p8LzZEf5/CVfFcZeDkP+bz6t9Ne7SGq+his84 FbyRlu5tBAMBVqeBr2ppFUJmG+9yQMlSq0OJ8QiwrN6HLr5Q55oU0RnQFjnA7qLh7PMq udmzxQlqNKIaMlrC1eUYEpZsqX8u/rhlv+eTU/IyYY9xZmwr1rYWaF7ZqOk8eSiOY4lC qaXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aQIAtfxw9qFz9Hl/XRNhdWvv/WP4PsamsNA94vPOScw=; b=ydom+B/eZcyzTaVw8hKrdN8r0oiMG78R0uKMJFdEUg7Ua4lP2VV7aWZIYHbfTPNgDD 7HtecK0H2/9VEqP9aX0VX7mwGru79QJ/C/xQ5VXI55wH6DmW6+cgfuHQnJZ9g+FQAWop Bhlf9w+DwKi3+zxkDpNhNtQYkfIqUxaSg6Y86uDAaBmH2H13xNvAusSPLp8X8MvzG8dG 2woRXdFEx4/buOzXj4He4vw0ku1K+ONtt2rzb/RfFNKYtYlUsyupNryFWCBf5hhhlnEo w9+Mr5nAc1lcrqvLnbLMP4J2ZEs73Q3t50S0MhPx1CE60lpIwmox4/Miozh+4b6ewVDs Vemg== X-Gm-Message-State: ACrzQf2Ar8lhB2rc0dO0BSJKY4aKkqyK063KastB3kr2KEujW5CHQj1Z jxfYW1L4z5S+QlCLjYxEACw= X-Received: by 2002:a05:600c:4ed3:b0:3b4:ade9:ecf0 with SMTP id g19-20020a05600c4ed300b003b4ade9ecf0mr11769784wmq.46.1665172066974; Fri, 07 Oct 2022 12:47:46 -0700 (PDT) Received: from localhost (cpc154979-craw9-2-0-cust193.16-3.cable.virginm.net. [80.193.200.194]) by smtp.gmail.com with ESMTPSA id e17-20020adfdbd1000000b0022ae59d472esm2705304wrj.112.2022.10.07.12.47.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 12:47:46 -0700 (PDT) From: Colin Ian King To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/i915/gem: remove redundant assignments to variable ret Date: Fri, 7 Oct 2022 20:47:45 +0100 Message-Id: <20221007194745.2749277-1-colin.i.king@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 The variable ret is being assigned with a value that is never read both before and after a while-loop. The variable is being re-assigned inside the while-loop and afterwards on the call to the function i915_gem_object_lock_interruptible. Remove the redundants assignments. Cleans up clang scan-build warnings: warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' [deadcode.DeadStores] warning: Value stored to 'ret' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King --- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c index d4398948f016..b7e24476a0fd 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c @@ -292,7 +292,7 @@ int i915_gem_object_userptr_submit_init(struct drm_i915_gem_object *obj) if (!i915_gem_object_is_readonly(obj)) gup_flags |= FOLL_WRITE; - pinned = ret = 0; + pinned = 0; while (pinned < num_pages) { ret = pin_user_pages_fast(obj->userptr.ptr + pinned * PAGE_SIZE, num_pages - pinned, gup_flags, @@ -302,7 +302,6 @@ int i915_gem_object_userptr_submit_init(struct drm_i915_gem_object *obj) pinned += ret; } - ret = 0; ret = i915_gem_object_lock_interruptible(obj, NULL); if (ret) -- 2.37.3