Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp968370pxb; Fri, 13 Aug 2021 10:16:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHL3iXgmc8zKneu+ONRw0MY3o09dtennl3wQSE1TKWEzaBdUlUSacytxEcR5eSMhJlgsSg X-Received: by 2002:adf:db83:: with SMTP id u3mr4506463wri.363.1628874973816; Fri, 13 Aug 2021 10:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628874973; cv=none; d=google.com; s=arc-20160816; b=J/qH4olV+i3VFEYx//O/xoQCAFJIRA6063tCRWVaDMsbpOxlew2KXFB6+uJw41cxOT G9bSubww+jc7zywonAMbIRtRmm3ASsxLw6KL3AEHMjugsm0jzGHEqSKuDO82X49LKeNu AMktKeCCauRULyE2ddB9DsGRzuwdb4Ys8fURP5hHMXFv5FBR6zC2GFAMggXhfv12YfIO 9/vIDdmi/DXqZ8+NI6l/P56+VKskkbbaYRxVgNzQZLM/5Le34uggQ82I6bIvRYOtALkF 9PE1GKMuCZp8dHBOzP744UE8/Dvt03M9gXa1oeoYMII3FFZhOPCOp+vntAqFjtAZkTUE EraA== 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=2Rv4Q6xhzfcZ7cC2wbNL+C6oF/NzlokwayEWhNa2AyI=; b=OEUU9tYgxcKIfK2LQPiqW1wsgCFeDfFL9orG89tmciyBDFFK0GTdb3aSDMta42sdx7 tbGb80TuQfMfNffyt0JB05wGSbsvQDTVTmFdKDMohb/jEE5eia33Z02M6JDV8lGpGz40 DsYaQFeVaKGnYLA8LkjNOQX7/75yhDn82rkIaxrfQvWN9gPXapV7P8QQOfc7JJPy9dEq h9ZwAy+SE6JD/9/jvlE8sCc0nNYLyFMykXSWwLyBkq9efFGcx7X3sN7pxx8f9LJSuv42 CHwqI647h0prprT8o9NL4+HzDkONw2m/WQa8nnYchCH15im3S+dPCZvJ60Xu3QBV/9BA Xb/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I7vDjYOo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si2798411ejh.472.2021.08.13.10.15.49; Fri, 13 Aug 2021 10:16:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I7vDjYOo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbhHMROT (ORCPT + 99 others); Fri, 13 Aug 2021 13:14:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:35360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbhHMROB (ORCPT ); Fri, 13 Aug 2021 13:14:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8BA1C60F91; Fri, 13 Aug 2021 17:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628874734; bh=E0Rd8uuRj9V4s/5yGBq/lhcjLlVd74GgQ8rhT3/6j30=; h=From:To:Cc:Subject:Date:From; b=I7vDjYOooR5E8ZiW45+6N1xtm/mJrPRPb5euk0MUhVfuKc70li+mGDWSl7rEqCNal VOtH/VfAENMm4DX3NV4NI8HNHpB46LuykNqvljA4xEcq7/Z7tMVdIeB5wFE5U/0Zzo l61AEPIU5XtzQWTdyhg8ApGEA6dRaNgVKR664feL0ft0K7tZOqDRQdG/FVG2Ecq3Tj 64Tr224tTPLOsuEDF/gAW+MU7ag0UPygynlPfj+okX6sLHym8ICUpFCs+x3g45WTvb Iys7/GqrN7KogTtmrhw+RCePqdi27xK/Fm50R3tzBkITRLVa16ByxeVWOhExaWgG8B W7Z7wDEHg+9BA== From: Nathan Chancellor To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi Cc: John Harrison , Matthew Brost , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, kernel-janitors@vger.kernel.org, Nathan Chancellor , Dan Carpenter Subject: [PATCH] drm/i915/selftest: Fix use of err in igt_reset_{fail,nop}_engine() Date: Fri, 13 Aug 2021 10:11:58 -0700 Message-Id: <20210813171158.2665823-1-nathan@kernel.org> X-Mailer: git-send-email 2.33.0.rc2 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns: In file included from drivers/gpu/drm/i915/gt/intel_reset.c:1514: drivers/gpu/drm/i915/gt/selftest_hangcheck.c:465:62: warning: variable 'err' is uninitialized when used here [-Wuninitialized] pr_err("[%s] Create context failed: %d!\n", engine->name, err); ^~~ ... drivers/gpu/drm/i915/gt/selftest_hangcheck.c:580:62: warning: variable 'err' is uninitialized when used here [-Wuninitialized] pr_err("[%s] Create context failed: %d!\n", engine->name, err); ^~~ ... 2 warnings generated. This appears to be a copy and paste issue. Use ce directly using the %pe specifier to pretty print the error code so that err is not used uninitialized in these functions. Fixes: 3a7b72665ea5 ("drm/i915/selftest: Bump selftest timeouts for hangcheck") Reported-by: Dan Carpenter Signed-off-by: Nathan Chancellor --- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c index 08f011f893b2..2c1ed32ca5ac 100644 --- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c +++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c @@ -462,7 +462,7 @@ static int igt_reset_nop_engine(void *arg) ce = intel_context_create(engine); if (IS_ERR(ce)) { - pr_err("[%s] Create context failed: %d!\n", engine->name, err); + pr_err("[%s] Create context failed: %pe!\n", engine->name, ce); return PTR_ERR(ce); } @@ -577,7 +577,7 @@ static int igt_reset_fail_engine(void *arg) ce = intel_context_create(engine); if (IS_ERR(ce)) { - pr_err("[%s] Create context failed: %d!\n", engine->name, err); + pr_err("[%s] Create context failed: %pe!\n", engine->name, ce); return PTR_ERR(ce); } base-commit: 927dfdd09d8c03ba100ed0c8c3915f8e1d1f5556 -- 2.33.0.rc2