On 03:07 Thu 13 Dec     , Rafael Ferreira Neves wrote:
> Hello,
> 
> I think that the original code is correct. The definition of ip_output
> function says that the first argument is a pointer to an mbuf, but the
> other are variadic. In this case style(9) states that (type *)NULL should
> be used.
> 
> Regards
> Rafael
> 
> On Thu, Dec 13, 2012 at 2:11 AM, Michael W. Bombardieri <m...@ii.net> wrote:
> 
> > Hi,
> >
> > I have a small patch for if_gre.c...
> >
> > NULL is already defined as ((void *)0), so we don't
> > need to cast it to void*.
> >
> > No binary change on amd64.
> > Does this look OK?
> >
> > - Michael
> >
> >
> > Index: if_gre.c
> > ===================================================================
> > RCS file: /cvs/src/sys/net/if_gre.c,v
> > retrieving revision 1.59
> > diff -u -r1.59 if_gre.c
> > --- if_gre.c    23 Nov 2012 20:12:03 -0000      1.59
> > +++ if_gre.c    13 Dec 2012 04:09:38 -0000
> > @@ -431,7 +431,7 @@
> >  #endif
> >
> >         /* Send it off */
> > -       error = ip_output(m, (void *)NULL, &sc->route, 0, (void *)NULL,
> > (void *)NULL);
> > +       error = ip_output(m, NULL, &sc->route, 0, NULL, NULL);
> >    end:
> >         if (error)
> >                 ifp->if_oerrors++;

And after cpp run you get a double cast like (void*)((void*)0).

Reply via email to