]> git.baikalelectronics.ru Git - kernel.git/commit
staging/lustre: Different prototypes between the declaration and the definition
authorLoïc Pellegrino <oort10@gmail.com>
Thu, 4 Sep 2014 18:28:50 +0000 (19:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Sep 2014 05:05:34 +0000 (22:05 -0700)
commitb64038c27db5f4e5e3fe625657c814ac7bed1f11
tree1aa512376751546a185f1af279c0a52dedd07ebf
parent3732119c2ffbff9f6492efb0e7c9a5c76ad129bd
staging/lustre: Different prototypes between the declaration and the definition

Align the prototype of lprocfs_wr_uint() in the declaration with the one used
in the definition.

The prototype is:
int lprocfs_wr_uint(struct file *file, const char __user *buffer,
                    unsigned long count, void *data)
In obdclass/lprocfs_status.c

But in lustre/include/lprocfs_status.h, the __user annotation is missing for
the attribute buffer.

The correct prototype is the first one (the definition) since:
- This function is eventually called by the write() function pointer of an
instance of struct file_operations
- In this function, buffer is a parameter of copy_from_user()
- Before the commit 814f30515fd6c9c74c54e1b67b51fe44ca3509ef, the declaration
and the definition had the same prototype, but only the .c has been updated.

Correcting this will remove a sparse error and add sparse warnings.
This is a task of the Eudyptula challenge.

Signed-off-by: Loïc Pellegrino <oort10@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/lprocfs_status.h