[1/7] batman-adv: remove useless inline attribute for sysfs helper function

Message ID 1462474003-25279-1-git-send-email-a@unstable.cc (mailing list archive)
State Accepted, archived
Delegated to: Marek Lindner
Headers

Commit Message

Antonio Quartulli May 5, 2016, 6:46 p.m. UTC
  the compiler can optimize functions within the same C file and therefore
there is no need to make it explicit.

Remove the useless inline attribute for __batadv_store_uint_attr()

Signed-off-by: Antonio Quartulli <a@unstable.cc>
---
 net/batman-adv/sysfs.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Comments

Sven Eckelmann May 5, 2016, 8:17 p.m. UTC | #1
On Friday 06 May 2016 02:46:37 Antonio Quartulli wrote:
> the compiler can optimize functions within the same C file and therefore
> there is no need to make it explicit.
> 
> Remove the useless inline attribute for __batadv_store_uint_attr()
> 
> Signed-off-by: Antonio Quartulli <a@unstable.cc>
> ---
>  net/batman-adv/sysfs.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

This is not about this particular patch but for the patch series.

Please check the attached test results of the daily build tests.

Kind regards,
	Sve
  
Marek Lindner May 6, 2016, 1:03 a.m. UTC | #2
On Friday, May 06, 2016 02:46:37 Antonio Quartulli wrote:
> the compiler can optimize functions within the same C file and therefore
> there is no need to make it explicit.
> 
> Remove the useless inline attribute for __batadv_store_uint_attr()
> 
> Signed-off-by: Antonio Quartulli <a@unstable.cc>
> ---
>  net/batman-adv/sysfs.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Applied in revision 67bf881.

Thanks,
Marek
  
Antonio Quartulli May 6, 2016, 2:34 a.m. UTC | #3
On Thu, May 05, 2016 at 10:17:18PM +0200, Sven Eckelmann wrote:
> On Friday 06 May 2016 02:46:37 Antonio Quartulli wrote:
> > the compiler can optimize functions within the same C file and therefore
> > there is no need to make it explicit.
> > 
> > Remove the useless inline attribute for __batadv_store_uint_attr()
> > 
> > Signed-off-by: Antonio Quartulli <a@unstable.cc>
> > ---
> >  net/batman-adv/sysfs.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> This is not about this particular patch but for the patch series.
> 
> Please check the attached test results of the daily build tests.

Sven,


do you know how I can deal with:

./net/batman-adv/types.h:1338: warning: No description found for parameter 'gw'

?

There are also other objects similar to that in the bat_algo_ops (i.e. iface,
neigh, ..), but the check complains about gw only ?

> 
> Kind regards,
> 	Sve
  
Sven Eckelmann May 6, 2016, 7:23 a.m. UTC | #4
On Friday 06 May 2016 10:34:34 Antonio Quartulli wrote:
> On Thu, May 05, 2016 at 10:17:18PM +0200, Sven Eckelmann wrote:
> > On Friday 06 May 2016 02:46:37 Antonio Quartulli wrote:
> > > the compiler can optimize functions within the same C file and therefore
> > > there is no need to make it explicit.
> > > 
> > > Remove the useless inline attribute for __batadv_store_uint_attr()
> > > 
> > > Signed-off-by: Antonio Quartulli <a@unstable.cc>
> > > ---
> > > 
> > >  net/batman-adv/sysfs.c | 12 ++++++------
> > >  1 file changed, 6 insertions(+), 6 deletions(-)
> > 
> > This is not about this particular patch but for the patch series.
> > 
> > Please check the attached test results of the daily build tests.
> 
> Sven,
> 
> 
> do you know how I can deal with:
> 
> ./net/batman-adv/types.h:1338: warning: No description found for parameter
> 'gw'
> 
> ?
> 
> There are also other objects similar to that in the bat_algo_ops (i.e.
> iface, neigh, ..), but the check complains about gw only ?

Kerneldoc cannot parse these kind of substructures. Just run:

   scripts/kernel-doc -html net/batman-adv/types.h > test.html
   chromium test.html

It just creates random noise from your kerneldoc input. So one way to deal 
with it is to create a substruct hacks parse functionality for kerneldoc or 
avoid these kind of anonymous-type substructs and use extra correctly typed 
structs.

You can contact Jonathan Corbet and inform him that these kinds of things are 
not "correctly" parsed (and don't use dirty hacks to creat kerneldoc-sections 
like struct sockaddr_caif used for its union kerneldoc). Maybe with a small 
example.

Kind regards,
	Sven
  
Sven Eckelmann May 6, 2016, 7:53 a.m. UTC | #5
On Friday 06 May 2016 09:23:40 Sven Eckelmann wrote:
[...]
> Kerneldoc cannot parse these kind of substructures. Just run:
> 
>    scripts/kernel-doc -html net/batman-adv/types.h > test.html
>    chromium test.html
> 
> It just creates random noise from your kerneldoc input. So one way to deal
> with it is to create a substruct hacks parse functionality for kerneldoc or
> avoid these kind of anonymous-type substructs and use extra correctly typed
> structs.
> 
> You can contact Jonathan Corbet and inform him that these kinds of things
> are not "correctly" parsed (and don't use dirty hacks to creat
> kerneldoc-sections like struct sockaddr_caif used for its union kerneldoc).
> Maybe with a small example.

From https://www.kernel.org/doc/Documentation/kernel-doc-nano-HOWTO.txt

> Nesting of declarations is not supported.

So you either have to add it to kernel-doc or do it differently.

Kind regards,
	Sven
  
Antonio Quartulli May 8, 2016, 4:33 p.m. UTC | #6
On Fri, May 06, 2016 at 09:53:26AM +0200, Sven Eckelmann wrote:
> So you either have to add it to kernel-doc or do it differently.

Thanks for checking this. I will split the structure in real substructures with
their own definition and document the fields there.

About the result from IWUY: any easy way to run it locally ? I tried to run it
by specifying the IWYU path via CC=, but I get way more noisy result that what
you reported in your previous email. I'd like to learn this so that I can easily
understand which patch requires which include.


On top of that, the results you posted says that I should include
<linux/stddef.h> in bat_v.c, but it already included in that file. no?


Cheers,
  
Sven Eckelmann May 8, 2016, 4:59 p.m. UTC | #7
On Monday 09 May 2016 00:33:24 Antonio Quartulli wrote:
> On Fri, May 06, 2016 at 09:53:26AM +0200, Sven Eckelmann wrote:
> > So you either have to add it to kernel-doc or do it differently.
> 
> Thanks for checking this. I will split the structure in real substructures
> with their own definition and document the fields there.
> 
> About the result from IWUY: any easy way to run it locally ? I tried to run
> it by specifying the IWYU path via CC=, but I get way more noisy result
> that what you reported in your previous email. I'd like to learn this so
> that I can easily understand which patch requires which include.

The actual script can be found in build_test.git [1]. But you can also
download the repo, prepare the headers with generate_linux_headers.sh

    LINUX_REPOSITORY=/home/sven/tmp/linux-next ./generate_linux_headers.sh

and then mount it

    mkdir linux-build
    sudo    mount -o loop linux-build.img linux-build

Now you can for example run the build tests and receive the mail:

    REMOTE=/home/sven/tmp/qemu-batman/batman-adv TO=sven ./checkstuff.sh

Or you can extract the relevant part of the script (see attachment - file
paths have to be adjusted; build_test.git with prepared headers is still 
required) and run it manually. Please make sure that you've committed your 
changed before running it because it will remove your local changes.

    sh ~/tmp/testheaders.sh

If you wonder why a header was added then you should have a look at the "test" 
file which includes the "noisy" part which you've mentioned. You should at 
least use iwyu 3.5

> On top of that, the results you posted says that I should include
> <linux/stddef.h> in bat_v.c, but it already included in that file. no?

Marek added it recently [2].

Kind regards,
	Sven

[1] https://git.open-mesh.org/build_test.git
[2] https://git.open-mesh.org/batman-adv.git/commit/9685688ae7dd85804aec2f6ce760611551fe9635
  
Sven Eckelmann May 15, 2016, 9:01 a.m. UTC | #8
On Sunday 08 May 2016 18:59:56 Sven Eckelmann wrote:
[....]
> Now you can for example run the build tests and receive the mail:
> 
>     REMOTE=/home/sven/tmp/qemu-batman/batman-adv TO=sven ./checkstuff.sh

The repo was updated to support the multicast patches. I've also introduced 
other helper code which automatically sets the TO to the current user and 
makes it easier to select the branches/Linux versions to test. For example a 
"fast" (like in "only enough time to make a cup of tea") test would be:

    REMOTE=/home/sven/tmp/qemu-batman/batman-adv \
    TESTBRANCHES="ecsv/misc_patches" INCOMING_BRANCH="ecsv/misc_patches" \
    LINUX_VERSIONS="linux-3.2 linux-4.5" \
    ./checkstuff.sh

> Or you can extract the relevant part of the script (see attachment - file
> paths have to be adjusted; build_test.git with prepared headers is still
> required) and run it manually. Please make sure that you've committed your
> changed before running it because it will remove your local changes.
> 
>     sh ~/tmp/testheaders.sh

Some adjustments were necessary for the support of the new multicast compat 
stuff. I have updated the minimal-test shellscript (see attachments).

Kind regards,
	Sven
  

Patch

diff --git a/net/batman-adv/sysfs.c b/net/batman-adv/sysfs.c
index 414b207..b99ea80 100644
--- a/net/batman-adv/sysfs.c
+++ b/net/batman-adv/sysfs.c
@@ -389,12 +389,12 @@  static int batadv_store_uint_attr(const char *buff, size_t count,
 	return count;
 }
 
-static inline ssize_t
-__batadv_store_uint_attr(const char *buff, size_t count,
-			 int min, int max,
-			 void (*post_func)(struct net_device *),
-			 const struct attribute *attr,
-			 atomic_t *attr_store, struct net_device *net_dev)
+static ssize_t __batadv_store_uint_attr(const char *buff, size_t count, int min,
+					int max,
+					void (*post_func)(struct net_device *),
+					const struct attribute *attr,
+					atomic_t *attr_store,
+					struct net_device *net_dev)
 {
 	int ret;