From: Ping-Ke Shih <pkshih@realtek.com>
To: Mande Imran Ahmed <immu.ahmed1905@gmail.com>,
"johannes@sipsolutions.net" <johannes@sipsolutions.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] net/mac80211: replace scnprintf() with sysfs_emit() for sysfs output
Date: Thu, 31 Jul 2025 01:44:37 +0000 [thread overview]
Message-ID: <5b63288d487547f1a4e6df426432ea0b@realtek.com> (raw)
In-Reply-To: <20250730095634.3754-1-immu.ahmed1905@gmail.com>
> --- 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,
[...]
next prev parent reply other threads:[~2025-07-31 1:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 9:56 [PATCH] net/mac80211: replace scnprintf() with sysfs_emit() for sysfs output Mande Imran Ahmed
2025-07-31 1:44 ` Ping-Ke Shih [this message]
2025-08-01 3:32 ` kernel test robot
2025-08-08 6:21 ` kernel test robot
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=5b63288d487547f1a4e6df426432ea0b@realtek.com \
--to=pkshih@realtek.com \
--cc=immu.ahmed1905@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/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.