armv7/sxie: less ierror

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

armv7/sxie: less ierror

Artturi Alm
Hi,

i'm likely responsible, for having sent the diff that introduced this.
minimal fix taken w/diff -U10, to show the obvious dup++.

-Artturi


diff --git a/sys/arch/armv7/sunxi/sxie.c b/sys/arch/armv7/sunxi/sxie.c
index 1cd713cd52a..cb5849c7dc9 100644
--- a/sys/arch/armv7/sunxi/sxie.c
+++ b/sys/arch/armv7/sunxi/sxie.c
@@ -613,21 +613,20 @@ trynext:
  /* read the actual packet from fifo XXX through 'align buffer'.. */
  if (pktlen & 3)
  rlen = SXIE_ROUNDUP(pktlen, 4);
  else
  rlen = pktlen;
  bus_space_read_multi_4(sc->sc_iot, sc->sc_ioh,
     SXIE_RXIO, (uint32_t *)&rxbuf[0], rlen >> 2);
 
  m = m_devget(&rxbuf[0], pktlen, ETHER_ALIGN);
  if (m == NULL) {
- ifp->if_ierrors++;
  goto err_out;
  }
 
  ml_enqueue(&ml, m);
  goto trynext;
 err_out:
  ifp->if_ierrors++;
 done:
  if_input(ifp, &ml);
 }

Reply | Threaded
Open this post in threaded view
|

Re: armv7/sxie: less ierror

Mark Kettenis
> Date: Sun, 12 Nov 2017 04:58:23 +0200
> From: Artturi Alm <[hidden email]>
>
> Hi,
>
> i'm likely responsible, for having sent the diff that introduced this.
> minimal fix taken w/diff -U10, to show the obvious dup++.
>
> -Artturi

I think it makes more sense to fix it this way:

ok?


Index: arch/armv7/sunxi/sxie.c
===================================================================
RCS file: /cvs/src/sys/arch/armv7/sunxi/sxie.c,v
retrieving revision 1.25
diff -u -p -r1.25 sxie.c
--- arch/armv7/sunxi/sxie.c 22 Jan 2017 10:17:37 -0000 1.25
+++ arch/armv7/sunxi/sxie.c 12 Nov 2017 18:05:46 -0000
@@ -595,8 +595,8 @@ trynext:
  SXISET4(sc, SXIE_RXCR, SXIE_RXFLUSH);
  while (SXIREAD4(sc, SXIE_RXCR) & SXIE_RXFLUSH);
  SXISET4(sc, SXIE_CR, SXIE_RX_ENABLE);
-
- goto err_out;
+ ifp->if_ierrors++;
+ goto done;
  }
 
  reg = SXIREAD4(sc, SXIE_RXIO);
@@ -621,13 +621,11 @@ trynext:
  m = m_devget(&rxbuf[0], pktlen, ETHER_ALIGN);
  if (m == NULL) {
  ifp->if_ierrors++;
- goto err_out;
+ goto done;
  }
 
  ml_enqueue(&ml, m);
  goto trynext;
-err_out:
- ifp->if_ierrors++;
 done:
  if_input(ifp, &ml);
 }

Reply | Threaded
Open this post in threaded view
|

Re: armv7/sxie: less ierror

Artturi Alm
On Sun, Nov 12, 2017 at 07:07:13PM +0100, Mark Kettenis wrote:

> > Date: Sun, 12 Nov 2017 04:58:23 +0200
> > From: Artturi Alm <[hidden email]>
> >
> > Hi,
> >
> > i'm likely responsible, for having sent the diff that introduced this.
> > minimal fix taken w/diff -U10, to show the obvious dup++.
> >
> > -Artturi
>
> I think it makes more sense to fix it this way:
>
> ok?
>

yep, exactly what i had before minimalizing the diff.

-Artturi

>
> Index: arch/armv7/sunxi/sxie.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/armv7/sunxi/sxie.c,v
> retrieving revision 1.25
> diff -u -p -r1.25 sxie.c
> --- arch/armv7/sunxi/sxie.c 22 Jan 2017 10:17:37 -0000 1.25
> +++ arch/armv7/sunxi/sxie.c 12 Nov 2017 18:05:46 -0000
> @@ -595,8 +595,8 @@ trynext:
>   SXISET4(sc, SXIE_RXCR, SXIE_RXFLUSH);
>   while (SXIREAD4(sc, SXIE_RXCR) & SXIE_RXFLUSH);
>   SXISET4(sc, SXIE_CR, SXIE_RX_ENABLE);
> -
> - goto err_out;
> + ifp->if_ierrors++;
> + goto done;
>   }
>  
>   reg = SXIREAD4(sc, SXIE_RXIO);
> @@ -621,13 +621,11 @@ trynext:
>   m = m_devget(&rxbuf[0], pktlen, ETHER_ALIGN);
>   if (m == NULL) {
>   ifp->if_ierrors++;
> - goto err_out;
> + goto done;
>   }
>  
>   ml_enqueue(&ml, m);
>   goto trynext;
> -err_out:
> - ifp->if_ierrors++;
>  done:
>   if_input(ifp, &ml);
>  }