Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1580029

Re: [PATCH v4 net-next 5/8] sunvnet: straighten up message event handling logic

From Shannon Nelson <shannon.nelson@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 net-next 5/8] sunvnet: straighten up message event handling logic
Date 2017-02-13 20:20 +0100
Message-ID <tauki-7S8-21@gated-at.bofh.it> (permalink)
References <tauaC-7Oj-19@gated-at.bofh.it> <tauaC-7Oj-17@gated-at.bofh.it> <tauaC-7Oj-25@gated-at.bofh.it>
Organization Oracle Corporation

Show all headers | View raw


On 2/13/2017 11:06 AM, Joe Perches wrote:
> On Mon, 2017-02-13 at 10:57 -0800, Shannon Nelson wrote:
>> The use of gotos for handling the incoming events made this code
>> harder to read and support than it should be.  This patch straightens
>> out and clears up the logic.
>>
>> Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
>> ---
>>  drivers/net/ethernet/sun/sunvnet_common.c |   94 ++++++++++++++---------------
>>  1 files changed, 45 insertions(+), 49 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/sun/sunvnet_common.c b/drivers/net/ethernet/sun/sunvnet_common.c
> []
>> @@ -738,41 +738,37 @@ static int vnet_event_napi(struct vnet_port *port, int budget)
> []
>> +	/* we don't expect any other bits */
>> +	BUG_ON(port->rx_event & ~(LDC_EVENT_DATA_READY |
>> +				  LDC_EVENT_RESET |
>> +				  LDC_EVENT_UP));
>
> Is it really necessary to use BUG_ON here?
>

I'm carrying this from the original code because we want to know asap if 
we have a low level protocol issue.  It should never happen in the 
field, but we want to notice it as soon as we can when doing development 
and testing.  In this patch I've simply made it more obvious and up 
front that we're doing this test rather than having it buried in the 
logic a few lines further down.

sln

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v4 net-next 5/8] sunvnet: straighten up message event handling logic Shannon Nelson <shannon.nelson@oracle.com> - 2017-02-13 20:10 +0100
  Re: [PATCH v4 net-next 5/8] sunvnet: straighten up message event  handling logic Joe Perches <joe@perches.com> - 2017-02-13 20:10 +0100
    Re: [PATCH v4 net-next 5/8] sunvnet: straighten up message event  handling logic Shannon Nelson <shannon.nelson@oracle.com> - 2017-02-13 20:20 +0100

csiph-web