Commit ca7479eb authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

inet: Define IPV4_DEVCONF_MAX

Define IPV4_DEVCONF_MAX to get rid of MAX - 1 notation.
Signed-off-by: default avatarThomas Graf <tgraf@infradead.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f8ff182c
...@@ -41,10 +41,12 @@ enum ...@@ -41,10 +41,12 @@ enum
__IPV4_DEVCONF_MAX __IPV4_DEVCONF_MAX
}; };
#define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1)
struct ipv4_devconf { struct ipv4_devconf {
void *sysctl; void *sysctl;
int data[__IPV4_DEVCONF_MAX - 1]; int data[IPV4_DEVCONF_MAX];
DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1); DECLARE_BITMAP(state, IPV4_DEVCONF_MAX);
}; };
struct in_device { struct in_device {
...@@ -90,7 +92,7 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index, ...@@ -90,7 +92,7 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index,
static inline void ipv4_devconf_setall(struct in_device *in_dev) static inline void ipv4_devconf_setall(struct in_device *in_dev)
{ {
bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1); bitmap_fill(in_dev->cnf.state, IPV4_DEVCONF_MAX);
} }
#define IN_DEV_CONF_GET(in_dev, attr) \ #define IN_DEV_CONF_GET(in_dev, attr) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment