* [PATCH] staging: lustre: acl: Remove lustre_posix_acl_xattr_free wrapper
@ 2015-11-09 18:54 ` Shivani Bhardwaj
0 siblings, 0 replies; 10+ messages in thread
From: Shivani Bhardwaj @ 2015-11-09 18:54 UTC (permalink / raw)
To: gregkh; +Cc: andreas.dilger, oleg.drokin, lustre-devel, linux-kernel, devel
Remove the wrapper function lustre_posix_acl_xattr_free() and replace its
call in the file xattr with the function kfree() that it wrapped. Also,
its prototype from the header lustre_eacl is removed as it is no longer
of any use.
Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
drivers/staging/lustre/lustre/include/lustre_eacl.h | 2 --
drivers/staging/lustre/lustre/llite/xattr.c | 5 ++++-
drivers/staging/lustre/lustre/obdclass/acl.c | 9 ---------
3 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/lustre/lustre/include/lustre_eacl.h b/drivers/staging/lustre/lustre/include/lustre_eacl.h
index fee4d2c..0b66593 100644
--- a/drivers/staging/lustre/lustre/include/lustre_eacl.h
+++ b/drivers/staging/lustre/lustre/include/lustre_eacl.h
@@ -76,8 +76,6 @@ extern int
lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, size_t size,
posix_acl_xattr_header **out);
extern void
-lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size);
-extern void
lustre_ext_acl_xattr_free(ext_acl_xattr_header *header);
extern ext_acl_xattr_header *
lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c
index 4b7eb33..f9b1dee 100644
--- a/drivers/staging/lustre/lustre/llite/xattr.c
+++ b/drivers/staging/lustre/lustre/llite/xattr.c
@@ -193,7 +193,10 @@ int ll_setxattr_common(struct inode *inode, const char *name,
ll_i2suppgid(inode), &req);
#ifdef CONFIG_FS_POSIX_ACL
if (new_value != NULL)
- lustre_posix_acl_xattr_free(new_value, size);
+ /*
+ * Release the posix ACL space.
+ */
+ kfree(new_value);
if (acl != NULL)
lustre_ext_acl_xattr_free(acl);
#endif
diff --git a/drivers/staging/lustre/lustre/obdclass/acl.c b/drivers/staging/lustre/lustre/obdclass/acl.c
index 2e20cf6..49ba885 100644
--- a/drivers/staging/lustre/lustre/obdclass/acl.c
+++ b/drivers/staging/lustre/lustre/obdclass/acl.c
@@ -236,15 +236,6 @@ _out:
EXPORT_SYMBOL(lustre_posix_acl_xattr_filter);
/*
- * Release the posix ACL space.
- */
-void lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size)
-{
- kfree(header);
-}
-EXPORT_SYMBOL(lustre_posix_acl_xattr_free);
-
-/*
* Release the extended ACL space.
*/
void lustre_ext_acl_xattr_free(ext_acl_xattr_header *header)
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [lustre-devel] [PATCH] staging: lustre: acl: Remove lustre_posix_acl_xattr_free wrapper
@ 2015-11-09 18:54 ` Shivani Bhardwaj
0 siblings, 0 replies; 10+ messages in thread
From: Shivani Bhardwaj @ 2015-11-09 18:54 UTC (permalink / raw)
To: lustre-devel
Remove the wrapper function lustre_posix_acl_xattr_free() and replace its
call in the file xattr with the function kfree() that it wrapped. Also,
its prototype from the header lustre_eacl is removed as it is no longer
of any use.
Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
drivers/staging/lustre/lustre/include/lustre_eacl.h | 2 --
drivers/staging/lustre/lustre/llite/xattr.c | 5 ++++-
drivers/staging/lustre/lustre/obdclass/acl.c | 9 ---------
3 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/lustre/lustre/include/lustre_eacl.h b/drivers/staging/lustre/lustre/include/lustre_eacl.h
index fee4d2c..0b66593 100644
--- a/drivers/staging/lustre/lustre/include/lustre_eacl.h
+++ b/drivers/staging/lustre/lustre/include/lustre_eacl.h
@@ -76,8 +76,6 @@ extern int
lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, size_t size,
posix_acl_xattr_header **out);
extern void
-lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size);
-extern void
lustre_ext_acl_xattr_free(ext_acl_xattr_header *header);
extern ext_acl_xattr_header *
lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c
index 4b7eb33..f9b1dee 100644
--- a/drivers/staging/lustre/lustre/llite/xattr.c
+++ b/drivers/staging/lustre/lustre/llite/xattr.c
@@ -193,7 +193,10 @@ int ll_setxattr_common(struct inode *inode, const char *name,
ll_i2suppgid(inode), &req);
#ifdef CONFIG_FS_POSIX_ACL
if (new_value != NULL)
- lustre_posix_acl_xattr_free(new_value, size);
+ /*
+ * Release the posix ACL space.
+ */
+ kfree(new_value);
if (acl != NULL)
lustre_ext_acl_xattr_free(acl);
#endif
diff --git a/drivers/staging/lustre/lustre/obdclass/acl.c b/drivers/staging/lustre/lustre/obdclass/acl.c
index 2e20cf6..49ba885 100644
--- a/drivers/staging/lustre/lustre/obdclass/acl.c
+++ b/drivers/staging/lustre/lustre/obdclass/acl.c
@@ -236,15 +236,6 @@ _out:
EXPORT_SYMBOL(lustre_posix_acl_xattr_filter);
/*
- * Release the posix ACL space.
- */
-void lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size)
-{
- kfree(header);
-}
-EXPORT_SYMBOL(lustre_posix_acl_xattr_free);
-
-/*
* Release the extended ACL space.
*/
void lustre_ext_acl_xattr_free(ext_acl_xattr_header *header)
--
2.1.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] staging: lustre: acl: fix ifnullfree.cocci warnings
2015-11-09 18:54 ` [lustre-devel] " Shivani Bhardwaj
@ 2015-11-09 19:43 ` kbuild test robot
-1 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2015-11-09 19:43 UTC (permalink / raw)
To: Shivani Bhardwaj
Cc: kbuild-all, gregkh, andreas.dilger, oleg.drokin, lustre-devel,
linux-kernel, devel
drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
NULL check before some freeing functions is not needed.
Based on checkpatch warning
"kfree(NULL) is safe this check is probably not required"
and kfreeaddr.cocci by Julia Lawall.
Generated by: scripts/coccinelle/free/ifnullfree.cocci
CC: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
xattr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/staging/lustre/lustre/llite/xattr.c
+++ b/drivers/staging/lustre/lustre/llite/xattr.c
@@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *ino
valid, name, pv, size, 0, flags,
ll_i2suppgid(inode), &req);
#ifdef CONFIG_FS_POSIX_ACL
- if (new_value != NULL)
/*
* Release the posix ACL space.
*/
- kfree(new_value);
+ kfree(new_value);
if (acl != NULL)
lustre_ext_acl_xattr_free(acl);
#endif
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] staging: lustre: acl: Remove lustre_posix_acl_xattr_free wrapper
2015-11-09 18:54 ` [lustre-devel] " Shivani Bhardwaj
@ 2015-11-09 19:43 ` kbuild test robot
-1 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2015-11-09 19:43 UTC (permalink / raw)
To: Shivani Bhardwaj
Cc: kbuild-all, gregkh, andreas.dilger, oleg.drokin, lustre-devel,
linux-kernel, devel
Hi Shivani,
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.3 next-20151109]
url: https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-acl-Remove-lustre_posix_acl_xattr_free-wrapper/20151110-025757
coccinelle warnings: (new ones prefixed by >>)
>> drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 10+ messages in thread
* [lustre-devel] [PATCH] staging: lustre: acl: fix ifnullfree.cocci warnings
@ 2015-11-09 19:43 ` kbuild test robot
0 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2015-11-09 19:43 UTC (permalink / raw)
To: lustre-devel
drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
NULL check before some freeing functions is not needed.
Based on checkpatch warning
"kfree(NULL) is safe this check is probably not required"
and kfreeaddr.cocci by Julia Lawall.
Generated by: scripts/coccinelle/free/ifnullfree.cocci
CC: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
xattr.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/staging/lustre/lustre/llite/xattr.c
+++ b/drivers/staging/lustre/lustre/llite/xattr.c
@@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *ino
valid, name, pv, size, 0, flags,
ll_i2suppgid(inode), &req);
#ifdef CONFIG_FS_POSIX_ACL
- if (new_value != NULL)
/*
* Release the posix ACL space.
*/
- kfree(new_value);
+ kfree(new_value);
if (acl != NULL)
lustre_ext_acl_xattr_free(acl);
#endif
^ permalink raw reply [flat|nested] 10+ messages in thread
* [lustre-devel] [PATCH] staging: lustre: acl: Remove lustre_posix_acl_xattr_free wrapper
@ 2015-11-09 19:43 ` kbuild test robot
0 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2015-11-09 19:43 UTC (permalink / raw)
To: lustre-devel
Hi Shivani,
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.3 next-20151109]
url: https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-acl-Remove-lustre_posix_acl_xattr_free-wrapper/20151110-025757
coccinelle warnings: (new ones prefixed by >>)
>> drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
Please review and possibly fold the followup patch.
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] staging: lustre: acl: fix ifnullfree.cocci warnings
2015-11-09 19:43 ` [lustre-devel] " kbuild test robot
@ 2015-11-09 19:59 ` Greg KH
-1 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2015-11-09 19:59 UTC (permalink / raw)
To: Julia Lawall, kbuild test robot
Cc: Shivani Bhardwaj, kbuild-all, andreas.dilger, oleg.drokin,
lustre-devel, linux-kernel, devel
On Tue, Nov 10, 2015 at 03:43:50AM +0800, kbuild test robot wrote:
> drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
>
> NULL check before some freeing functions is not needed.
>
> Based on checkpatch warning
> "kfree(NULL) is safe this check is probably not required"
> and kfreeaddr.cocci by Julia Lawall.
>
> Generated by: scripts/coccinelle/free/ifnullfree.cocci
>
> CC: Shivani Bhardwaj <shivanib134@gmail.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
>
> xattr.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- a/drivers/staging/lustre/lustre/llite/xattr.c
> +++ b/drivers/staging/lustre/lustre/llite/xattr.c
> @@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *ino
> valid, name, pv, size, 0, flags,
> ll_i2suppgid(inode), &req);
> #ifdef CONFIG_FS_POSIX_ACL
> - if (new_value != NULL)
> /*
> * Release the posix ACL space.
> */
> - kfree(new_value);
> + kfree(new_value);
Looks like a bug in coccinelle, the comment line should also be indented
to the left.
Julia, any ideas?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* [lustre-devel] [PATCH] staging: lustre: acl: fix ifnullfree.cocci warnings
@ 2015-11-09 19:59 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2015-11-09 19:59 UTC (permalink / raw)
To: lustre-devel
On Tue, Nov 10, 2015 at 03:43:50AM +0800, kbuild test robot wrote:
> drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
>
> NULL check before some freeing functions is not needed.
>
> Based on checkpatch warning
> "kfree(NULL) is safe this check is probably not required"
> and kfreeaddr.cocci by Julia Lawall.
>
> Generated by: scripts/coccinelle/free/ifnullfree.cocci
>
> CC: Shivani Bhardwaj <shivanib134@gmail.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
>
> xattr.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- a/drivers/staging/lustre/lustre/llite/xattr.c
> +++ b/drivers/staging/lustre/lustre/llite/xattr.c
> @@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *ino
> valid, name, pv, size, 0, flags,
> ll_i2suppgid(inode), &req);
> #ifdef CONFIG_FS_POSIX_ACL
> - if (new_value != NULL)
> /*
> * Release the posix ACL space.
> */
> - kfree(new_value);
> + kfree(new_value);
Looks like a bug in coccinelle, the comment line should also be indented
to the left.
Julia, any ideas?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] staging: lustre: acl: fix ifnullfree.cocci warnings
2015-11-09 19:59 ` [lustre-devel] " Greg KH
@ 2015-11-09 22:04 ` Julia Lawall
-1 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2015-11-09 22:04 UTC (permalink / raw)
To: Greg KH
Cc: kbuild test robot, Shivani Bhardwaj, kbuild-all, andreas.dilger,
oleg.drokin, lustre-devel, linux-kernel, devel
On Mon, 9 Nov 2015, Greg KH wrote:
> On Tue, Nov 10, 2015 at 03:43:50AM +0800, kbuild test robot wrote:
> > drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
> >
> > NULL check before some freeing functions is not needed.
> >
> > Based on checkpatch warning
> > "kfree(NULL) is safe this check is probably not required"
> > and kfreeaddr.cocci by Julia Lawall.
> >
> > Generated by: scripts/coccinelle/free/ifnullfree.cocci
> >
> > CC: Shivani Bhardwaj <shivanib134@gmail.com>
> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> > ---
> >
> > xattr.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > --- a/drivers/staging/lustre/lustre/llite/xattr.c
> > +++ b/drivers/staging/lustre/lustre/llite/xattr.c
> > @@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *ino
> > valid, name, pv, size, 0, flags,
> > ll_i2suppgid(inode), &req);
> > #ifdef CONFIG_FS_POSIX_ACL
> > - if (new_value != NULL)
> > /*
> > * Release the posix ACL space.
> > */
> > - kfree(new_value);
> > + kfree(new_value);
>
> Looks like a bug in coccinelle, the comment line should also be indented
> to the left.
>
> Julia, any ideas?
I think it's on the border of what the person is going to have to resign
themselves to doing by hand. I'm not sure which side of the border it is
on, but I try to focus more on getting the code printed in the right place
than on the comments. I can check on it, though, and maybe an easy fix is
possible.
thanks,
julia
^ permalink raw reply [flat|nested] 10+ messages in thread
* [lustre-devel] [PATCH] staging: lustre: acl: fix ifnullfree.cocci warnings
@ 2015-11-09 22:04 ` Julia Lawall
0 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2015-11-09 22:04 UTC (permalink / raw)
To: lustre-devel
On Mon, 9 Nov 2015, Greg KH wrote:
> On Tue, Nov 10, 2015 at 03:43:50AM +0800, kbuild test robot wrote:
> > drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values.
> >
> > NULL check before some freeing functions is not needed.
> >
> > Based on checkpatch warning
> > "kfree(NULL) is safe this check is probably not required"
> > and kfreeaddr.cocci by Julia Lawall.
> >
> > Generated by: scripts/coccinelle/free/ifnullfree.cocci
> >
> > CC: Shivani Bhardwaj <shivanib134@gmail.com>
> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> > ---
> >
> > xattr.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > --- a/drivers/staging/lustre/lustre/llite/xattr.c
> > +++ b/drivers/staging/lustre/lustre/llite/xattr.c
> > @@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *ino
> > valid, name, pv, size, 0, flags,
> > ll_i2suppgid(inode), &req);
> > #ifdef CONFIG_FS_POSIX_ACL
> > - if (new_value != NULL)
> > /*
> > * Release the posix ACL space.
> > */
> > - kfree(new_value);
> > + kfree(new_value);
>
> Looks like a bug in coccinelle, the comment line should also be indented
> to the left.
>
> Julia, any ideas?
I think it's on the border of what the person is going to have to resign
themselves to doing by hand. I'm not sure which side of the border it is
on, but I try to focus more on getting the code printed in the right place
than on the comments. I can check on it, though, and maybe an easy fix is
possible.
thanks,
julia
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-11-09 22:04 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-09 19:43 [PATCH] staging: lustre: acl: Remove lustre_posix_acl_xattr_free wrapper kbuild test robot
2015-11-09 19:43 ` [lustre-devel] " kbuild test robot
2015-11-09 18:54 ` Shivani Bhardwaj
2015-11-09 18:54 ` [lustre-devel] " Shivani Bhardwaj
2015-11-09 19:43 ` [PATCH] staging: lustre: acl: fix ifnullfree.cocci warnings kbuild test robot
2015-11-09 19:43 ` [lustre-devel] " kbuild test robot
2015-11-09 19:59 ` Greg KH
2015-11-09 19:59 ` [lustre-devel] " Greg KH
2015-11-09 22:04 ` Julia Lawall
2015-11-09 22:04 ` [lustre-devel] " Julia Lawall
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.