public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: purge unnecessary include
@ 2011-05-02 14:53 Marek Lindner
  2011-05-02 15:02 ` Sven Eckelmann
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Lindner @ 2011-05-02 14:53 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Marek Lindner

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
 compat.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/compat.h b/compat.h
index 0c5ad82..bddf7e2 100644
--- a/compat.h
+++ b/compat.h
@@ -26,7 +26,6 @@
 #define _NET_BATMAN_ADV_COMPAT_H_
 
 #include <linux/version.h>	/* LINUX_VERSION_CODE */
-#include "bat_sysfs.h"		/* struct bat_attribute */
 
 #ifndef IPPROTO_UDP
 #define IPPROTO_UDP 17
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: purge unnecessary include
  2011-05-02 14:53 [B.A.T.M.A.N.] [PATCH] batman-adv: purge unnecessary include Marek Lindner
@ 2011-05-02 15:02 ` Sven Eckelmann
  2011-05-02 15:09   ` Marek Lindner
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2011-05-02 15:02 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Marek Lindner

[-- Attachment #1: Type: Text/Plain, Size: 2193 bytes --]

On Monday 02 May 2011 16:53:44 Marek Lindner wrote:
> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
[,,,,]
>  #include <linux/version.h>	/* LINUX_VERSION_CODE */
> -#include "bat_sysfs.h"		/* struct bat_attribute */

This is necessary for kernels older than 2.6.24

make -C /home/batman/build_test/linux-build/linux-2.6.23/ REVISION=v2011.1.0-81-g89079ae-dirty M=/home/batman/batman-adv 
PWD=/home/batman/batman-adv -j 1 modules
make[1]: Entering directory `/home/batman/build_test/linux-build/linux-2.6.23'
  CC [M]  /home/batman/batman-adv/aggregation.o
In file included from /home/batman/batman-adv/main.h:117,
                 from /home/batman/batman-adv/aggregation.c:22:
/home/batman/batman-adv/compat.h: In function ‘bat_wrapper_show’:
/home/batman/batman-adv/compat.h:112: error: dereferencing pointer to incomplete type
/home/batman/batman-adv/compat.h:112: warning: type defaults to ‘int’ in declaration of ‘__mptr’
/home/batman/batman-adv/compat.h:112: warning: initialization from incompatible pointer type
/home/batman/batman-adv/compat.h:112: error: invalid use of undefined type ‘struct bat_attribute’
/home/batman/batman-adv/compat.h:114: error: dereferencing pointer to incomplete type
/home/batman/batman-adv/compat.h:115: error: dereferencing pointer to incomplete type
/home/batman/batman-adv/compat.h: In function ‘bat_wrapper_store’:
/home/batman/batman-adv/compat.h:124: error: dereferencing pointer to incomplete type
/home/batman/batman-adv/compat.h:124: warning: type defaults to ‘int’ in declaration of ‘__mptr’
/home/batman/batman-adv/compat.h:124: warning: initialization from incompatible pointer type
/home/batman/batman-adv/compat.h:124: error: invalid use of undefined type ‘struct bat_attribute’
/home/batman/batman-adv/compat.h:126: error: dereferencing pointer to incomplete type
/home/batman/batman-adv/compat.h:127: error: dereferencing pointer to incomplete type
make[2]: *** [/home/batman/batman-adv/aggregation.o] Error 1
make[1]: *** [_module_/home/batman/batman-adv] Error 2
make[1]: Leaving directory `/home/batman/build_test/linux-build/linux-2.6.23'
make: *** [all] Error 2

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: purge unnecessary include
  2011-05-02 15:02 ` Sven Eckelmann
@ 2011-05-02 15:09   ` Marek Lindner
  2011-05-02 15:22     ` Sven Eckelmann
  2011-05-02 15:27     ` Sven Eckelmann
  0 siblings, 2 replies; 6+ messages in thread
From: Marek Lindner @ 2011-05-02 15:09 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Monday 02 May 2011 17:02:32 Sven Eckelmann wrote:
> On Monday 02 May 2011 16:53:44 Marek Lindner wrote:
> > Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
> 
> [,,,,]
> 
> >  #include <linux/version.h>   /* LINUX_VERSION_CODE */
> >
> > -#include "bat_sysfs.h"               /* struct bat_attribute */
> 
> This is necessary for kernels older than 2.6.24


Aarrrgh, I was afraid of something like that. We are running into an include 
dependency issue as soon as bat_sysfs.h contains something like "struct 
bat_priv" which is likely to come soon ...
Any better idea how to fix this ?

Regards,
Marek

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: purge unnecessary include
  2011-05-02 15:09   ` Marek Lindner
@ 2011-05-02 15:22     ` Sven Eckelmann
  2011-05-02 15:27     ` Sven Eckelmann
  1 sibling, 0 replies; 6+ messages in thread
From: Sven Eckelmann @ 2011-05-02 15:22 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Marek Lindner

[-- Attachment #1: Type: Text/Plain, Size: 827 bytes --]

On Monday 02 May 2011 17:09:31 Marek Lindner wrote:
> On Monday 02 May 2011 17:02:32 Sven Eckelmann wrote:
> > On Monday 02 May 2011 16:53:44 Marek Lindner wrote:
> > > Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
> > 
> > [,,,,]
> > 
> > >  #include <linux/version.h>   /* LINUX_VERSION_CODE */
> > > 
> > > -#include "bat_sysfs.h"               /* struct bat_attribute */
> > 
> > This is necessary for kernels older than 2.6.24
> 
> Aarrrgh, I was afraid of something like that. We are running into an
> include dependency issue as soon as bat_sysfs.h contains something like
> "struct bat_priv" which is likely to come soon ...
> Any better idea how to fix this ?

Declaring everything below 2.6.24 as obsolete? Other solutions can be 
developed after arriving at home.

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: purge unnecessary include
  2011-05-02 15:09   ` Marek Lindner
  2011-05-02 15:22     ` Sven Eckelmann
@ 2011-05-02 15:27     ` Sven Eckelmann
  2011-05-02 15:47       ` Antonio Quartulli
  1 sibling, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2011-05-02 15:27 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Marek Lindner

[-- Attachment #1: Type: Text/Plain, Size: 1026 bytes --]

On Monday 02 May 2011 17:09:31 Marek Lindner wrote:
> On Monday 02 May 2011 17:02:32 Sven Eckelmann wrote:
> > On Monday 02 May 2011 16:53:44 Marek Lindner wrote:
> > > Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
> > 
> > [,,,,]
> > 
> > >  #include <linux/version.h>   /* LINUX_VERSION_CODE */
> > > 
> > > -#include "bat_sysfs.h"               /* struct bat_attribute */
> > 
> > This is necessary for kernels older than 2.6.24
> 
> Aarrrgh, I was afraid of something like that. We are running into an
> include dependency issue as soon as bat_sysfs.h contains something like
> "struct bat_priv" which is likely to come soon ...
> Any better idea how to fix this ?

Wait a second - why do you want to have a struct bat_priv in bat_sysfs.h? 
Isn't it possible to use 'struct bat_priv*" for a function declaration? 
'struct bat_priv;' can be used as forward declaration and used below in a 
function declaration.

struct bat_priv;
void test(struct bat_priv* a)
{
}

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: purge unnecessary include
  2011-05-02 15:27     ` Sven Eckelmann
@ 2011-05-02 15:47       ` Antonio Quartulli
  0 siblings, 0 replies; 6+ messages in thread
From: Antonio Quartulli @ 2011-05-02 15:47 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Mon, May 02, 2011 at 05:27:36PM +0200, Sven Eckelmann wrote:
> On Monday 02 May 2011 17:09:31 Marek Lindner wrote:
> > On Monday 02 May 2011 17:02:32 Sven Eckelmann wrote:
> > > On Monday 02 May 2011 16:53:44 Marek Lindner wrote:
> > > > Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
> > > 
> > > [,,,,]
> > > 
> > > >  #include <linux/version.h>   /* LINUX_VERSION_CODE */
> > > > 
> > > > -#include "bat_sysfs.h"               /* struct bat_attribute */
> > > 
> > > This is necessary for kernels older than 2.6.24
> > 
> > Aarrrgh, I was afraid of something like that. We are running into an
> > include dependency issue as soon as bat_sysfs.h contains something like
> > "struct bat_priv" which is likely to come soon ...
> > Any better idea how to fix this ?
> 
> Wait a second - why do you want to have a struct bat_priv in bat_sysfs.h? 
> Isn't it possible to use 'struct bat_priv*" for a function declaration? 
> 'struct bat_priv;' can be used as forward declaration and used below in a 
> function declaration.
> 
> struct bat_priv;
> void test(struct bat_priv* a)
> {
> }
> 

Just tested and it works!

Thank you Sven


Regards,

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-02 15:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-02 14:53 [B.A.T.M.A.N.] [PATCH] batman-adv: purge unnecessary include Marek Lindner
2011-05-02 15:02 ` Sven Eckelmann
2011-05-02 15:09   ` Marek Lindner
2011-05-02 15:22     ` Sven Eckelmann
2011-05-02 15:27     ` Sven Eckelmann
2011-05-02 15:47       ` Antonio Quartulli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox