* [PATCH 0/3] Remove wrapper function and clean up the code
@ 2015-11-02 18:48 Shivani Bhardwaj
2015-11-02 18:48 ` [PATCH 1/3] Staging: lustre: tracefile: Remove wrapper function Shivani Bhardwaj
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Shivani Bhardwaj @ 2015-11-02 18:48 UTC (permalink / raw)
To: outreachy-kernel; +Cc: outreachy-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: tracefile: Remove wrapper function
Staging: lustre: tracefile: Remove function prototype
Staging: lustre: module: Replace function calls
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] 7+ messages in thread
* [PATCH 1/3] Staging: lustre: tracefile: Remove wrapper function
2015-11-02 18:48 [PATCH 0/3] Remove wrapper function and clean up the code Shivani Bhardwaj
@ 2015-11-02 18:48 ` Shivani Bhardwaj
2015-11-02 18:49 ` [PATCH 2/3] Staging: lustre: tracefile: Remove function prototype Shivani Bhardwaj
2015-11-02 18:49 ` [PATCH 3/3] Staging: lustre: module: Replace function calls Shivani Bhardwaj
2 siblings, 0 replies; 7+ messages in thread
From: Shivani Bhardwaj @ 2015-11-02 18:48 UTC (permalink / raw)
To: outreachy-kernel; +Cc: outreachy-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 973c7c2..54835fc 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] 7+ messages in thread
* [PATCH 2/3] Staging: lustre: tracefile: Remove function prototype
2015-11-02 18:48 [PATCH 0/3] Remove wrapper function and clean up the code Shivani Bhardwaj
2015-11-02 18:48 ` [PATCH 1/3] Staging: lustre: tracefile: Remove wrapper function Shivani Bhardwaj
@ 2015-11-02 18:49 ` Shivani Bhardwaj
2015-11-02 18:49 ` [PATCH 3/3] Staging: lustre: module: Replace function calls Shivani Bhardwaj
2 siblings, 0 replies; 7+ messages in thread
From: Shivani Bhardwaj @ 2015-11-02 18:49 UTC (permalink / raw)
To: outreachy-kernel; +Cc: outreachy-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 cb7a396..4d5fdaf 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] 7+ messages in thread
* [PATCH 3/3] Staging: lustre: module: Replace function calls
2015-11-02 18:48 [PATCH 0/3] Remove wrapper function and clean up the code Shivani Bhardwaj
2015-11-02 18:48 ` [PATCH 1/3] Staging: lustre: tracefile: Remove wrapper function Shivani Bhardwaj
2015-11-02 18:49 ` [PATCH 2/3] Staging: lustre: tracefile: Remove function prototype Shivani Bhardwaj
@ 2015-11-02 18:49 ` Shivani Bhardwaj
2015-11-04 19:02 ` [Outreachy kernel] " Greg KH
2 siblings, 1 reply; 7+ messages in thread
From: Shivani Bhardwaj @ 2015-11-02 18:49 UTC (permalink / raw)
To: outreachy-kernel; +Cc: outreachy-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] 7+ messages in thread
* Re: [Outreachy kernel] [PATCH 3/3] Staging: lustre: module: Replace function calls
2015-11-02 18:49 ` [PATCH 3/3] Staging: lustre: module: Replace function calls Shivani Bhardwaj
@ 2015-11-04 19:02 ` Greg KH
2015-11-04 19:15 ` Shivani Bhardwaj
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2015-11-04 19:02 UTC (permalink / raw)
To: Shivani Bhardwaj; +Cc: outreachy-kernel
On Tue, Nov 03, 2015 at 12:19:36AM +0530, Shivani Bhardwaj wrote:
> 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;
> }
>
Don't you need this to be earlier in the series? You just deleted the
function from the kernel in the first patch :(
Never break the build for any patch in a series. Please reorder and
resend.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] [PATCH 3/3] Staging: lustre: module: Replace function calls
2015-11-04 19:02 ` [Outreachy kernel] " Greg KH
@ 2015-11-04 19:15 ` Shivani Bhardwaj
0 siblings, 0 replies; 7+ messages in thread
From: Shivani Bhardwaj @ 2015-11-04 19:15 UTC (permalink / raw)
To: Greg KH; +Cc: outreachy-kernel
On Thu, Nov 5, 2015 at 12:32 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Tue, Nov 03, 2015 at 12:19:36AM +0530, Shivani Bhardwaj wrote:
>> 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;
>> }
>>
>
> Don't you need this to be earlier in the series? You just deleted the
> function from the kernel in the first patch :(
>
> Never break the build for any patch in a series. Please reorder and
> resend.
>
I'm sorry for the mistake. I'm resending.
Thank you
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 0/3] Remove wrapper function and clean up the code
@ 2015-11-06 17:17 Shivani Bhardwaj
0 siblings, 0 replies; 7+ 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] 7+ messages in thread
end of thread, other threads:[~2015-11-06 17:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 18:48 [PATCH 0/3] Remove wrapper function and clean up the code Shivani Bhardwaj
2015-11-02 18:48 ` [PATCH 1/3] Staging: lustre: tracefile: Remove wrapper function Shivani Bhardwaj
2015-11-02 18:49 ` [PATCH 2/3] Staging: lustre: tracefile: Remove function prototype Shivani Bhardwaj
2015-11-02 18:49 ` [PATCH 3/3] Staging: lustre: module: Replace function calls Shivani Bhardwaj
2015-11-04 19:02 ` [Outreachy kernel] " Greg KH
2015-11-04 19:15 ` Shivani Bhardwaj
2015-11-06 17:17 [PATCH 0/3] Remove wrapper function and clean up the code Shivani Bhardwaj
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.