diff mbox

[net-next,10/13] debugfs: constify argument to debugfs_real_fops()

Message ID 1478181538-20778-11-git-send-email-jakub.kicinski@netronome.com
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Jakub Kicinski Nov. 3, 2016, 1:58 p.m. UTC
seq_file users can only access const version of file pointer,
make parameter to debugfs_real_fops() const.

CC: Nicolai Stange <nicstange@gmail.com>
CC: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 include/linux/debugfs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nicolai Stange Nov. 3, 2016, 4:55 p.m. UTC | #1
Hi Jakub,

thanks for this.

However, the debugfs maintainer, Greg K-H, as well as the lkml is
missing from the To/Cc. Can you resend please?

Jakub Kicinski <jakub.kicinski@netronome.com> writes:

> seq_file users can only access const version of file pointer,

... because the ->file member of struct seq_operations is marked as such.

> make parameter to debugfs_real_fops() const.
>
> CC: Nicolai Stange <nicstange@gmail.com>
> CC: Christian Lamparter <chunkeey@gmail.com>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> ---
>  include/linux/debugfs.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
> index 4d3f0d1aec73..bf1907d96097 100644
> --- a/include/linux/debugfs.h
> +++ b/include/linux/debugfs.h
> @@ -52,7 +52,8 @@ struct debugfs_regset32 {
>   * Must only be called under the protection established by
>   * debugfs_use_file_start().
>   */
> -static inline const struct file_operations *debugfs_real_fops(struct file *filp)
> +static inline const struct file_operations *
> +debugfs_real_fops(const struct file *filp)
>  	__must_hold(&debugfs_srcu)
>  {
>  	/*
Jakub Kicinski Nov. 3, 2016, 4:58 p.m. UTC | #2
On Thu, 03 Nov 2016 17:55:39 +0100, Nicolai Stange wrote:
> Hi Jakub,
> 
> thanks for this.
> 
> However, the debugfs maintainer, Greg K-H, as well as the lkml is
> missing from the To/Cc. Can you resend please?

Sure thing!

> Jakub Kicinski <jakub.kicinski@netronome.com> writes:
> 
> > seq_file users can only access const version of file pointer,  
> 
> ... because the ->file member of struct seq_operations is marked as such.

Thanks!
diff mbox

Patch

diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 4d3f0d1aec73..bf1907d96097 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -52,7 +52,8 @@  struct debugfs_regset32 {
  * Must only be called under the protection established by
  * debugfs_use_file_start().
  */
-static inline const struct file_operations *debugfs_real_fops(struct file *filp)
+static inline const struct file_operations *
+debugfs_real_fops(const struct file *filp)
 	__must_hold(&debugfs_srcu)
 {
 	/*