* [PATCH] net: arcnet: Remove "#define bool int"
@ 2014-07-02 12:12 Rasmus Villemoes
2014-07-02 16:02 ` Greg Kroah-Hartman
2014-07-08 4:35 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2014-07-02 12:12 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: netdev, linux-kernel, Rasmus Villemoes
The header file include/linux/arcdevice.h #defines bool to int, if
bool is not already #defined. However, the files which use that header
file seem to rely on that #define (unconditionally) being in effect:
the prototypes for the functions arcrimi_reset, com20020_reset,
com90io_reset, com90xx_reset (whose addresses are assigned to the
hw.reset member of struct arcnet_local) use int explicitly.
Moreover, that #define is an accident waiting to happen (scenario:
inclusion of arcdevice.h followed by inclusion of some header which
declares function prototypes using bool). Also, #include
<linux/types.h> must appear before #include <linux/arcdevice.h> (the
compiler wouldn't like "typedef _Bool int").
Since none of the files using arcdevice.h declare variables of type
"bool", the patch is actually quite simple, unlike the commit message.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/linux/arcdevice.h | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index 7216b0d..df03562 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -22,10 +22,6 @@
#ifdef __KERNEL__
#include <linux/irqreturn.h>
-#ifndef bool
-#define bool int
-#endif
-
/*
* RECON_THRESHOLD is the maximum number of RECON messages to receive
* within one minute before printing a "cabling problem" warning. The
@@ -285,9 +281,9 @@ struct arcnet_local {
unsigned long first_recon; /* time of "first" RECON message to count */
unsigned long last_recon; /* time of most recent RECON */
int num_recons; /* number of RECONs between first and last. */
- bool network_down; /* do we think the network is down? */
+ int network_down; /* do we think the network is down? */
- bool excnak_pending; /* We just got an excesive nak interrupt */
+ int excnak_pending; /* We just got an excesive nak interrupt */
struct {
uint16_t sequence; /* sequence number (incs with each packet) */
@@ -305,7 +301,7 @@ struct arcnet_local {
void (*command) (struct net_device * dev, int cmd);
int (*status) (struct net_device * dev);
void (*intmask) (struct net_device * dev, int mask);
- bool (*reset) (struct net_device * dev, bool really_reset);
+ int (*reset) (struct net_device * dev, int really_reset);
void (*open) (struct net_device * dev);
void (*close) (struct net_device * dev);
--
1.9.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: arcnet: Remove "#define bool int"
2014-07-02 12:12 [PATCH] net: arcnet: Remove "#define bool int" Rasmus Villemoes
@ 2014-07-02 16:02 ` Greg Kroah-Hartman
2014-07-02 17:49 ` Rasmus Villemoes
2014-07-08 4:35 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2014-07-02 16:02 UTC (permalink / raw)
To: Rasmus Villemoes; +Cc: netdev, linux-kernel
On Wed, Jul 02, 2014 at 02:12:01PM +0200, Rasmus Villemoes wrote:
> The header file include/linux/arcdevice.h #defines bool to int, if
> bool is not already #defined. However, the files which use that header
> file seem to rely on that #define (unconditionally) being in effect:
> the prototypes for the functions arcrimi_reset, com20020_reset,
> com90io_reset, com90xx_reset (whose addresses are assigned to the
> hw.reset member of struct arcnet_local) use int explicitly.
>
> Moreover, that #define is an accident waiting to happen (scenario:
> inclusion of arcdevice.h followed by inclusion of some header which
> declares function prototypes using bool). Also, #include
> <linux/types.h> must appear before #include <linux/arcdevice.h> (the
> compiler wouldn't like "typedef _Bool int").
>
> Since none of the files using arcdevice.h declare variables of type
> "bool", the patch is actually quite simple, unlike the commit message.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
> include/linux/arcdevice.h | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
Why are you sending this patch to me? I don't "own" it at all, please
use scripts/get_maintainer.pl to determine who to email patches to.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: arcnet: Remove "#define bool int"
2014-07-02 16:02 ` Greg Kroah-Hartman
@ 2014-07-02 17:49 ` Rasmus Villemoes
0 siblings, 0 replies; 4+ messages in thread
From: Rasmus Villemoes @ 2014-07-02 17:49 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: netdev, linux-kernel
Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
> On Wed, Jul 02, 2014 at 02:12:01PM +0200, Rasmus Villemoes wrote:
>
>> include/linux/arcdevice.h | 10 +++-------
>> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> Why are you sending this patch to me? I don't "own" it at all, please
> use scripts/get_maintainer.pl to determine who to email patches to.
Sorry. I did use get_maintainer.pl, but that only produced the two
mailing lists. I thought one was supposed to include at least one
maintainer, so I made a (not-so-)educated guess. I'll try to be more
careful in the future.
Rasmus
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: arcnet: Remove "#define bool int"
2014-07-02 12:12 [PATCH] net: arcnet: Remove "#define bool int" Rasmus Villemoes
2014-07-02 16:02 ` Greg Kroah-Hartman
@ 2014-07-08 4:35 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-07-08 4:35 UTC (permalink / raw)
To: linux; +Cc: netdev, linux-kernel
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Date: Wed, 2 Jul 2014 14:12:01 +0200
> The header file include/linux/arcdevice.h #defines bool to int, if
> bool is not already #defined. However, the files which use that header
> file seem to rely on that #define (unconditionally) being in effect:
> the prototypes for the functions arcrimi_reset, com20020_reset,
> com90io_reset, com90xx_reset (whose addresses are assigned to the
> hw.reset member of struct arcnet_local) use int explicitly.
>
> Moreover, that #define is an accident waiting to happen (scenario:
> inclusion of arcdevice.h followed by inclusion of some header which
> declares function prototypes using bool). Also, #include
> <linux/types.h> must appear before #include <linux/arcdevice.h> (the
> compiler wouldn't like "typedef _Bool int").
>
> Since none of the files using arcdevice.h declare variables of type
> "bool", the patch is actually quite simple, unlike the commit message.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-08 4:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02 12:12 [PATCH] net: arcnet: Remove "#define bool int" Rasmus Villemoes
2014-07-02 16:02 ` Greg Kroah-Hartman
2014-07-02 17:49 ` Rasmus Villemoes
2014-07-08 4:35 ` David Miller
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.