header file cissvar.h has this definition:
#define CISSQ_REQUEST_QUEUE(name, index) \
static __inline void \
ciss_initq_ ## name (struct ciss_softc *sc) \
{ \
STAILQ_INIT(&sc->ciss_ ## name); \
CISSQ_INIT(sc, index); \
} \
(...)
And actual usage in ciss.c looks like this:
ciss_initq_free(sc);
ciss_initq_notify(sc);
It would be great if someone can explain how does this work.
So,
The important lines are these (also in cissvar.h):
CISSQ_REQUEST_QUEUE(free, CISSQ_FREE);
CISSQ_REQUEST_QUEUE(notify, CISSQ_NOTIFY);
They invoke that macro that you pasted. The "##" operator concatenates two words of code together into a single word, so the code generated (with the macro expansion) for the first line looks something like this:
static __inline void
ciss_initq_free(struct ciss_softc *sc)
{
STAILQ_INIT(&sc->ciss_free);
CISSQ_INIT(sc, CISSQ_FREE);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With