[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5b63288d487547f1a4e6df426432ea0b@realtek.com>
Date: Thu, 31 Jul 2025 01:44:37 +0000
From: Ping-Ke Shih <pkshih@...ltek.com>
To: Mande Imran Ahmed <immu.ahmed1905@...il.com>,
"johannes@...solutions.net"
<johannes@...solutions.net>
CC: "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] net/mac80211: replace scnprintf() with sysfs_emit() for sysfs output
> --- a/net/mac80211/debugfs.c
> +++ b/net/mac80211/debugfs.c
[...]
> @@ -152,16 +152,15 @@ static ssize_t airtime_flags_read(struct file *file,
> size_t count, loff_t *ppos)
> {
> struct ieee80211_local *local = file->private_data;
> - char buf[128] = {}, *pos, *end;
> + char buf[128] = {}, *pos;
The assumption of buffer size in sysfs_emit() is PAGE_SIZE, but obviously
here is 128. Also, this is not sysfs.
Maybe, I'd ignore this patch since I have commented this in your patch that
changes similar stuff in rtw89 driver. Just share some information for
other reviewers.
>
> pos = buf;
> - end = pos + sizeof(buf) - 1;
>
> if (local->airtime_flags & AIRTIME_USE_TX)
> - pos += scnprintf(pos, end - pos, "AIRTIME_TX\t(%lx)\n",
> + pos += sysfs_emit(pos, "AIRTIME_TX\t(%lx)\n",
> AIRTIME_USE_TX);
> if (local->airtime_flags & AIRTIME_USE_RX)
> - pos += scnprintf(pos, end - pos, "AIRTIME_RX\t(%lx)\n",
> + pos += sysfs_emit(pos, "AIRTIME_RX\t(%lx)\n",
> AIRTIME_USE_RX);
>
> return simple_read_from_buffer(user_buf, count, ppos, buf,
[...]
Powered by blists - more mailing lists