atkbdc.c (98e0ffaefb0f241cda3a72395d3be04192ae0d47) | atkbdc.c (73a1170a8c41cb848f17cc0a8839e9dcee3d126e) |
---|---|
1/*- 2 * Copyright (c) 1996-1999 3 * Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp) 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 140 unchanged lines hidden (view full) --- 149 return (0); 150} 151 152atkbdc_softc_t 153*atkbdc_get_softc(int unit) 154{ 155 atkbdc_softc_t *sc; 156 | 1/*- 2 * Copyright (c) 1996-1999 3 * Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp) 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 140 unchanged lines hidden (view full) --- 149 return (0); 150} 151 152atkbdc_softc_t 153*atkbdc_get_softc(int unit) 154{ 155 atkbdc_softc_t *sc; 156 |
157 if (unit >= sizeof(atkbdc_softc)/sizeof(atkbdc_softc[0])) | 157 if (unit >= nitems(atkbdc_softc)) |
158 return NULL; 159 sc = atkbdc_softc[unit]; 160 if (sc == NULL) { 161 sc = atkbdc_softc[unit] 162 = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO); 163 if (sc == NULL) 164 return NULL; 165 } --- 1036 unchanged lines hidden --- | 158 return NULL; 159 sc = atkbdc_softc[unit]; 160 if (sc == NULL) { 161 sc = atkbdc_softc[unit] 162 = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO); 163 if (sc == NULL) 164 return NULL; 165 } --- 1036 unchanged lines hidden --- |