Skip to content

Commit

Permalink
net: arcnet: Remove "#define bool int"
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Rasmus Villemoes authored and David S. Miller committed Jul 8, 2014
1 parent a16a336 commit db55b62
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions include/linux/arcdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) */
Expand All @@ -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);

Expand Down

0 comments on commit db55b62

Please sign in to comment.