Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/usb




To: Manuel Bouyer <bouyer%antioche.eu.org@localhost>

Subject: Re: CVS commit: src/sys/dev/usb

From: Martin Husemann <martin%duskware.de@localhost>

Date: Sat, 21 Apr 2018 09:37:46 +0200


On Sat, Apr 21, 2018 at 09:30:20AM +0200, Manuel Bouyer wrote:
> > > 
> > >-       axe_cmd(sc, AXE_CMD_WRITE_MCAST, 0, 0, (void *)&hashtbl);
> > >+       axe_cmd(sc, AXE_CMD_WRITE_MCAST, 0, 0, hashtbl);
> > >
> > >missing & ?
> > 
> >         uint8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 
> 
> So I guess the code was wrong before; not sure how multicast could have
> worked.

No, the address is only needed as rhs of the cast. If passed directly,
the address will be used (due to arrays being passed as pointer to first
element in C).

Try it:

#include <stdio.h>
#include <inttypes.h>

int main(void)
{
        static uint8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };

        printf("%p vs %p\n", (void *)&hashtbl, hashtbl);
        return 0;
}


Martin


Follow-Ups:

Re: CVS commit: src/sys/dev/usb
From: Manuel Bouyer


References:

Re: CVS commit: src/sys/dev/usb
From: Manuel Bouyer

Re: CVS commit: src/sys/dev/usb
From: Christos Zoulas

Re: CVS commit: src/sys/dev/usb
From: Manuel Bouyer




Prev by Date: Re: CVS commit: src/sys/dev/usb

Next by Date: Re: CVS commit: src/sys/dev/usb

Previous by Thread: Re: CVS commit: src/sys/dev/usb

Next by Thread: Re: CVS commit: src/sys/dev/usb

Indexes:

reverse Date

reverse Thread

Old Index



Home | Main Index | Thread Index | Old Index