RE: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-11 Thread David Laight
From: David Miller > From: Linus Torvalds > Date: Mon, 10 Mar 2014 19:02:18 -0700 > > > I would generally suggest that people only use "bool" for function > > return types, and absolutely nothing else. Seriously. > > I think it makes sense for function arguments too. 'bool' doesn't necessarily

RE: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-11 Thread David Laight
From: David Miller From: Linus Torvalds torva...@linux-foundation.org Date: Mon, 10 Mar 2014 19:02:18 -0700 I would generally suggest that people only use bool for function return types, and absolutely nothing else. Seriously. I think it makes sense for function arguments too. 'bool'

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread Linus Torvalds
On Mon, Mar 10, 2014 at 7:33 PM, H. Peter Anvin wrote: > Why not for variables? My dislike of "bool" comes from the fact that you historically can't *trust* it. I guess it's becoming trustworthy these days, but quite often, traditionally, "bool" ended up being just another word for "char",

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread Joe Perches
On Mon, 2014-03-10 at 19:02 -0700, Linus Torvalds wrote: > On Mon, Mar 10, 2014 at 6:51 PM, David Miller wrote: > > From: Alexei Starovoitov > > Date: Sun, 9 Mar 2014 23:04:02 -0700 > > > >> + unsigned intjited:1; > > > > The C language has a proper type for boolean states,

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread Alexei Starovoitov
On Mon, Mar 10, 2014 at 7:20 PM, H. Peter Anvin wrote: > Bool vs bitfield are orthogonal, at least under gcc, unless I'm completely > out to sea. It is probably not a good idea to create a bitfield when it > doesn't buy you anything, lest you generate rmw instructions when byte stores > would

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread David Miller
From: "H. Peter Anvin" Date: Mon, 10 Mar 2014 19:33:03 -0700 > Why not for variables? It makes a lot of sense of nothing else to > avoid the confusion that invariably happens when someone decides to > introduce the value 2 or -1 to an existing variable (and yes, thus > has happened a number of

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread H. Peter Anvin
Why not for variables? It makes a lot of sense of nothing else to avoid the confusion that invariably happens when someone decides to introduce the value 2 or -1 to an existing variable (and yes, thus has happened a number of times.) Not to mention they take a single byte rather than four for

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread H. Peter Anvin
Bool vs bitfield are orthogonal, at least under gcc, unless I'm completely out to sea. It is probably not a good idea to create a bitfield when it doesn't buy you anything, lest you generate rmw instructions when byte stores would do. On March 10, 2014 7:02:18 PM PDT, Linus Torvalds wrote:

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread David Miller
From: Linus Torvalds Date: Mon, 10 Mar 2014 19:02:18 -0700 > I would generally suggest that people only use "bool" for function > return types, and absolutely nothing else. Seriously. I think it makes sense for function arguments too. -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread Linus Torvalds
On Mon, Mar 10, 2014 at 7:02 PM, Linus Torvalds wrote: > > So please don't sell "bool" as some kind of panacea. It has at least > as many problems as it has advantages. Side note: not that bitfields are all that great either, partly because gcc tends to occasionally generate absolutely

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread Linus Torvalds
On Mon, Mar 10, 2014 at 6:51 PM, David Miller wrote: > From: Alexei Starovoitov > Date: Sun, 9 Mar 2014 23:04:02 -0700 > >> + unsigned intjited:1; > > The C language has a proper type for boolean states, please therefore > use 'bool', true, and false. No, the C standard

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread David Miller
From: Alexei Starovoitov Date: Sun, 9 Mar 2014 23:04:02 -0700 > + unsigned intjited:1; The C language has a proper type for boolean states, please therefore use 'bool', true, and false. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread David Miller
From: Alexei Starovoitov a...@plumgrid.com Date: Sun, 9 Mar 2014 23:04:02 -0700 + unsigned intjited:1; The C language has a proper type for boolean states, please therefore use 'bool', true, and false. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread Linus Torvalds
On Mon, Mar 10, 2014 at 6:51 PM, David Miller da...@davemloft.net wrote: From: Alexei Starovoitov a...@plumgrid.com Date: Sun, 9 Mar 2014 23:04:02 -0700 + unsigned intjited:1; The C language has a proper type for boolean states, please therefore use 'bool', true, and false.

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread Linus Torvalds
On Mon, Mar 10, 2014 at 7:02 PM, Linus Torvalds torva...@linux-foundation.org wrote: So please don't sell bool as some kind of panacea. It has at least as many problems as it has advantages. Side note: not that bitfields are all that great either, partly because gcc tends to occasionally

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread David Miller
From: Linus Torvalds torva...@linux-foundation.org Date: Mon, 10 Mar 2014 19:02:18 -0700 I would generally suggest that people only use bool for function return types, and absolutely nothing else. Seriously. I think it makes sense for function arguments too. -- To unsubscribe from this list:

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread H. Peter Anvin
Bool vs bitfield are orthogonal, at least under gcc, unless I'm completely out to sea. It is probably not a good idea to create a bitfield when it doesn't buy you anything, lest you generate rmw instructions when byte stores would do. On March 10, 2014 7:02:18 PM PDT, Linus Torvalds

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread H. Peter Anvin
Why not for variables? It makes a lot of sense of nothing else to avoid the confusion that invariably happens when someone decides to introduce the value 2 or -1 to an existing variable (and yes, thus has happened a number of times.) Not to mention they take a single byte rather than four for

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread David Miller
From: H. Peter Anvin h...@zytor.com Date: Mon, 10 Mar 2014 19:33:03 -0700 Why not for variables? It makes a lot of sense of nothing else to avoid the confusion that invariably happens when someone decides to introduce the value 2 or -1 to an existing variable (and yes, thus has happened a

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread Alexei Starovoitov
On Mon, Mar 10, 2014 at 7:20 PM, H. Peter Anvin h...@zytor.com wrote: Bool vs bitfield are orthogonal, at least under gcc, unless I'm completely out to sea. It is probably not a good idea to create a bitfield when it doesn't buy you anything, lest you generate rmw instructions when byte

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread Joe Perches
On Mon, 2014-03-10 at 19:02 -0700, Linus Torvalds wrote: On Mon, Mar 10, 2014 at 6:51 PM, David Miller da...@davemloft.net wrote: From: Alexei Starovoitov a...@plumgrid.com Date: Sun, 9 Mar 2014 23:04:02 -0700 + unsigned intjited:1; The C language has a proper type

Re: [PATCH v8 net-next 1/3] filter: add Extended BPF interpreter and converter

2014-03-10 Thread Linus Torvalds
On Mon, Mar 10, 2014 at 7:33 PM, H. Peter Anvin h...@zytor.com wrote: Why not for variables? My dislike of bool comes from the fact that you historically can't *trust* it. I guess it's becoming trustworthy these days, but quite often, traditionally, bool ended up being just another word for