From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 538AEC83F1B for ; Wed, 16 Jul 2025 15:00:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07D0B10E684; Wed, 16 Jul 2025 15:00:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="C+rD2Qj/"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 27F6910E684 for ; Wed, 16 Jul 2025 15:00:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1752678030; x=1784214030; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=IMoevOjnHMWggmvMS/Svhts6KUn0uY0WBqv9pVmNNuo=; b=C+rD2Qj/PDqUUT+/KhWyycd7qAh7NdJZ0c+HVR4X2hA11kdj5fYcOcwl FMj2aVWAgDiCtZ6IgfPSvguGkuAfLgy9ZSHG3PO0a5FQhX6Ubf87MFEEU AXHyn8OSkQvXwWr7tMIAc0e3SHG8rPldWOcpPMm8jaQ3d9+9lQhlJfn7/ o+JhgoeWKh6JE3XfAcThRG2Q9SV/GUbXml48h5C0LH3+lUfpkovDY/zo/ M97fheiDF2btweY9rABPesOep/64P8K5GV7diR1H81os5ixbY6creodZ0 QIEt50WMX6MYdZ79LKbFF50Lv088q3N4VlihzKnv8Xr0rghx3athoNOSy A==; X-CSE-ConnectionGUID: 4W/hRaFLSJ6tW5me5xHcJA== X-CSE-MsgGUID: ylF19vlvQTGLhn5QB3vY5A== X-IronPort-AV: E=McAfee;i="6800,10657,11493"; a="65992979" X-IronPort-AV: E=Sophos;i="6.16,316,1744095600"; d="scan'208";a="65992979" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2025 08:00:29 -0700 X-CSE-ConnectionGUID: vwTIdyGeTQKbUJ99tw8lNA== X-CSE-MsgGUID: mW1l9DwcRuaXQY4HkkfdXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,316,1744095600"; d="scan'208";a="163068667" Received: from aobeliae-mobl3.amr.corp.intel.com (HELO adixit-MOBL3.intel.com) ([10.125.82.158]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2025 08:00:29 -0700 Date: Wed, 16 Jul 2025 08:00:27 -0700 Message-ID: <87wm88ch9w.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Pranay Samala Cc: igt-dev@lists.freedesktop.org, karthik.b.s@intel.com, sameer.lattannavar@intel.com Subject: Re: [PATCH i-g-t] lib/igt_sysfs: Remove redundant variable assignment In-Reply-To: <20250716132752.1279098-1-pranay.samala@intel.com> References: <20250716132752.1279098-1-pranay.samala@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" On Wed, 16 Jul 2025 06:27:52 -0700, Pranay Samala wrote: > > Eliminate redundant assignment in debug mask setup. > Simplified the logic by directly using the input > parameter for logging and sysfs operations. There is no redundant assignment, new_debug_mask was not even assigned a value. Strange this code went through code review and was merged :/ Anyway, looks correct now: Reviewed-by: Ashutosh Dixit > > Fixes: 835f38b71973 ("lib/igt_sysfs: Update new debug mask requested by user") > Signed-off-by: Pranay Samala > --- > lib/igt_sysfs.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c > index aec157b5b..96ca57ed9 100644 > --- a/lib/igt_sysfs.c > +++ b/lib/igt_sysfs.c > @@ -506,7 +506,6 @@ void igt_drm_debug_mask_reset_exit_handler(int sig) > */ > void igt_drm_debug_mask_update(unsigned int mask_to_set) > { > - unsigned int new_debug_mask; > static bool debug_mask_read_once = true; > char buf[20]; > int dir; > @@ -525,8 +524,8 @@ void igt_drm_debug_mask_update(unsigned int mask_to_set) > } > } > > - igt_debug("Setting DRM debug mask to %d\n", new_debug_mask); > - snprintf(buf, sizeof(buf), "%d", new_debug_mask); > + igt_debug("Setting DRM debug mask to %d\n", mask_to_set); > + snprintf(buf, sizeof(buf), "%d", mask_to_set); > igt_assert(igt_sysfs_set(dir, "debug", buf)); > > close(dir); > -- > 2.34.1 >