Search Linux Wireless

RE: [PATCH] net/mac80211: replace scnprintf() with sysfs_emit() for sysfs output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> --- 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,


[...]






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux