lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 23 Jan 2018 19:08:15 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Donglin Peng <dolinux.peng@...il.com>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>,
        ALSA Development Mailing List <alsa-devel@...a-project.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] ASoC: use seq_file to dump the contents of
 dai_list,platform_list and codec_list

On Thu, Jan 18, 2018 at 7:31 AM, Donglin Peng <dolinux.peng@...il.com> wrote:
> Now the debugfs files dais/platforms/codecs have a size limit PAGE_SIZE and
> the user can not see the whole contents of dai_list/platform_list/codec_list
> when they are larger than this limit.
>
> This patch uses seq_file instead to make sure dais/platforms/codecs show the
> full contents of dai_list/platform_list/codec_list.

If it's not critical, I would suggest to wait till v4.16-rc1, where I
would like to push [1], and switch to DEFINE_SHOW_ATTRIBUTE() macro.


> +static int codec_list_seq_open(struct inode *inode, struct file *file)
> +{
> +       return single_open(file, codec_list_seq_show, NULL);
>  }
>
>  static const struct file_operations codec_list_fops = {
> +       .open = codec_list_seq_open,
> +       .read = seq_read,
> +       .llseek = seq_lseek,
> +       .release = single_release,
>  };

This will be just

DEFINE_SHOW_ATTRIBUTE(codec_list_seq);

> +static int dai_list_seq_open(struct inode *inode, struct file *file)
> +{
> +       return single_open(file, dai_list_seq_show, NULL);
>  }
>
>  static const struct file_operations dai_list_fops = {
> +       .open = dai_list_seq_open,
> +       .read = seq_read,
> +       .llseek = seq_lseek,
> +       .release = single_release,
>  };

Ditto.

> +static int platform_list_seq_open(struct inode *inode, struct file *file)
> +{
> +       return single_open(file, platform_list_seq_show, NULL);
>  }
>
>  static const struct file_operations platform_list_fops = {
> +       .open = platform_list_seq_open,
> +       .read = seq_read,
> +       .llseek = seq_lseek,
> +       .release = single_release,
>  };

Ditto.

[1]: https://patchwork.kernel.org/patch/10178813/

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ