netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: fix *_DIAG_MAX constants
@ 2013-03-21 14:18 Andrey Vagin
  2013-03-21 14:42 ` Thomas Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Vagin @ 2013-03-21 14:18 UTC (permalink / raw)
  To: Thomas Graf, linux-kernel, netdev
  Cc: Andrey Vagin, David S. Miller, Pavel Emelyanov, Eric Dumazet,
	Paul E. McKenney, David Howells

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>
---
 include/uapi/linux/netlink_diag.h | 4 +++-
 include/uapi/linux/packet_diag.h  | 4 +++-
 include/uapi/linux/unix_diag.h    | 4 +++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/uapi/linux/netlink_diag.h b/include/uapi/linux/netlink_diag.h
index 9328866..88009a3 100644
--- a/include/uapi/linux/netlink_diag.h
+++ b/include/uapi/linux/netlink_diag.h
@@ -29,9 +29,11 @@ enum {
 	NETLINK_DIAG_MEMINFO,
 	NETLINK_DIAG_GROUPS,
 
-	NETLINK_DIAG_MAX,
+	__NETLINK_DIAG_MAX,
 };
 
+#define NETLINK_DIAG_MAX (__NETLINK_DIAG_MAX - 1)
+
 #define NDIAG_PROTO_ALL		((__u8) ~0)
 
 #define NDIAG_SHOW_MEMINFO	0x00000001 /* show memory info of a socket */
diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h
index 93f5fa9..afafd70 100644
--- a/include/uapi/linux/packet_diag.h
+++ b/include/uapi/linux/packet_diag.h
@@ -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;
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h
index b8a2494..b9e2a6a 100644
--- a/include/uapi/linux/unix_diag.h
+++ b/include/uapi/linux/unix_diag.h
@@ -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;
-- 
1.8.1.4

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

* Re: [PATCH] net: fix *_DIAG_MAX constants
  2013-03-21 14:18 [PATCH] net: fix *_DIAG_MAX constants Andrey Vagin
@ 2013-03-21 14:42 ` Thomas Graf
  2013-03-21 15:14   ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Graf @ 2013-03-21 14:42 UTC (permalink / raw)
  To: Andrey Vagin
  Cc: linux-kernel, netdev, David S. Miller, Pavel Emelyanov,
	Eric Dumazet, Paul E. McKenney, David Howells

On 03/21/13 at 06:18pm, Andrey Vagin wrote:
> 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>

Acked-by: Thomas Graf <tgraf@suug.ch>

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

* Re: [PATCH] net: fix *_DIAG_MAX constants
  2013-03-21 14:42 ` Thomas Graf
@ 2013-03-21 15:14   ` David Miller
  2013-03-21 15:25     ` Thomas Graf
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2013-03-21 15:14 UTC (permalink / raw)
  To: tgraf; +Cc: avagin, linux-kernel, netdev, xemul, edumazet, paulmck, dhowells

From: Thomas Graf <tgraf@suug.ch>
Date: Thu, 21 Mar 2013 14:42:18 +0000

> On 03/21/13 at 06:18pm, Andrey Vagin wrote:
>> 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>
> 
> Acked-by: Thomas Graf <tgraf@suug.ch>

So you're ACK'ing a patch that makes changes to files that don't even
exist in the repository?

Andrey, post a clean patch against 'net' that fixes these constants
for existing code, don't just assume that your original patch set is
applied and post changes relative to that.  That's not how we work.

After the bug fix for the existing cases goes in, you have to repost
your original patch set on top of that.

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

* Re: [PATCH] net: fix *_DIAG_MAX constants
  2013-03-21 15:14   ` David Miller
@ 2013-03-21 15:25     ` Thomas Graf
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Graf @ 2013-03-21 15:25 UTC (permalink / raw)
  To: David Miller
  Cc: avagin, linux-kernel, netdev, xemul, edumazet, paulmck, dhowells

On 03/21/13 at 11:14am, David Miller wrote:
> So you're ACK'ing a patch that makes changes to files that don't even
> exist in the repository?

I have been ACK'ing the patch in the context of the previous
patch that I reviewed in the first place which in summary is
now OK. But you are obviously right that a fixed version of
the initial patch should be submitted instead.

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

end of thread, other threads:[~2013-03-21 15:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 14:18 [PATCH] net: fix *_DIAG_MAX constants Andrey Vagin
2013-03-21 14:42 ` Thomas Graf
2013-03-21 15:14   ` David Miller
2013-03-21 15:25     ` Thomas Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).