Re: [PATCH] staging: lustre: lustre: libcfs: debug.c: Cleaning up unnecessary use of memset in conjunction with strncpy

2014-10-14 Thread Rickard Strandqvist
2014-09-19 0:39 GMT+02:00 Dan Carpenter : > On Thu, Sep 18, 2014 at 09:57:17PM +0200, Rickard Strandqvist wrote: >> >> Should I add this as a patch in lib/string.c or email him first.. What >> is customary in these situations? >> > > Just write up a normal patch and try to merge it through the norm

Re: [PATCH] staging: lustre: lustre: libcfs: debug.c: Cleaning up unnecessary use of memset in conjunction with strncpy

2014-09-18 Thread Dan Carpenter
On Thu, Sep 18, 2014 at 09:57:17PM +0200, Rickard Strandqvist wrote: > > Should I add this as a patch in lib/string.c or email him first.. What > is customary in these situations? > Just write up a normal patch and try to merge it through the normal methods. It's not that controversial to do:

Re: [PATCH] staging: lustre: lustre: libcfs: debug.c: Cleaning up unnecessary use of memset in conjunction with strncpy

2014-09-18 Thread Rickard Strandqvist
2014-09-18 10:51 GMT+02:00 Dan Carpenter : > On Thu, Sep 18, 2014 at 12:12:42AM +0200, Rickard Strandqvist wrote: >> Hi Dan >> >> Ok, I have made two suggestions for strncpy function that also >> guarantees a terminating null character. >> 1) retunerar number of characters to be copied, it can be g

Re: [PATCH] staging: lustre: lustre: libcfs: debug.c: Cleaning up unnecessary use of memset in conjunction with strncpy

2014-09-18 Thread Dan Carpenter
On Thu, Sep 18, 2014 at 12:12:42AM +0200, Rickard Strandqvist wrote: > Hi Dan > > Ok, I have made two suggestions for strncpy function that also > guarantees a terminating null character. > 1) retunerar number of characters to be copied, it can be good to > have, but was not really satisfied. str

Re: [PATCH] staging: lustre: lustre: libcfs: debug.c: Cleaning up unnecessary use of memset in conjunction with strncpy

2014-09-17 Thread Rickard Strandqvist
2014-09-15 10:23 GMT+02:00 Dan Carpenter : > On Sun, Sep 14, 2014 at 06:03:16PM +0200, Rickard Strandqvist wrote: >> Using memset before strncpy just to ensure a trailing null >> character is an unnecessary double writing of a string >> > > You really should make a function which pads and NUL termi

Re: [PATCH] staging: lustre: lustre: libcfs: debug.c: Cleaning up unnecessary use of memset in conjunction with strncpy

2014-09-15 Thread Dan Carpenter
On Sun, Sep 14, 2014 at 06:03:16PM +0200, Rickard Strandqvist wrote: > Using memset before strncpy just to ensure a trailing null > character is an unnecessary double writing of a string > You really should make a function which pads and NUL terminates. I've said this before, of course, but you

[PATCH] staging: lustre: lustre: libcfs: debug.c: Cleaning up unnecessary use of memset in conjunction with strncpy

2014-09-14 Thread Rickard Strandqvist
Using memset before strncpy just to ensure a trailing null character is an unnecessary double writing of a string Signed-off-by: Rickard Strandqvist --- drivers/staging/lustre/lustre/libcfs/debug.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lust