Skip to content

Commit

Permalink
net: fix *_DIAG_MAX constants
Browse files Browse the repository at this point in the history
Follow the common pattern and define *_DIAG_MAX like:

        [...]
        __XXX_DIAG_MAX,
};

Because everyone is used to do:

        struct nlattr *attrs[XXX_DIAG_MAX+1];

        nla_parse([...], XXX_DIAG_MAX, [...]

Reported-by: Thomas Graf <tgraf@suug.ch>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrey Vagin authored and David S. Miller committed Mar 21, 2013
1 parent b37391e commit ae5fc98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion include/uapi/linux/packet_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ enum {
PACKET_DIAG_TX_RING,
PACKET_DIAG_FANOUT,

PACKET_DIAG_MAX,
__PACKET_DIAG_MAX,
};

#define PACKET_DIAG_MAX (__PACKET_DIAG_MAX - 1)

struct packet_diag_info {
__u32 pdi_index;
__u32 pdi_version;
Expand Down
4 changes: 3 additions & 1 deletion include/uapi/linux/unix_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ enum {
UNIX_DIAG_MEMINFO,
UNIX_DIAG_SHUTDOWN,

UNIX_DIAG_MAX,
__UNIX_DIAG_MAX,
};

#define UNIX_DIAG_MAX (__UNIX_DIAG_MAX - 1)

struct unix_diag_vfs {
__u32 udiag_vfs_ino;
__u32 udiag_vfs_dev;
Expand Down

0 comments on commit ae5fc98

Please sign in to comment.