Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2015-02-08 Thread SF Markus Elfring
> Do symbols which are not exported (no EXPORT_SYMBOL_(GPL)) cause conflicts? How do you think about to mark more functions from your software module as static? > I was under the impression that those are module private. > If they are indeed private then I would prefer to not rename them.

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2015-02-08 Thread SF Markus Elfring
Do symbols which are not exported (no EXPORT_SYMBOL_(GPL)) cause conflicts? How do you think about to mark more functions from your software module as static? I was under the impression that those are module private. If they are indeed private then I would prefer to not rename them. Would

Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-23 Thread Joe Perches
On Sun, 2014-11-23 at 20:03 +0100, SF Markus Elfring wrote: > > Why not just make the static source code analysis aware of the problem? > > This is also possible, of course. > > > > You can treat static functions differently that non-static ones. > > I have added this detail to my ideas around

Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-23 Thread SF Markus Elfring
> Why not just make the static source code analysis aware of the problem? This is also possible, of course. > You can treat static functions differently that non-static ones. I have added this detail to my ideas around the next fine-tuning for the published semantic patch approach. > There

Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-23 Thread Joe Perches
On Sun, 2014-11-23 at 16:45 +0100, Andreas Noever wrote: > On Sun, Nov 23, 2014 at 4:20 PM, Joe Perches wrote: > > On Sun, 2014-11-23 at 15:14 +0100, SF Markus Elfring wrote: > >> >> 2. Are any additional prefixes appropriate so that further name space > >> >>conflicts can be better avoided?

Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-23 Thread Julia Lawall
On Sun, 23 Nov 2014, SF Markus Elfring wrote: > >> https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/drivers/char/tpm/xen-tpmfront.c?id=fc14f9c1272f62c3e8d01300f52467c0d9af50f9#n268 > > > > I think static functions can be named whatever > > the developer chooses. > > I

Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-23 Thread Andreas Noever
On Sun, Nov 23, 2014 at 4:20 PM, Joe Perches wrote: > On Sun, 2014-11-23 at 15:14 +0100, SF Markus Elfring wrote: >> >> 2. Are any additional prefixes appropriate so that further name space >> >>conflicts can be better avoided? >> > >> > To avoid possible external naming conflicts, add tb_

Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-23 Thread SF Markus Elfring
>> https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/drivers/char/tpm/xen-tpmfront.c?id=fc14f9c1272f62c3e8d01300f52467c0d9af50f9#n268 > > I think static functions can be named whatever > the developer chooses. I agree also that this implementation detail is correct in

Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-23 Thread Joe Perches
On Sun, 2014-11-23 at 15:14 +0100, SF Markus Elfring wrote: > >> 2. Are any additional prefixes appropriate so that further name space > >>conflicts can be better avoided? > > > > To avoid possible external naming conflicts, add tb_ prefix to > > various ring_ structs and functions. > > Do

Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-23 Thread SF Markus Elfring
>> 2. Are any additional prefixes appropriate so that further name space >>conflicts can be better avoided? > > To avoid possible external naming conflicts, add tb_ prefix to > various ring_ structs and functions. Do you imagine that any XEN software developers need also to reconsider this

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-23 Thread SF Markus Elfring
2. Are any additional prefixes appropriate so that further name space conflicts can be better avoided? To avoid possible external naming conflicts, add tb_ prefix to various ring_foo structs and functions. Do you imagine that any XEN software developers need also to reconsider this

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-23 Thread Joe Perches
On Sun, 2014-11-23 at 15:14 +0100, SF Markus Elfring wrote: 2. Are any additional prefixes appropriate so that further name space conflicts can be better avoided? To avoid possible external naming conflicts, add tb_ prefix to various ring_foo structs and functions. Do you imagine

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-23 Thread SF Markus Elfring
https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/drivers/char/tpm/xen-tpmfront.c?id=fc14f9c1272f62c3e8d01300f52467c0d9af50f9#n268 I think static functions can be named whatever the developer chooses. I agree also that this implementation detail is correct in

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-23 Thread Andreas Noever
On Sun, Nov 23, 2014 at 4:20 PM, Joe Perches j...@perches.com wrote: On Sun, 2014-11-23 at 15:14 +0100, SF Markus Elfring wrote: 2. Are any additional prefixes appropriate so that further name space conflicts can be better avoided? To avoid possible external naming conflicts, add tb_

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-23 Thread Julia Lawall
On Sun, 23 Nov 2014, SF Markus Elfring wrote: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/drivers/char/tpm/xen-tpmfront.c?id=fc14f9c1272f62c3e8d01300f52467c0d9af50f9#n268 I think static functions can be named whatever the developer chooses. I agree also

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-23 Thread Joe Perches
On Sun, 2014-11-23 at 16:45 +0100, Andreas Noever wrote: On Sun, Nov 23, 2014 at 4:20 PM, Joe Perches j...@perches.com wrote: On Sun, 2014-11-23 at 15:14 +0100, SF Markus Elfring wrote: 2. Are any additional prefixes appropriate so that further name space conflicts can be better

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-23 Thread SF Markus Elfring
Why not just make the static source code analysis aware of the problem? This is also possible, of course. You can treat static functions differently that non-static ones. I have added this detail to my ideas around the next fine-tuning for the published semantic patch approach. There is

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-23 Thread Joe Perches
On Sun, 2014-11-23 at 20:03 +0100, SF Markus Elfring wrote: Why not just make the static source code analysis aware of the problem? This is also possible, of course. You can treat static functions differently that non-static ones. I have added this detail to my ideas around the next

Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-21 Thread Joe Perches
On Fri, 2014-11-21 at 13:21 +0100, SF Markus Elfring wrote: > 2. Are any additional prefixes appropriate so that further name space >conflicts can be better avoided? To avoid possible external naming conflicts, add tb_ prefix to various ring_ structs and functions. Other miscellanea: o

Re: thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-21 Thread SF Markus Elfring
> ring_free does not check for null: > http://lxr.free-electrons.com/source/drivers/thunderbolt/nhi.c#L398 > > Maybe your software confuses the method with: > http://lxr.free-electrons.com/source/drivers/char/tpm/xen-tpmfront.c#L268 Thanks for your feedback. I am sorry for a bit of confusion

Re: [PATCH 1/1] thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-21 Thread Andreas Noever
Hi Markus, ring_free does not check for null: http://lxr.free-electrons.com/source/drivers/thunderbolt/nhi.c#L398 Maybe your software confuses the method with: http://lxr.free-electrons.com/source/drivers/char/tpm/xen-tpmfront.c#L268 Andreas On Fri, Nov 21, 2014 at 11:40 AM, SF Markus Elfring

[PATCH 1/1] thunderbolt: Deletion of unnecessary checks before the function call "ring_free"

2014-11-21 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 21 Nov 2014 11:30:18 +0100 The ring_free() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring ---

[PATCH 1/1] thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-21 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net Date: Fri, 21 Nov 2014 11:30:18 +0100 The ring_free() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

Re: [PATCH 1/1] thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-21 Thread Andreas Noever
Hi Markus, ring_free does not check for null: http://lxr.free-electrons.com/source/drivers/thunderbolt/nhi.c#L398 Maybe your software confuses the method with: http://lxr.free-electrons.com/source/drivers/char/tpm/xen-tpmfront.c#L268 Andreas On Fri, Nov 21, 2014 at 11:40 AM, SF Markus Elfring

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-21 Thread SF Markus Elfring
ring_free does not check for null: http://lxr.free-electrons.com/source/drivers/thunderbolt/nhi.c#L398 Maybe your software confuses the method with: http://lxr.free-electrons.com/source/drivers/char/tpm/xen-tpmfront.c#L268 Thanks for your feedback. I am sorry for a bit of confusion here.

Re: thunderbolt: Deletion of unnecessary checks before the function call ring_free

2014-11-21 Thread Joe Perches
On Fri, 2014-11-21 at 13:21 +0100, SF Markus Elfring wrote: 2. Are any additional prefixes appropriate so that further name space conflicts can be better avoided? To avoid possible external naming conflicts, add tb_ prefix to various ring_foo structs and functions. Other miscellanea: o