All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Pranay Samala <pranay.samala@intel.com>
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
Date: Wed, 16 Jul 2025 08:00:27 -0700	[thread overview]
Message-ID: <87wm88ch9w.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20250716132752.1279098-1-pranay.samala@intel.com>

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 <ashutosh.dixit@intel.com>

>
> Fixes: 835f38b71973 ("lib/igt_sysfs: Update new debug mask requested by user")
> Signed-off-by: Pranay Samala <pranay.samala@intel.com>
> ---
>  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
>

  reply	other threads:[~2025-07-16 15:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 13:27 [PATCH i-g-t] lib/igt_sysfs: Remove redundant variable assignment Pranay Samala
2025-07-16 15:00 ` Dixit, Ashutosh [this message]
2025-07-16 17:40 ` ✓ i915.CI.BAT: success for " Patchwork
2025-07-16 18:45 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-17 10:36 ` ✗ i915.CI.Full: failure " Patchwork
2025-07-17 10:44 ` [PATCH i-g-t] " Kamil Konieczny
2025-07-17 12:01 ` ✓ i915.CI.Full: success for " Patchwork
2025-07-17 13:52 ` ✗ Xe.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wm88ch9w.wl-ashutosh.dixit@intel.com \
    --to=ashutosh.dixit@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@intel.com \
    --cc=pranay.samala@intel.com \
    --cc=sameer.lattannavar@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.