* [PATCH 0/3] Remove wrapper function and clean up the code @ 2015-11-06 17:17 Shivani Bhardwaj 2015-11-06 17:18 ` [PATCH 1/3] Staging: lustre: module: Replace function calls Shivani Bhardwaj ` (2 more replies) 0 siblings, 3 replies; 10+ messages in thread From: Shivani Bhardwaj @ 2015-11-06 17:17 UTC (permalink / raw) To: gregkh; +Cc: oleg.drokin, andreas.dilger, devel, linux-kernel This patchset removes a wrapper function, its prototype and replace its calls in different files with a standard function. After applying this patch, code becomes cleaner. Shivani Bhardwaj (3): Staging: lustre: module: Replace function calls Staging: lustre: tracefile: Remove wrapper function Staging: lustre: tracefile: Remove function prototype drivers/staging/lustre/lustre/libcfs/module.c | 4 ++-- drivers/staging/lustre/lustre/libcfs/tracefile.c | 9 ++------- drivers/staging/lustre/lustre/libcfs/tracefile.h | 1 - 3 files changed, 4 insertions(+), 10 deletions(-) -- 2.1.0 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/3] Staging: lustre: module: Replace function calls 2015-11-06 17:17 [PATCH 0/3] Remove wrapper function and clean up the code Shivani Bhardwaj @ 2015-11-06 17:18 ` Shivani Bhardwaj 2015-11-06 22:04 ` Simmons, James A. 2015-11-06 17:19 ` [PATCH 2/3] Staging: lustre: tracefile: Remove wrapper function Shivani Bhardwaj 2015-11-06 17:19 ` [PATCH 3/3] Staging: lustre: tracefile: Remove function prototype Shivani Bhardwaj 2 siblings, 1 reply; 10+ messages in thread From: Shivani Bhardwaj @ 2015-11-06 17:18 UTC (permalink / raw) To: gregkh; +Cc: oleg.drokin, andreas.dilger, devel, linux-kernel Replace the calls of function cfs_trace_free_string_buffer() with kfree() as the former function is not required. Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> --- drivers/staging/lustre/lustre/libcfs/module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c index 50e8fd2..516a9e7 100644 --- a/drivers/staging/lustre/lustre/libcfs/module.c +++ b/drivers/staging/lustre/lustre/libcfs/module.c @@ -392,7 +392,7 @@ static int __proc_dobitmasks(void *data, int write, } else { rc = cfs_trace_copyin_string(tmpstr, tmpstrlen, buffer, nob); if (rc < 0) { - cfs_trace_free_string_buffer(tmpstr, tmpstrlen); + kfree(tmpstr); return rc; } @@ -402,7 +402,7 @@ static int __proc_dobitmasks(void *data, int write, *mask |= D_EMERG; } - cfs_trace_free_string_buffer(tmpstr, tmpstrlen); + kfree(tmpstr); return rc; } -- 2.1.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* RE: [PATCH 1/3] Staging: lustre: module: Replace function calls 2015-11-06 17:18 ` [PATCH 1/3] Staging: lustre: module: Replace function calls Shivani Bhardwaj @ 2015-11-06 22:04 ` Simmons, James A. 2015-11-07 11:15 ` Dan Carpenter 0 siblings, 1 reply; 10+ messages in thread From: Simmons, James A. @ 2015-11-06 22:04 UTC (permalink / raw) To: 'Shivani Bhardwaj', gregkh Cc: oleg.drokin, devel, andreas.dilger, linux-kernel >From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On Behalf Of Shivani Bhardwaj >Sent: Friday, November 06, 2015 12:18 PM >To: gregkh@linuxfoundation.org >Cc: oleg.drokin@intel.com; devel@driverdev.osuosl.org; andreas.dilger@intel.com; linux-kernel@vger.kernel.org >Subject: [PATCH 1/3] Staging: lustre: module: Replace function calls > >Replace the calls of function cfs_trace_free_string_buffer() with >kfree() as the former function is not required. > >Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> >--- > drivers/staging/lustre/lustre/libcfs/module.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Acked-by: James Simmons <jsimmons@infradead.org> diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c index 50e8fd2..516a9e7 100644 --- a/drivers/staging/lustre/lustre/libcfs/module.c +++ b/drivers/staging/lustre/lustre/libcfs/module.c @@ -392,7 +392,7 @@ static int __proc_dobitmasks(void *data, int write, } else { rc = cfs_trace_copyin_string(tmpstr, tmpstrlen, buffer, nob); if (rc < 0) { - cfs_trace_free_string_buffer(tmpstr, tmpstrlen); + kfree(tmpstr); return rc; } @@ -402,7 +402,7 @@ static int __proc_dobitmasks(void *data, int write, *mask |= D_EMERG; } - cfs_trace_free_string_buffer(tmpstr, tmpstrlen); + kfree(tmpstr); return rc; } -- 2.1.0 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] Staging: lustre: module: Replace function calls 2015-11-06 22:04 ` Simmons, James A. @ 2015-11-07 11:15 ` Dan Carpenter 2015-11-07 19:27 ` Dilger, Andreas 0 siblings, 1 reply; 10+ messages in thread From: Dan Carpenter @ 2015-11-07 11:15 UTC (permalink / raw) To: Simmons, James A. Cc: 'Shivani Bhardwaj', gregkh, oleg.drokin, devel, andreas.dilger, linux-kernel On Fri, Nov 06, 2015 at 10:04:41PM +0000, Simmons, James A. wrote: > >From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On Behalf Of Shivani Bhardwaj > >Sent: Friday, November 06, 2015 12:18 PM > >To: gregkh@linuxfoundation.org > >Cc: oleg.drokin@intel.com; devel@driverdev.osuosl.org; andreas.dilger@intel.com; linux-kernel@vger.kernel.org > >Subject: [PATCH 1/3] Staging: lustre: module: Replace function calls > > > >Replace the calls of function cfs_trace_free_string_buffer() with > >kfree() as the former function is not required. > > > >Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> > >--- > > drivers/staging/lustre/lustre/libcfs/module.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > Acked-by: James Simmons <jsimmons@infradead.org> > > diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c > index 50e8fd2..516a9e7 100644 > --- a/drivers/staging/lustre/lustre/libcfs/module.c > +++ b/drivers/staging/lustre/lustre/libcfs/module.c > @@ -392,7 +392,7 @@ static int __proc_dobitmasks(void *data, int write, > } else { Why do your acks include the original diff without the "> " prefix? How are you even managing that trick? regards, dan carpenter ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] Staging: lustre: module: Replace function calls 2015-11-07 11:15 ` Dan Carpenter @ 2015-11-07 19:27 ` Dilger, Andreas 0 siblings, 0 replies; 10+ messages in thread From: Dilger, Andreas @ 2015-11-07 19:27 UTC (permalink / raw) To: Dan Carpenter Cc: Simmons, James A., Shivani Bhardwaj, gregkh, Drokin, Oleg, devel, linux-kernel On Nov 7, 2015, at 04:15, Dan Carpenter <dan.carpenter@oracle.com> wrote: > > On Fri, Nov 06, 2015 at 10:04:41PM +0000, Simmons, James A. wrote: >>> From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On Behalf Of Shivani Bhardwaj >>> Sent: Friday, November 06, 2015 12:18 PM >>> To: gregkh@linuxfoundation.org >>> Cc: oleg.drokin@intel.com; devel@driverdev.osuosl.org; andreas.dilger@intel.com; linux-kernel@vger.kernel.org >>> Subject: [PATCH 1/3] Staging: lustre: module: Replace function calls >>> >>> Replace the calls of function cfs_trace_free_string_buffer() with >>> kfree() as the former function is not required. >>> >>> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> >>> --- >>> drivers/staging/lustre/lustre/libcfs/module.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> Acked-by: James Simmons <jsimmons@infradead.org> >> >> diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c >> index 50e8fd2..516a9e7 100644 >> --- a/drivers/staging/lustre/lustre/libcfs/module.c >> +++ b/drivers/staging/lustre/lustre/libcfs/module.c >> @@ -392,7 +392,7 @@ static int __proc_dobitmasks(void *data, int write, >> } else { > > Why do your acks include the original diff without the "> " prefix? How > are you even managing that trick? I was wondering the same, though it does look nicer. Cheers, Andreas ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] Staging: lustre: tracefile: Remove wrapper function 2015-11-06 17:17 [PATCH 0/3] Remove wrapper function and clean up the code Shivani Bhardwaj 2015-11-06 17:18 ` [PATCH 1/3] Staging: lustre: module: Replace function calls Shivani Bhardwaj @ 2015-11-06 17:19 ` Shivani Bhardwaj 2015-11-06 22:03 ` Simmons, James A. 2015-11-06 17:19 ` [PATCH 3/3] Staging: lustre: tracefile: Remove function prototype Shivani Bhardwaj 2 siblings, 1 reply; 10+ messages in thread From: Shivani Bhardwaj @ 2015-11-06 17:19 UTC (permalink / raw) To: gregkh; +Cc: oleg.drokin, andreas.dilger, devel, linux-kernel Remove the function cfs_trace_free_string_buffer() as it can be replaced with the standard function kfree(). Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> --- drivers/staging/lustre/lustre/libcfs/tracefile.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c index d55dda8..211047f 100644 --- a/drivers/staging/lustre/lustre/libcfs/tracefile.c +++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c @@ -817,11 +817,6 @@ int cfs_trace_allocate_string_buffer(char **str, int nob) return 0; } -void cfs_trace_free_string_buffer(char *str, int nob) -{ - kfree(str); -} - int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int usr_str_nob) { char *str; @@ -842,7 +837,7 @@ int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int usr_str_nob) } rc = cfs_tracefile_dump_all_pages(str); out: - cfs_trace_free_string_buffer(str, usr_str_nob + 1); + kfree(str); return rc; } @@ -898,7 +893,7 @@ int cfs_trace_daemon_command_usrstr(void __user *usr_str, int usr_str_nob) if (rc == 0) rc = cfs_trace_daemon_command(str); - cfs_trace_free_string_buffer(str, usr_str_nob + 1); + kfree(str); return rc; } -- 2.1.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* RE: [PATCH 2/3] Staging: lustre: tracefile: Remove wrapper function 2015-11-06 17:19 ` [PATCH 2/3] Staging: lustre: tracefile: Remove wrapper function Shivani Bhardwaj @ 2015-11-06 22:03 ` Simmons, James A. 0 siblings, 0 replies; 10+ messages in thread From: Simmons, James A. @ 2015-11-06 22:03 UTC (permalink / raw) To: 'Shivani Bhardwaj', gregkh Cc: oleg.drokin, devel, andreas.dilger, linux-kernel >-----Original Message----- >From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On Behalf Of Shivani Bhardwaj >Sent: Friday, November 06, 2015 12:19 PM >To: gregkh@linuxfoundation.org >Cc: oleg.drokin@intel.com; devel@driverdev.osuosl.org; andreas.dilger@intel.com; linux-kernel@vger.kernel.org >Subject: [PATCH 2/3] Staging: lustre: tracefile: Remove wrapper function > >Remove the function cfs_trace_free_string_buffer() as it can be replaced >with the standard function kfree(). > >Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> >--- > drivers/staging/lustre/lustre/libcfs/tracefile.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) Acked-by: James Simmons <jsimmons@infradead.org> diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c index d55dda8..211047f 100644 --- a/drivers/staging/lustre/lustre/libcfs/tracefile.c +++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c @@ -817,11 +817,6 @@ int cfs_trace_allocate_string_buffer(char **str, int nob) return 0; } -void cfs_trace_free_string_buffer(char *str, int nob) -{ - kfree(str); -} - int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int usr_str_nob) { char *str; @@ -842,7 +837,7 @@ int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int usr_str_nob) } rc = cfs_tracefile_dump_all_pages(str); out: - cfs_trace_free_string_buffer(str, usr_str_nob + 1); + kfree(str); return rc; } @@ -898,7 +893,7 @@ int cfs_trace_daemon_command_usrstr(void __user *usr_str, int usr_str_nob) if (rc == 0) rc = cfs_trace_daemon_command(str); - cfs_trace_free_string_buffer(str, usr_str_nob + 1); + kfree(str); return rc; } -- 2.1.0 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/3] Staging: lustre: tracefile: Remove function prototype 2015-11-06 17:17 [PATCH 0/3] Remove wrapper function and clean up the code Shivani Bhardwaj 2015-11-06 17:18 ` [PATCH 1/3] Staging: lustre: module: Replace function calls Shivani Bhardwaj 2015-11-06 17:19 ` [PATCH 2/3] Staging: lustre: tracefile: Remove wrapper function Shivani Bhardwaj @ 2015-11-06 17:19 ` Shivani Bhardwaj 2015-11-07 7:32 ` Dilger, Andreas 2 siblings, 1 reply; 10+ messages in thread From: Shivani Bhardwaj @ 2015-11-06 17:19 UTC (permalink / raw) To: gregkh; +Cc: oleg.drokin, andreas.dilger, devel, linux-kernel Remove the prototype of function cfs_trace_free_string_buffer() as it is no longer needed. Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> --- drivers/staging/lustre/lustre/libcfs/tracefile.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h b/drivers/staging/lustre/lustre/libcfs/tracefile.h index 73d60e0..ba62005 100644 --- a/drivers/staging/lustre/lustre/libcfs/tracefile.h +++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h @@ -70,7 +70,6 @@ int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob, int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob, const char *knl_str, char *append); int cfs_trace_allocate_string_buffer(char **str, int nob); -void cfs_trace_free_string_buffer(char *str, int nob); int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int usr_str_nob); int cfs_trace_daemon_command(char *str); int cfs_trace_daemon_command_usrstr(void __user *usr_str, int usr_str_nob); -- 2.1.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] Staging: lustre: tracefile: Remove function prototype 2015-11-06 17:19 ` [PATCH 3/3] Staging: lustre: tracefile: Remove function prototype Shivani Bhardwaj @ 2015-11-07 7:32 ` Dilger, Andreas 2015-11-07 7:50 ` Shivani Bhardwaj 0 siblings, 1 reply; 10+ messages in thread From: Dilger, Andreas @ 2015-11-07 7:32 UTC (permalink / raw) To: Shivani Bhardwaj, gregkh; +Cc: Drokin, Oleg, devel, linux-kernel On 2015/11/06, 10:19, "Shivani Bhardwaj" <shivanib134@gmail.com> wrote: >Remove the prototype of function cfs_trace_free_string_buffer() as it is >no longer needed. These patches would be a lot more useful if the summary contained the name of the function being removed, rather than "remove function prototype" and variations of that. Something like: staging: lustre: remove cfs_trace_free_string_buffer prototype staging: lustre: remove ldlm_pool_set_limit wrapper staging: lustre: remove ldlm_pool_get_limit wrapper Not sure if that is grounds for rejection of this patch series (I'll leave that up to Dan and Greg), but definitely something for future patches. Cheers, Andreas >Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> >--- > drivers/staging/lustre/lustre/libcfs/tracefile.h | 1 - > 1 file changed, 1 deletion(-) > >diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h >b/drivers/staging/lustre/lustre/libcfs/tracefile.h >index 73d60e0..ba62005 100644 >--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h >+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h >@@ -70,7 +70,6 @@ int cfs_trace_copyin_string(char *knl_buffer, int >knl_buffer_nob, > int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob, > const char *knl_str, char *append); > int cfs_trace_allocate_string_buffer(char **str, int nob); >-void cfs_trace_free_string_buffer(char *str, int nob); > int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int >usr_str_nob); > int cfs_trace_daemon_command(char *str); > int cfs_trace_daemon_command_usrstr(void __user *usr_str, int >usr_str_nob); >-- >2.1.0 > > Cheers, Andreas -- Andreas Dilger Lustre Software Architect Intel High Performance Data Division ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] Staging: lustre: tracefile: Remove function prototype 2015-11-07 7:32 ` Dilger, Andreas @ 2015-11-07 7:50 ` Shivani Bhardwaj 0 siblings, 0 replies; 10+ messages in thread From: Shivani Bhardwaj @ 2015-11-07 7:50 UTC (permalink / raw) To: Dilger, Andreas; +Cc: gregkh, Drokin, Oleg, devel, linux-kernel On Sat, Nov 7, 2015 at 1:02 PM, Dilger, Andreas <andreas.dilger@intel.com> wrote: > On 2015/11/06, 10:19, "Shivani Bhardwaj" <shivanib134@gmail.com> wrote: > >>Remove the prototype of function cfs_trace_free_string_buffer() as it is >>no longer needed. > > These patches would be a lot more useful if the summary contained the name > of the function being removed, rather than "remove function prototype" and > variations of that. Something like: > > staging: lustre: remove cfs_trace_free_string_buffer prototype > staging: lustre: remove ldlm_pool_set_limit wrapper > staging: lustre: remove ldlm_pool_get_limit wrapper > > Not sure if that is grounds for rejection of this patch series (I'll leave > that up to Dan and Greg), but definitely something for future patches. > > Cheers, Andreas > I'll definitely take care of this for future patches that I submit. Thank you Shivani >>Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> >>--- >> drivers/staging/lustre/lustre/libcfs/tracefile.h | 1 - >> 1 file changed, 1 deletion(-) >> >>diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h >>b/drivers/staging/lustre/lustre/libcfs/tracefile.h >>index 73d60e0..ba62005 100644 >>--- a/drivers/staging/lustre/lustre/libcfs/tracefile.h >>+++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h >>@@ -70,7 +70,6 @@ int cfs_trace_copyin_string(char *knl_buffer, int >>knl_buffer_nob, >> int cfs_trace_copyout_string(char __user *usr_buffer, int usr_buffer_nob, >> const char *knl_str, char *append); >> int cfs_trace_allocate_string_buffer(char **str, int nob); >>-void cfs_trace_free_string_buffer(char *str, int nob); >> int cfs_trace_dump_debug_buffer_usrstr(void __user *usr_str, int >>usr_str_nob); >> int cfs_trace_daemon_command(char *str); >> int cfs_trace_daemon_command_usrstr(void __user *usr_str, int >>usr_str_nob); >>-- >>2.1.0 >> >> > > > Cheers, Andreas > -- > Andreas Dilger > > Lustre Software Architect > Intel High Performance Data Division > > ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-11-07 19:27 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-11-06 17:17 [PATCH 0/3] Remove wrapper function and clean up the code Shivani Bhardwaj 2015-11-06 17:18 ` [PATCH 1/3] Staging: lustre: module: Replace function calls Shivani Bhardwaj 2015-11-06 22:04 ` Simmons, James A. 2015-11-07 11:15 ` Dan Carpenter 2015-11-07 19:27 ` Dilger, Andreas 2015-11-06 17:19 ` [PATCH 2/3] Staging: lustre: tracefile: Remove wrapper function Shivani Bhardwaj 2015-11-06 22:03 ` Simmons, James A. 2015-11-06 17:19 ` [PATCH 3/3] Staging: lustre: tracefile: Remove function prototype Shivani Bhardwaj 2015-11-07 7:32 ` Dilger, Andreas 2015-11-07 7:50 ` Shivani Bhardwaj
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).