Hi, the following diff removes two unnecessary comparisons.
In dsdt.c, pdata->pnpid is an array embedded in a struct, not a pointer, so if pdata is not NULL, which is checked a few lines above, pdata->pnpid probably isn't either. A similar issue also occurs in ti.c for ti_event_ring and ti_tx_ring in sc->ti_rdata. \Patrick diff --git sys/dev/acpi/dsdt.c sys/dev/acpi/dsdt.c index dab3e6d6..5336bf8 100644 --- sys/dev/acpi/dsdt.c +++ sys/dev/acpi/dsdt.c @@ -581,7 +581,7 @@ aml_notify_dev(const char *pnpid, int notify_value) return; SLIST_FOREACH(pdata, &aml_notify_list, link) - if (pdata->pnpid && !strcmp(pdata->pnpid, pnpid)) + if (!strcmp(pdata->pnpid, pnpid)) pdata->cbproc(pdata->node, notify_value, pdata->cbarg); } diff --git sys/dev/ic/ti.c sys/dev/ic/ti.c index f983234..814dfe2 100644 --- sys/dev/ic/ti.c +++ sys/dev/ic/ti.c @@ -490,9 +490,6 @@ ti_handle_events(struct ti_softc *sc) struct ti_event_desc *e; struct ifnet *ifp = &sc->arpcom.ac_if; - if (sc->ti_rdata->ti_event_ring == NULL) - return; - while (sc->ti_ev_saved_considx != sc->ti_ev_prodidx.ti_idx) { e = &sc->ti_rdata->ti_event_ring[sc->ti_ev_saved_considx]; switch (TI_EVENT_EVENT(e)) { @@ -853,9 +850,6 @@ ti_free_tx_ring(struct ti_softc *sc) int i; struct ti_txmap_entry *entry; - if (sc->ti_rdata->ti_tx_ring == NULL) - return; - for (i = 0; i < TI_TX_RING_CNT; i++) { if (sc->ti_cdata.ti_tx_chain[i] != NULL) { m_freem(sc->ti_cdata.ti_tx_chain[i]);