Source-Changes archive

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

CVS commit: src/sys/dev



Module Name:    src
Committed By:   dyoung
Date:           Sun Dec  6 22:42:48 UTC 2009

Modified Files:
        src/sys/dev: audio.c midi.c radio.c video.c

Log Message:
Simplify these device-activation hooks using the following semantic
patch.

XXX sc_dying must die.

@@
type device_t;

identifier act, midi_softc, midiactivate, sc, self;
@@

int
midiactivate(device_t self, enum devact act)
{
(
        struct midi_softc *sc = device_private(self);
|
-       struct midi_softc *sc;
+       struct midi_softc *sc = device_private(self);
...
-       sc = device_private(self);
)
...
        switch (act) {
-       case DVACT_ACTIVATE:
-               return (EOPNOTSUPP);
-
        case DVACT_DEACTIVATE:
(
        sc->dying
|
        sc->sc_dying
)
                =
(
        1
|
        true
)
                ;
-               break;
+               return 0;
+       default:
+               return EOPNOTSUPP;
        }
-       return (0);
}


To generate a diff of this commit:
cvs rdiff -u -r1.248 -r1.249 src/sys/dev/audio.c
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/midi.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/radio.c src/sys/dev/video.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Home | Main Index | Thread Index | Old Index