aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-22 11:12:34 -0400
committerTakashi Iwai <tiwai@suse.de>2009-07-22 11:12:34 -0400
commit35ebf6e7210dc0f7c612856513a8489a1da9de7e (patch)
treec5a2e24e80ff0202740b0c7f2ef193a334c464d6 /sound/pci/ctxfi
parent89e1b9511fc7fbfac4139fca5531f5f9d946c537 (diff)
ALSA: ctxfi - Simple code clean up
- replace NULL == xxx with !xxx - replace NULL != xxx with xxx - similar trivial cleanups Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi')
-rw-r--r--sound/pci/ctxfi/ctamixer.c20
-rw-r--r--sound/pci/ctxfi/ctatc.c77
-rw-r--r--sound/pci/ctxfi/ctdaio.c30
-rw-r--r--sound/pci/ctxfi/cthw20k1.c22
-rw-r--r--sound/pci/ctxfi/cthw20k2.c18
-rw-r--r--sound/pci/ctxfi/ctmixer.c8
-rw-r--r--sound/pci/ctxfi/ctpcm.c6
-rw-r--r--sound/pci/ctxfi/ctresource.c4
-rw-r--r--sound/pci/ctxfi/ctsrc.c10
-rw-r--r--sound/pci/ctxfi/ctvmem.c6
10 files changed, 100 insertions, 101 deletions
diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c
index a7f4a671f7b7..fee35cfc0c7f 100644
--- a/sound/pci/ctxfi/ctamixer.c
+++ b/sound/pci/ctxfi/ctamixer.c
@@ -63,7 +63,7 @@ static int amixer_set_input(struct amixer *amixer, struct rsc *rsc)
63 hw = amixer->rsc.hw; 63 hw = amixer->rsc.hw;
64 hw->amixer_set_mode(amixer->rsc.ctrl_blk, AMIXER_Y_IMMEDIATE); 64 hw->amixer_set_mode(amixer->rsc.ctrl_blk, AMIXER_Y_IMMEDIATE);
65 amixer->input = rsc; 65 amixer->input = rsc;
66 if (NULL == rsc) 66 if (!rsc)
67 hw->amixer_set_x(amixer->rsc.ctrl_blk, BLANK_SLOT); 67 hw->amixer_set_x(amixer->rsc.ctrl_blk, BLANK_SLOT);
68 else 68 else
69 hw->amixer_set_x(amixer->rsc.ctrl_blk, 69 hw->amixer_set_x(amixer->rsc.ctrl_blk,
@@ -99,7 +99,7 @@ static int amixer_set_sum(struct amixer *amixer, struct sum *sum)
99 99
100 hw = amixer->rsc.hw; 100 hw = amixer->rsc.hw;
101 amixer->sum = sum; 101 amixer->sum = sum;
102 if (NULL == sum) { 102 if (!sum) {
103 hw->amixer_set_se(amixer->rsc.ctrl_blk, 0); 103 hw->amixer_set_se(amixer->rsc.ctrl_blk, 0);
104 } else { 104 } else {
105 hw->amixer_set_se(amixer->rsc.ctrl_blk, 1); 105 hw->amixer_set_se(amixer->rsc.ctrl_blk, 1);
@@ -124,20 +124,20 @@ static int amixer_commit_write(struct amixer *amixer)
124 124
125 /* Program master and conjugate resources */ 125 /* Program master and conjugate resources */
126 amixer->rsc.ops->master(&amixer->rsc); 126 amixer->rsc.ops->master(&amixer->rsc);
127 if (NULL != input) 127 if (input)
128 input->ops->master(input); 128 input->ops->master(input);
129 129
130 if (NULL != sum) 130 if (sum)
131 sum->rsc.ops->master(&sum->rsc); 131 sum->rsc.ops->master(&sum->rsc);
132 132
133 for (i = 0; i < amixer->rsc.msr; i++) { 133 for (i = 0; i < amixer->rsc.msr; i++) {
134 hw->amixer_set_dirty_all(amixer->rsc.ctrl_blk); 134 hw->amixer_set_dirty_all(amixer->rsc.ctrl_blk);
135 if (NULL != input) { 135 if (input) {
136 hw->amixer_set_x(amixer->rsc.ctrl_blk, 136 hw->amixer_set_x(amixer->rsc.ctrl_blk,
137 input->ops->output_slot(input)); 137 input->ops->output_slot(input));
138 input->ops->next_conj(input); 138 input->ops->next_conj(input);
139 } 139 }
140 if (NULL != sum) { 140 if (sum) {
141 hw->amixer_set_sadr(amixer->rsc.ctrl_blk, 141 hw->amixer_set_sadr(amixer->rsc.ctrl_blk,
142 sum->rsc.ops->index(&sum->rsc)); 142 sum->rsc.ops->index(&sum->rsc));
143 sum->rsc.ops->next_conj(&sum->rsc); 143 sum->rsc.ops->next_conj(&sum->rsc);
@@ -147,10 +147,10 @@ static int amixer_commit_write(struct amixer *amixer)
147 amixer->rsc.ops->next_conj(&amixer->rsc); 147 amixer->rsc.ops->next_conj(&amixer->rsc);
148 } 148 }
149 amixer->rsc.ops->master(&amixer->rsc); 149 amixer->rsc.ops->master(&amixer->rsc);
150 if (NULL != input) 150 if (input)
151 input->ops->master(input); 151 input->ops->master(input);
152 152
153 if (NULL != sum) 153 if (sum)
154 sum->rsc.ops->master(&sum->rsc); 154 sum->rsc.ops->master(&sum->rsc);
155 155
156 return 0; 156 return 0;
@@ -303,7 +303,7 @@ int amixer_mgr_create(void *hw, struct amixer_mgr **ramixer_mgr)
303 303
304 *ramixer_mgr = NULL; 304 *ramixer_mgr = NULL;
305 amixer_mgr = kzalloc(sizeof(*amixer_mgr), GFP_KERNEL); 305 amixer_mgr = kzalloc(sizeof(*amixer_mgr), GFP_KERNEL);
306 if (NULL == amixer_mgr) 306 if (!amixer_mgr)
307 return -ENOMEM; 307 return -ENOMEM;
308 308
309 err = rsc_mgr_init(&amixer_mgr->mgr, AMIXER, AMIXER_RESOURCE_NUM, hw); 309 err = rsc_mgr_init(&amixer_mgr->mgr, AMIXER, AMIXER_RESOURCE_NUM, hw);
@@ -456,7 +456,7 @@ int sum_mgr_create(void *hw, struct sum_mgr **rsum_mgr)
456 456
457 *rsum_mgr = NULL; 457 *rsum_mgr = NULL;
458 sum_mgr = kzalloc(sizeof(*sum_mgr), GFP_KERNEL); 458 sum_mgr = kzalloc(sizeof(*sum_mgr), GFP_KERNEL);
459 if (NULL == sum_mgr) 459 if (!sum_mgr)
460 return -ENOMEM; 460 return -ENOMEM;
461 461
462 err = rsc_mgr_init(&sum_mgr->mgr, SUM, SUM_RESOURCE_NUM, hw); 462 err = rsc_mgr_init(&sum_mgr->mgr, SUM, SUM_RESOURCE_NUM, hw);
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index a49c76647307..b1b3a644f738 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -136,7 +136,7 @@ static int ct_map_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm)
136 struct snd_pcm_runtime *runtime; 136 struct snd_pcm_runtime *runtime;
137 struct ct_vm *vm; 137 struct ct_vm *vm;
138 138
139 if (NULL == apcm->substream) 139 if (!apcm->substream)
140 return 0; 140 return 0;
141 141
142 runtime = apcm->substream->runtime; 142 runtime = apcm->substream->runtime;
@@ -144,7 +144,7 @@ static int ct_map_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm)
144 144
145 apcm->vm_block = vm->map(vm, apcm->substream, runtime->dma_bytes); 145 apcm->vm_block = vm->map(vm, apcm->substream, runtime->dma_bytes);
146 146
147 if (NULL == apcm->vm_block) 147 if (!apcm->vm_block)
148 return -ENOENT; 148 return -ENOENT;
149 149
150 return 0; 150 return 0;
@@ -154,7 +154,7 @@ static void ct_unmap_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm)
154{ 154{
155 struct ct_vm *vm; 155 struct ct_vm *vm;
156 156
157 if (NULL == apcm->vm_block) 157 if (!apcm->vm_block)
158 return; 158 return;
159 159
160 vm = atc->vm; 160 vm = atc->vm;
@@ -231,16 +231,16 @@ atc_get_pitch(unsigned int input_rate, unsigned int output_rate)
231 231
232static int select_rom(unsigned int pitch) 232static int select_rom(unsigned int pitch)
233{ 233{
234 if ((pitch > 0x00428f5c) && (pitch < 0x01b851ec)) { 234 if (pitch > 0x00428f5c && pitch < 0x01b851ec) {
235 /* 0.26 <= pitch <= 1.72 */ 235 /* 0.26 <= pitch <= 1.72 */
236 return 1; 236 return 1;
237 } else if ((0x01d66666 == pitch) || (0x01d66667 == pitch)) { 237 } else if (pitch == 0x01d66666 || pitch == 0x01d66667) {
238 /* pitch == 1.8375 */ 238 /* pitch == 1.8375 */
239 return 2; 239 return 2;
240 } else if (0x02000000 == pitch) { 240 } else if (pitch == 0x02000000) {
241 /* pitch == 2 */ 241 /* pitch == 2 */
242 return 3; 242 return 3;
243 } else if ((pitch >= 0x0) && (pitch <= 0x08000000)) { 243 } else if (pitch >= 0x0 && pitch <= 0x08000000) {
244 /* 0 <= pitch <= 8 */ 244 /* 0 <= pitch <= 8 */
245 return 0; 245 return 0;
246 } else { 246 } else {
@@ -283,7 +283,7 @@ static int atc_pcm_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm)
283 /* Get AMIXER resource */ 283 /* Get AMIXER resource */
284 n_amixer = (n_amixer < 2) ? 2 : n_amixer; 284 n_amixer = (n_amixer < 2) ? 2 : n_amixer;
285 apcm->amixers = kzalloc(sizeof(void *)*n_amixer, GFP_KERNEL); 285 apcm->amixers = kzalloc(sizeof(void *)*n_amixer, GFP_KERNEL);
286 if (NULL == apcm->amixers) { 286 if (!apcm->amixers) {
287 err = -ENOMEM; 287 err = -ENOMEM;
288 goto error1; 288 goto error1;
289 } 289 }
@@ -311,7 +311,7 @@ static int atc_pcm_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm)
311 INIT_VOL, atc->pcm[i+device*2]); 311 INIT_VOL, atc->pcm[i+device*2]);
312 mutex_unlock(&atc->atc_mutex); 312 mutex_unlock(&atc->atc_mutex);
313 src = src->ops->next_interleave(src); 313 src = src->ops->next_interleave(src);
314 if (NULL == src) 314 if (!src)
315 src = apcm->src; 315 src = apcm->src;
316 } 316 }
317 317
@@ -334,7 +334,7 @@ atc_pcm_release_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm)
334 struct srcimp *srcimp; 334 struct srcimp *srcimp;
335 int i; 335 int i;
336 336
337 if (NULL != apcm->srcimps) { 337 if (apcm->srcimps) {
338 for (i = 0; i < apcm->n_srcimp; i++) { 338 for (i = 0; i < apcm->n_srcimp; i++) {
339 srcimp = apcm->srcimps[i]; 339 srcimp = apcm->srcimps[i];
340 srcimp->ops->unmap(srcimp); 340 srcimp->ops->unmap(srcimp);
@@ -345,7 +345,7 @@ atc_pcm_release_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm)
345 apcm->srcimps = NULL; 345 apcm->srcimps = NULL;
346 } 346 }
347 347
348 if (NULL != apcm->srccs) { 348 if (apcm->srccs) {
349 for (i = 0; i < apcm->n_srcc; i++) { 349 for (i = 0; i < apcm->n_srcc; i++) {
350 src_mgr->put_src(src_mgr, apcm->srccs[i]); 350 src_mgr->put_src(src_mgr, apcm->srccs[i]);
351 apcm->srccs[i] = NULL; 351 apcm->srccs[i] = NULL;
@@ -354,7 +354,7 @@ atc_pcm_release_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm)
354 apcm->srccs = NULL; 354 apcm->srccs = NULL;
355 } 355 }
356 356
357 if (NULL != apcm->amixers) { 357 if (apcm->amixers) {
358 for (i = 0; i < apcm->n_amixer; i++) { 358 for (i = 0; i < apcm->n_amixer; i++) {
359 amixer_mgr->put_amixer(amixer_mgr, apcm->amixers[i]); 359 amixer_mgr->put_amixer(amixer_mgr, apcm->amixers[i]);
360 apcm->amixers[i] = NULL; 360 apcm->amixers[i] = NULL;
@@ -363,17 +363,17 @@ atc_pcm_release_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm)
363 apcm->amixers = NULL; 363 apcm->amixers = NULL;
364 } 364 }
365 365
366 if (NULL != apcm->mono) { 366 if (apcm->mono) {
367 sum_mgr->put_sum(sum_mgr, apcm->mono); 367 sum_mgr->put_sum(sum_mgr, apcm->mono);
368 apcm->mono = NULL; 368 apcm->mono = NULL;
369 } 369 }
370 370
371 if (NULL != apcm->src) { 371 if (apcm->src) {
372 src_mgr->put_src(src_mgr, apcm->src); 372 src_mgr->put_src(src_mgr, apcm->src);
373 apcm->src = NULL; 373 apcm->src = NULL;
374 } 374 }
375 375
376 if (NULL != apcm->vm_block) { 376 if (apcm->vm_block) {
377 /* Undo device virtual mem map */ 377 /* Undo device virtual mem map */
378 ct_unmap_audio_buffer(atc, apcm); 378 ct_unmap_audio_buffer(atc, apcm);
379 apcm->vm_block = NULL; 379 apcm->vm_block = NULL;
@@ -419,7 +419,7 @@ static int atc_pcm_stop(struct ct_atc *atc, struct ct_atc_pcm *apcm)
419 src->ops->set_state(src, SRC_STATE_OFF); 419 src->ops->set_state(src, SRC_STATE_OFF);
420 src->ops->commit_write(src); 420 src->ops->commit_write(src);
421 421
422 if (NULL != apcm->srccs) { 422 if (apcm->srccs) {
423 for (i = 0; i < apcm->n_srcc; i++) { 423 for (i = 0; i < apcm->n_srcc; i++) {
424 src = apcm->srccs[i]; 424 src = apcm->srccs[i];
425 src->ops->set_bm(src, 0); 425 src->ops->set_bm(src, 0);
@@ -544,18 +544,18 @@ atc_pcm_capture_get_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm)
544 544
545 if (n_srcc) { 545 if (n_srcc) {
546 apcm->srccs = kzalloc(sizeof(void *)*n_srcc, GFP_KERNEL); 546 apcm->srccs = kzalloc(sizeof(void *)*n_srcc, GFP_KERNEL);
547 if (NULL == apcm->srccs) 547 if (!apcm->srccs)
548 return -ENOMEM; 548 return -ENOMEM;
549 } 549 }
550 if (n_amixer) { 550 if (n_amixer) {
551 apcm->amixers = kzalloc(sizeof(void *)*n_amixer, GFP_KERNEL); 551 apcm->amixers = kzalloc(sizeof(void *)*n_amixer, GFP_KERNEL);
552 if (NULL == apcm->amixers) { 552 if (!apcm->amixers) {
553 err = -ENOMEM; 553 err = -ENOMEM;
554 goto error1; 554 goto error1;
555 } 555 }
556 } 556 }
557 apcm->srcimps = kzalloc(sizeof(void *)*n_srcimp, GFP_KERNEL); 557 apcm->srcimps = kzalloc(sizeof(void *)*n_srcimp, GFP_KERNEL);
558 if (NULL == apcm->srcimps) { 558 if (!apcm->srcimps) {
559 err = -ENOMEM; 559 err = -ENOMEM;
560 goto error1; 560 goto error1;
561 } 561 }
@@ -818,7 +818,7 @@ static int spdif_passthru_playback_get_resources(struct ct_atc *atc,
818 /* Get AMIXER resource */ 818 /* Get AMIXER resource */
819 n_amixer = (n_amixer < 2) ? 2 : n_amixer; 819 n_amixer = (n_amixer < 2) ? 2 : n_amixer;
820 apcm->amixers = kzalloc(sizeof(void *)*n_amixer, GFP_KERNEL); 820 apcm->amixers = kzalloc(sizeof(void *)*n_amixer, GFP_KERNEL);
821 if (NULL == apcm->amixers) { 821 if (!apcm->amixers) {
822 err = -ENOMEM; 822 err = -ENOMEM;
823 goto error1; 823 goto error1;
824 } 824 }
@@ -919,7 +919,7 @@ spdif_passthru_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm)
919 amixer = apcm->amixers[i]; 919 amixer = apcm->amixers[i];
920 amixer->ops->setup(amixer, &src->rsc, INIT_VOL, NULL); 920 amixer->ops->setup(amixer, &src->rsc, INIT_VOL, NULL);
921 src = src->ops->next_interleave(src); 921 src = src->ops->next_interleave(src);
922 if (NULL == src) 922 if (!src)
923 src = apcm->src; 923 src = apcm->src;
924 } 924 }
925 /* Connect to SPDIFOO */ 925 /* Connect to SPDIFOO */
@@ -1121,7 +1121,7 @@ static int atc_release_resources(struct ct_atc *atc)
1121 struct ct_mixer *mixer = NULL; 1121 struct ct_mixer *mixer = NULL;
1122 1122
1123 /* disconnect internal mixer objects */ 1123 /* disconnect internal mixer objects */
1124 if (NULL != atc->mixer) { 1124 if (atc->mixer) {
1125 mixer = atc->mixer; 1125 mixer = atc->mixer;
1126 mixer->set_input_left(mixer, MIX_LINE_IN, NULL); 1126 mixer->set_input_left(mixer, MIX_LINE_IN, NULL);
1127 mixer->set_input_right(mixer, MIX_LINE_IN, NULL); 1127 mixer->set_input_right(mixer, MIX_LINE_IN, NULL);
@@ -1131,7 +1131,7 @@ static int atc_release_resources(struct ct_atc *atc)
1131 mixer->set_input_right(mixer, MIX_SPDIF_IN, NULL); 1131 mixer->set_input_right(mixer, MIX_SPDIF_IN, NULL);
1132 } 1132 }
1133 1133
1134 if (NULL != atc->daios) { 1134 if (atc->daios) {
1135 daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO]; 1135 daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO];
1136 for (i = 0; i < atc->n_daio; i++) { 1136 for (i = 0; i < atc->n_daio; i++) {
1137 daio = atc->daios[i]; 1137 daio = atc->daios[i];
@@ -1149,7 +1149,7 @@ static int atc_release_resources(struct ct_atc *atc)
1149 atc->daios = NULL; 1149 atc->daios = NULL;
1150 } 1150 }
1151 1151
1152 if (NULL != atc->pcm) { 1152 if (atc->pcm) {
1153 sum_mgr = atc->rsc_mgrs[SUM]; 1153 sum_mgr = atc->rsc_mgrs[SUM];
1154 for (i = 0; i < atc->n_pcm; i++) 1154 for (i = 0; i < atc->n_pcm; i++)
1155 sum_mgr->put_sum(sum_mgr, atc->pcm[i]); 1155 sum_mgr->put_sum(sum_mgr, atc->pcm[i]);
@@ -1158,7 +1158,7 @@ static int atc_release_resources(struct ct_atc *atc)
1158 atc->pcm = NULL; 1158 atc->pcm = NULL;
1159 } 1159 }
1160 1160
1161 if (NULL != atc->srcs) { 1161 if (atc->srcs) {
1162 src_mgr = atc->rsc_mgrs[SRC]; 1162 src_mgr = atc->rsc_mgrs[SRC];
1163 for (i = 0; i < atc->n_src; i++) 1163 for (i = 0; i < atc->n_src; i++)
1164 src_mgr->put_src(src_mgr, atc->srcs[i]); 1164 src_mgr->put_src(src_mgr, atc->srcs[i]);
@@ -1167,7 +1167,7 @@ static int atc_release_resources(struct ct_atc *atc)
1167 atc->srcs = NULL; 1167 atc->srcs = NULL;
1168 } 1168 }
1169 1169
1170 if (NULL != atc->srcimps) { 1170 if (atc->srcimps) {
1171 srcimp_mgr = atc->rsc_mgrs[SRCIMP]; 1171 srcimp_mgr = atc->rsc_mgrs[SRCIMP];
1172 for (i = 0; i < atc->n_srcimp; i++) { 1172 for (i = 0; i < atc->n_srcimp; i++) {
1173 srcimp = atc->srcimps[i]; 1173 srcimp = atc->srcimps[i];
@@ -1185,7 +1185,7 @@ static int ct_atc_destroy(struct ct_atc *atc)
1185{ 1185{
1186 int i = 0; 1186 int i = 0;
1187 1187
1188 if (NULL == atc) 1188 if (!atc)
1189 return 0; 1189 return 0;
1190 1190
1191 if (atc->timer) { 1191 if (atc->timer) {
@@ -1196,21 +1196,20 @@ static int ct_atc_destroy(struct ct_atc *atc)
1196 atc_release_resources(atc); 1196 atc_release_resources(atc);
1197 1197
1198 /* Destroy internal mixer objects */ 1198 /* Destroy internal mixer objects */
1199 if (NULL != atc->mixer) 1199 if (atc->mixer)
1200 ct_mixer_destroy(atc->mixer); 1200 ct_mixer_destroy(atc->mixer);
1201 1201
1202 for (i = 0; i < NUM_RSCTYP; i++) { 1202 for (i = 0; i < NUM_RSCTYP; i++) {
1203 if ((NULL != rsc_mgr_funcs[i].destroy) && 1203 if (rsc_mgr_funcs[i].destroy && atc->rsc_mgrs[i])
1204 (NULL != atc->rsc_mgrs[i]))
1205 rsc_mgr_funcs[i].destroy(atc->rsc_mgrs[i]); 1204 rsc_mgr_funcs[i].destroy(atc->rsc_mgrs[i]);
1206 1205
1207 } 1206 }
1208 1207
1209 if (NULL != atc->hw) 1208 if (atc->hw)
1210 destroy_hw_obj((struct hw *)atc->hw); 1209 destroy_hw_obj((struct hw *)atc->hw);
1211 1210
1212 /* Destroy device virtual memory manager object */ 1211 /* Destroy device virtual memory manager object */
1213 if (NULL != atc->vm) { 1212 if (atc->vm) {
1214 ct_vm_destroy(atc->vm); 1213 ct_vm_destroy(atc->vm);
1215 atc->vm = NULL; 1214 atc->vm = NULL;
1216 } 1215 }
@@ -1275,7 +1274,7 @@ int __devinit ct_atc_create_alsa_devs(struct ct_atc *atc)
1275 alsa_dev_funcs[MIXER].public_name = atc->chip_name; 1274 alsa_dev_funcs[MIXER].public_name = atc->chip_name;
1276 1275
1277 for (i = 0; i < NUM_CTALSADEVS; i++) { 1276 for (i = 0; i < NUM_CTALSADEVS; i++) {
1278 if (NULL == alsa_dev_funcs[i].create) 1277 if (!alsa_dev_funcs[i].create)
1279 continue; 1278 continue;
1280 1279
1281 err = alsa_dev_funcs[i].create(atc, i, 1280 err = alsa_dev_funcs[i].create(atc, i,
@@ -1312,7 +1311,7 @@ static int __devinit atc_create_hw_devs(struct ct_atc *atc)
1312 return err; 1311 return err;
1313 1312
1314 for (i = 0; i < NUM_RSCTYP; i++) { 1313 for (i = 0; i < NUM_RSCTYP; i++) {
1315 if (NULL == rsc_mgr_funcs[i].create) 1314 if (!rsc_mgr_funcs[i].create)
1316 continue; 1315 continue;
1317 1316
1318 err = rsc_mgr_funcs[i].create(atc->hw, &atc->rsc_mgrs[i]); 1317 err = rsc_mgr_funcs[i].create(atc->hw, &atc->rsc_mgrs[i]);
@@ -1339,19 +1338,19 @@ static int atc_get_resources(struct ct_atc *atc)
1339 int err, i; 1338 int err, i;
1340 1339
1341 atc->daios = kzalloc(sizeof(void *)*(DAIONUM), GFP_KERNEL); 1340 atc->daios = kzalloc(sizeof(void *)*(DAIONUM), GFP_KERNEL);
1342 if (NULL == atc->daios) 1341 if (!atc->daios)
1343 return -ENOMEM; 1342 return -ENOMEM;
1344 1343
1345 atc->srcs = kzalloc(sizeof(void *)*(2*2), GFP_KERNEL); 1344 atc->srcs = kzalloc(sizeof(void *)*(2*2), GFP_KERNEL);
1346 if (NULL == atc->srcs) 1345 if (!atc->srcs)
1347 return -ENOMEM; 1346 return -ENOMEM;
1348 1347
1349 atc->srcimps = kzalloc(sizeof(void *)*(2*2), GFP_KERNEL); 1348 atc->srcimps = kzalloc(sizeof(void *)*(2*2), GFP_KERNEL);
1350 if (NULL == atc->srcimps) 1349 if (!atc->srcimps)
1351 return -ENOMEM; 1350 return -ENOMEM;
1352 1351
1353 atc->pcm = kzalloc(sizeof(void *)*(2*4), GFP_KERNEL); 1352 atc->pcm = kzalloc(sizeof(void *)*(2*4), GFP_KERNEL);
1354 if (NULL == atc->pcm) 1353 if (!atc->pcm)
1355 return -ENOMEM; 1354 return -ENOMEM;
1356 1355
1357 daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO]; 1356 daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO];
@@ -1648,7 +1647,7 @@ int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
1648 *ratc = NULL; 1647 *ratc = NULL;
1649 1648
1650 atc = kzalloc(sizeof(*atc), GFP_KERNEL); 1649 atc = kzalloc(sizeof(*atc), GFP_KERNEL);
1651 if (NULL == atc) 1650 if (!atc)
1652 return -ENOMEM; 1651 return -ENOMEM;
1653 1652
1654 /* Set operations */ 1653 /* Set operations */
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c
index deb6cfa73600..af56eb949bde 100644
--- a/sound/pci/ctxfi/ctdaio.c
+++ b/sound/pci/ctxfi/ctdaio.c
@@ -173,7 +173,7 @@ static int dao_set_left_input(struct dao *dao, struct rsc *input)
173 int i; 173 int i;
174 174
175 entry = kzalloc((sizeof(*entry) * daio->rscl.msr), GFP_KERNEL); 175 entry = kzalloc((sizeof(*entry) * daio->rscl.msr), GFP_KERNEL);
176 if (NULL == entry) 176 if (!entry)
177 return -ENOMEM; 177 return -ENOMEM;
178 178
179 /* Program master and conjugate resources */ 179 /* Program master and conjugate resources */
@@ -201,7 +201,7 @@ static int dao_set_right_input(struct dao *dao, struct rsc *input)
201 int i; 201 int i;
202 202
203 entry = kzalloc((sizeof(*entry) * daio->rscr.msr), GFP_KERNEL); 203 entry = kzalloc((sizeof(*entry) * daio->rscr.msr), GFP_KERNEL);
204 if (NULL == entry) 204 if (!entry)
205 return -ENOMEM; 205 return -ENOMEM;
206 206
207 /* Program master and conjugate resources */ 207 /* Program master and conjugate resources */
@@ -228,7 +228,7 @@ static int dao_clear_left_input(struct dao *dao)
228 struct daio *daio = &dao->daio; 228 struct daio *daio = &dao->daio;
229 int i; 229 int i;
230 230
231 if (NULL == dao->imappers[0]) 231 if (!dao->imappers[0])
232 return 0; 232 return 0;
233 233
234 entry = dao->imappers[0]; 234 entry = dao->imappers[0];
@@ -252,7 +252,7 @@ static int dao_clear_right_input(struct dao *dao)
252 struct daio *daio = &dao->daio; 252 struct daio *daio = &dao->daio;
253 int i; 253 int i;
254 254
255 if (NULL == dao->imappers[daio->rscl.msr]) 255 if (!dao->imappers[daio->rscl.msr])
256 return 0; 256 return 0;
257 257
258 entry = dao->imappers[daio->rscl.msr]; 258 entry = dao->imappers[daio->rscl.msr];
@@ -408,7 +408,7 @@ static int dao_rsc_init(struct dao *dao,
408 return err; 408 return err;
409 409
410 dao->imappers = kzalloc(sizeof(void *)*desc->msr*2, GFP_KERNEL); 410 dao->imappers = kzalloc(sizeof(void *)*desc->msr*2, GFP_KERNEL);
411 if (NULL == dao->imappers) { 411 if (!dao->imappers) {
412 err = -ENOMEM; 412 err = -ENOMEM;
413 goto error1; 413 goto error1;
414 } 414 }
@@ -442,11 +442,11 @@ error1:
442 442
443static int dao_rsc_uninit(struct dao *dao) 443static int dao_rsc_uninit(struct dao *dao)
444{ 444{
445 if (NULL != dao->imappers) { 445 if (dao->imappers) {
446 if (NULL != dao->imappers[0]) 446 if (dao->imappers[0])
447 dao_clear_left_input(dao); 447 dao_clear_left_input(dao);
448 448
449 if (NULL != dao->imappers[dao->daio.rscl.msr]) 449 if (dao->imappers[dao->daio.rscl.msr])
450 dao_clear_right_input(dao); 450 dao_clear_right_input(dao);
451 451
452 kfree(dao->imappers); 452 kfree(dao->imappers);
@@ -555,7 +555,7 @@ static int get_daio_rsc(struct daio_mgr *mgr,
555 /* Allocate mem for daio resource */ 555 /* Allocate mem for daio resource */
556 if (desc->type <= DAIO_OUT_MAX) { 556 if (desc->type <= DAIO_OUT_MAX) {
557 dao = kzalloc(sizeof(*dao), GFP_KERNEL); 557 dao = kzalloc(sizeof(*dao), GFP_KERNEL);
558 if (NULL == dao) { 558 if (!dao) {
559 err = -ENOMEM; 559 err = -ENOMEM;
560 goto error; 560 goto error;
561 } 561 }
@@ -566,7 +566,7 @@ static int get_daio_rsc(struct daio_mgr *mgr,
566 *rdaio = &dao->daio; 566 *rdaio = &dao->daio;
567 } else { 567 } else {
568 dai = kzalloc(sizeof(*dai), GFP_KERNEL); 568 dai = kzalloc(sizeof(*dai), GFP_KERNEL);
569 if (NULL == dai) { 569 if (!dai) {
570 err = -ENOMEM; 570 err = -ENOMEM;
571 goto error; 571 goto error;
572 } 572 }
@@ -583,9 +583,9 @@ static int get_daio_rsc(struct daio_mgr *mgr,
583 return 0; 583 return 0;
584 584
585error: 585error:
586 if (NULL != dao) 586 if (dao)
587 kfree(dao); 587 kfree(dao);
588 else if (NULL != dai) 588 else if (dai)
589 kfree(dai); 589 kfree(dai);
590 590
591 spin_lock_irqsave(&mgr->mgr_lock, flags); 591 spin_lock_irqsave(&mgr->mgr_lock, flags);
@@ -663,7 +663,7 @@ static int daio_imap_add(struct daio_mgr *mgr, struct imapper *entry)
663 int err; 663 int err;
664 664
665 spin_lock_irqsave(&mgr->imap_lock, flags); 665 spin_lock_irqsave(&mgr->imap_lock, flags);
666 if ((0 == entry->addr) && (mgr->init_imap_added)) { 666 if (!entry->addr && mgr->init_imap_added) {
667 input_mapper_delete(&mgr->imappers, mgr->init_imap, 667 input_mapper_delete(&mgr->imappers, mgr->init_imap,
668 daio_map_op, mgr); 668 daio_map_op, mgr);
669 mgr->init_imap_added = 0; 669 mgr->init_imap_added = 0;
@@ -707,7 +707,7 @@ int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr)
707 707
708 *rdaio_mgr = NULL; 708 *rdaio_mgr = NULL;
709 daio_mgr = kzalloc(sizeof(*daio_mgr), GFP_KERNEL); 709 daio_mgr = kzalloc(sizeof(*daio_mgr), GFP_KERNEL);
710 if (NULL == daio_mgr) 710 if (!daio_mgr)
711 return -ENOMEM; 711 return -ENOMEM;
712 712
713 err = rsc_mgr_init(&daio_mgr->mgr, DAIO, DAIO_RESOURCE_NUM, hw); 713 err = rsc_mgr_init(&daio_mgr->mgr, DAIO, DAIO_RESOURCE_NUM, hw);
@@ -718,7 +718,7 @@ int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr)
718 spin_lock_init(&daio_mgr->imap_lock); 718 spin_lock_init(&daio_mgr->imap_lock);
719 INIT_LIST_HEAD(&daio_mgr->imappers); 719 INIT_LIST_HEAD(&daio_mgr->imappers);
720 entry = kzalloc(sizeof(*entry), GFP_KERNEL); 720 entry = kzalloc(sizeof(*entry), GFP_KERNEL);
721 if (NULL == entry) { 721 if (!entry) {
722 err = -ENOMEM; 722 err = -ENOMEM;
723 goto error2; 723 goto error2;
724 } 724 }
diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c
index ad3e1d144464..0cf400f879f9 100644
--- a/sound/pci/ctxfi/cthw20k1.c
+++ b/sound/pci/ctxfi/cthw20k1.c
@@ -168,7 +168,7 @@ static int src_get_rsc_ctrl_blk(void **rblk)
168 168
169 *rblk = NULL; 169 *rblk = NULL;
170 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 170 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
171 if (NULL == blk) 171 if (!blk)
172 return -ENOMEM; 172 return -ENOMEM;
173 173
174 *rblk = blk; 174 *rblk = blk;
@@ -494,7 +494,7 @@ static int src_mgr_get_ctrl_blk(void **rblk)
494 494
495 *rblk = NULL; 495 *rblk = NULL;
496 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 496 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
497 if (NULL == blk) 497 if (!blk)
498 return -ENOMEM; 498 return -ENOMEM;
499 499
500 *rblk = blk; 500 *rblk = blk;
@@ -515,7 +515,7 @@ static int srcimp_mgr_get_ctrl_blk(void **rblk)
515 515
516 *rblk = NULL; 516 *rblk = NULL;
517 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 517 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
518 if (NULL == blk) 518 if (!blk)
519 return -ENOMEM; 519 return -ENOMEM;
520 520
521 *rblk = blk; 521 *rblk = blk;
@@ -702,7 +702,7 @@ static int amixer_rsc_get_ctrl_blk(void **rblk)
702 702
703 *rblk = NULL; 703 *rblk = NULL;
704 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 704 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
705 if (NULL == blk) 705 if (!blk)
706 return -ENOMEM; 706 return -ENOMEM;
707 707
708 *rblk = blk; 708 *rblk = blk;
@@ -723,7 +723,7 @@ static int amixer_mgr_get_ctrl_blk(void **rblk)
723 723
724 *rblk = NULL; 724 *rblk = NULL;
725 /*blk = kzalloc(sizeof(*blk), GFP_KERNEL); 725 /*blk = kzalloc(sizeof(*blk), GFP_KERNEL);
726 if (NULL == blk) 726 if (!blk)
727 return -ENOMEM; 727 return -ENOMEM;
728 728
729 *rblk = blk;*/ 729 *rblk = blk;*/
@@ -909,7 +909,7 @@ static int dai_get_ctrl_blk(void **rblk)
909 909
910 *rblk = NULL; 910 *rblk = NULL;
911 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 911 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
912 if (NULL == blk) 912 if (!blk)
913 return -ENOMEM; 913 return -ENOMEM;
914 914
915 *rblk = blk; 915 *rblk = blk;
@@ -958,7 +958,7 @@ static int dao_get_ctrl_blk(void **rblk)
958 958
959 *rblk = NULL; 959 *rblk = NULL;
960 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 960 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
961 if (NULL == blk) 961 if (!blk)
962 return -ENOMEM; 962 return -ENOMEM;
963 963
964 *rblk = blk; 964 *rblk = blk;
@@ -1152,7 +1152,7 @@ static int daio_mgr_get_ctrl_blk(struct hw *hw, void **rblk)
1152 1152
1153 *rblk = NULL; 1153 *rblk = NULL;
1154 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 1154 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
1155 if (NULL == blk) 1155 if (!blk)
1156 return -ENOMEM; 1156 return -ENOMEM;
1157 1157
1158 blk->i2sctl = hw_read_20kx(hw, I2SCTL); 1158 blk->i2sctl = hw_read_20kx(hw, I2SCTL);
@@ -1808,7 +1808,7 @@ static int uaa_to_xfi(struct pci_dev *pci)
1808 /* By default, Hendrix card UAA Bar0 should be using memory... */ 1808 /* By default, Hendrix card UAA Bar0 should be using memory... */
1809 io_base = pci_resource_start(pci, 0); 1809 io_base = pci_resource_start(pci, 0);
1810 mem_base = ioremap(io_base, pci_resource_len(pci, 0)); 1810 mem_base = ioremap(io_base, pci_resource_len(pci, 0));
1811 if (NULL == mem_base) 1811 if (!mem_base)
1812 return -ENOENT; 1812 return -ENOENT;
1813 1813
1814 /* Read current mode from Mode Change Register */ 1814 /* Read current mode from Mode Change Register */
@@ -1977,7 +1977,7 @@ static int hw_card_shutdown(struct hw *hw)
1977 1977
1978 hw->irq = -1; 1978 hw->irq = -1;
1979 1979
1980 if (NULL != ((void *)hw->mem_base)) 1980 if (hw->mem_base)
1981 iounmap((void *)hw->mem_base); 1981 iounmap((void *)hw->mem_base);
1982 1982
1983 hw->mem_base = (unsigned long)NULL; 1983 hw->mem_base = (unsigned long)NULL;
@@ -2274,7 +2274,7 @@ int __devinit create_20k1_hw_obj(struct hw **rhw)
2274 2274
2275 *rhw = NULL; 2275 *rhw = NULL;
2276 hw20k1 = kzalloc(sizeof(*hw20k1), GFP_KERNEL); 2276 hw20k1 = kzalloc(sizeof(*hw20k1), GFP_KERNEL);
2277 if (NULL == hw20k1) 2277 if (!hw20k1)
2278 return -ENOMEM; 2278 return -ENOMEM;
2279 2279
2280 spin_lock_init(&hw20k1->reg_20k1_lock); 2280 spin_lock_init(&hw20k1->reg_20k1_lock);
diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index 0c4db2dcab07..b6b11bfe7574 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -166,7 +166,7 @@ static int src_get_rsc_ctrl_blk(void **rblk)
166 166
167 *rblk = NULL; 167 *rblk = NULL;
168 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 168 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
169 if (NULL == blk) 169 if (!blk)
170 return -ENOMEM; 170 return -ENOMEM;
171 171
172 *rblk = blk; 172 *rblk = blk;
@@ -492,7 +492,7 @@ static int src_mgr_get_ctrl_blk(void **rblk)
492 492
493 *rblk = NULL; 493 *rblk = NULL;
494 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 494 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
495 if (NULL == blk) 495 if (!blk)
496 return -ENOMEM; 496 return -ENOMEM;
497 497
498 *rblk = blk; 498 *rblk = blk;
@@ -513,7 +513,7 @@ static int srcimp_mgr_get_ctrl_blk(void **rblk)
513 513
514 *rblk = NULL; 514 *rblk = NULL;
515 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 515 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
516 if (NULL == blk) 516 if (!blk)
517 return -ENOMEM; 517 return -ENOMEM;
518 518
519 *rblk = blk; 519 *rblk = blk;
@@ -702,7 +702,7 @@ static int amixer_rsc_get_ctrl_blk(void **rblk)
702 702
703 *rblk = NULL; 703 *rblk = NULL;
704 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 704 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
705 if (NULL == blk) 705 if (!blk)
706 return -ENOMEM; 706 return -ENOMEM;
707 707
708 *rblk = blk; 708 *rblk = blk;
@@ -891,7 +891,7 @@ static int dai_get_ctrl_blk(void **rblk)
891 891
892 *rblk = NULL; 892 *rblk = NULL;
893 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 893 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
894 if (NULL == blk) 894 if (!blk)
895 return -ENOMEM; 895 return -ENOMEM;
896 896
897 *rblk = blk; 897 *rblk = blk;
@@ -941,7 +941,7 @@ static int dao_get_ctrl_blk(void **rblk)
941 941
942 *rblk = NULL; 942 *rblk = NULL;
943 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 943 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
944 if (NULL == blk) 944 if (!blk)
945 return -ENOMEM; 945 return -ENOMEM;
946 946
947 *rblk = blk; 947 *rblk = blk;
@@ -1092,7 +1092,7 @@ static int daio_mgr_get_ctrl_blk(struct hw *hw, void **rblk)
1092 1092
1093 *rblk = NULL; 1093 *rblk = NULL;
1094 blk = kzalloc(sizeof(*blk), GFP_KERNEL); 1094 blk = kzalloc(sizeof(*blk), GFP_KERNEL);
1095 if (NULL == blk) 1095 if (!blk)
1096 return -ENOMEM; 1096 return -ENOMEM;
1097 1097
1098 for (i = 0; i < 8; i++) { 1098 for (i = 0; i < 8; i++) {
@@ -1904,7 +1904,7 @@ static int hw_card_start(struct hw *hw)
1904 hw->io_base = pci_resource_start(hw->pci, 2); 1904 hw->io_base = pci_resource_start(hw->pci, 2);
1905 hw->mem_base = (unsigned long)ioremap(hw->io_base, 1905 hw->mem_base = (unsigned long)ioremap(hw->io_base,
1906 pci_resource_len(hw->pci, 2)); 1906 pci_resource_len(hw->pci, 2));
1907 if (NULL == (void *)hw->mem_base) { 1907 if (!hw->mem_base) {
1908 err = -ENOENT; 1908 err = -ENOENT;
1909 goto error2; 1909 goto error2;
1910 } 1910 }
@@ -1962,7 +1962,7 @@ static int hw_card_shutdown(struct hw *hw)
1962 1962
1963 hw->irq = -1; 1963 hw->irq = -1;
1964 1964
1965 if (NULL != ((void *)hw->mem_base)) 1965 if (hw->mem_base)
1966 iounmap((void *)hw->mem_base); 1966 iounmap((void *)hw->mem_base);
1967 1967
1968 hw->mem_base = (unsigned long)NULL; 1968 hw->mem_base = (unsigned long)NULL;
diff --git a/sound/pci/ctxfi/ctmixer.c b/sound/pci/ctxfi/ctmixer.c
index f26d7cd9db9f..15c1e7271ea8 100644
--- a/sound/pci/ctxfi/ctmixer.c
+++ b/sound/pci/ctxfi/ctmixer.c
@@ -654,7 +654,7 @@ ct_mixer_kcontrol_new(struct ct_mixer *mixer, struct snd_kcontrol_new *new)
654 int err; 654 int err;
655 655
656 kctl = snd_ctl_new1(new, mixer->atc); 656 kctl = snd_ctl_new1(new, mixer->atc);
657 if (NULL == kctl) 657 if (!kctl)
658 return -ENOMEM; 658 return -ENOMEM;
659 659
660 if (SNDRV_CTL_ELEM_IFACE_PCM == kctl->id.iface) 660 if (SNDRV_CTL_ELEM_IFACE_PCM == kctl->id.iface)
@@ -837,17 +837,17 @@ static int ct_mixer_get_mem(struct ct_mixer **rmixer)
837 *rmixer = NULL; 837 *rmixer = NULL;
838 /* Allocate mem for mixer obj */ 838 /* Allocate mem for mixer obj */
839 mixer = kzalloc(sizeof(*mixer), GFP_KERNEL); 839 mixer = kzalloc(sizeof(*mixer), GFP_KERNEL);
840 if (NULL == mixer) 840 if (!mixer)
841 return -ENOMEM; 841 return -ENOMEM;
842 842
843 mixer->amixers = kzalloc(sizeof(void *)*(NUM_CT_AMIXERS*CHN_NUM), 843 mixer->amixers = kzalloc(sizeof(void *)*(NUM_CT_AMIXERS*CHN_NUM),
844 GFP_KERNEL); 844 GFP_KERNEL);
845 if (NULL == mixer->amixers) { 845 if (!mixer->amixers) {
846 err = -ENOMEM; 846 err = -ENOMEM;
847 goto error1; 847 goto error1;
848 } 848 }
849 mixer->sums = kzalloc(sizeof(void *)*(NUM_CT_SUMS*CHN_NUM), GFP_KERNEL); 849 mixer->sums = kzalloc(sizeof(void *)*(NUM_CT_SUMS*CHN_NUM), GFP_KERNEL);
850 if (NULL == mixer->sums) { 850 if (!mixer->sums) {
851 err = -ENOMEM; 851 err = -ENOMEM;
852 goto error2; 852 goto error2;
853 } 853 }
diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c
index 60ea23180acb..d0dc227fbdd3 100644
--- a/sound/pci/ctxfi/ctpcm.c
+++ b/sound/pci/ctxfi/ctpcm.c
@@ -97,7 +97,7 @@ static void ct_atc_pcm_interrupt(struct ct_atc_pcm *atc_pcm)
97{ 97{
98 struct ct_atc_pcm *apcm = atc_pcm; 98 struct ct_atc_pcm *apcm = atc_pcm;
99 99
100 if (NULL == apcm->substream) 100 if (!apcm->substream)
101 return; 101 return;
102 102
103 snd_pcm_period_elapsed(apcm->substream); 103 snd_pcm_period_elapsed(apcm->substream);
@@ -123,7 +123,7 @@ static int ct_pcm_playback_open(struct snd_pcm_substream *substream)
123 int err; 123 int err;
124 124
125 apcm = kzalloc(sizeof(*apcm), GFP_KERNEL); 125 apcm = kzalloc(sizeof(*apcm), GFP_KERNEL);
126 if (NULL == apcm) 126 if (!apcm)
127 return -ENOMEM; 127 return -ENOMEM;
128 128
129 apcm->substream = substream; 129 apcm->substream = substream;
@@ -271,7 +271,7 @@ static int ct_pcm_capture_open(struct snd_pcm_substream *substream)
271 int err; 271 int err;
272 272
273 apcm = kzalloc(sizeof(*apcm), GFP_KERNEL); 273 apcm = kzalloc(sizeof(*apcm), GFP_KERNEL);
274 if (NULL == apcm) 274 if (!apcm)
275 return -ENOMEM; 275 return -ENOMEM;
276 276
277 apcm->started = 0; 277 apcm->started = 0;
diff --git a/sound/pci/ctxfi/ctresource.c b/sound/pci/ctxfi/ctresource.c
index 889c495bb7d1..7dfaf67344d4 100644
--- a/sound/pci/ctxfi/ctresource.c
+++ b/sound/pci/ctxfi/ctresource.c
@@ -144,7 +144,7 @@ int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, void *hw)
144 rsc->msr = msr; 144 rsc->msr = msr;
145 rsc->hw = hw; 145 rsc->hw = hw;
146 rsc->ops = &rsc_generic_ops; 146 rsc->ops = &rsc_generic_ops;
147 if (NULL == hw) { 147 if (!hw) {
148 rsc->ctrl_blk = NULL; 148 rsc->ctrl_blk = NULL;
149 return 0; 149 return 0;
150 } 150 }
@@ -216,7 +216,7 @@ int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type,
216 mgr->type = NUM_RSCTYP; 216 mgr->type = NUM_RSCTYP;
217 217
218 mgr->rscs = kzalloc(((amount + 8 - 1) / 8), GFP_KERNEL); 218 mgr->rscs = kzalloc(((amount + 8 - 1) / 8), GFP_KERNEL);
219 if (NULL == mgr->rscs) 219 if (!mgr->rscs)
220 return -ENOMEM; 220 return -ENOMEM;
221 221
222 switch (type) { 222 switch (type) {
diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c
index df43a5cd3938..c749fa720889 100644
--- a/sound/pci/ctxfi/ctsrc.c
+++ b/sound/pci/ctxfi/ctsrc.c
@@ -441,7 +441,7 @@ get_src_rsc(struct src_mgr *mgr, const struct src_desc *desc, struct src **rsrc)
441 else 441 else
442 src = kzalloc(sizeof(*src), GFP_KERNEL); 442 src = kzalloc(sizeof(*src), GFP_KERNEL);
443 443
444 if (NULL == src) { 444 if (!src) {
445 err = -ENOMEM; 445 err = -ENOMEM;
446 goto error1; 446 goto error1;
447 } 447 }
@@ -550,7 +550,7 @@ int src_mgr_create(void *hw, struct src_mgr **rsrc_mgr)
550 550
551 *rsrc_mgr = NULL; 551 *rsrc_mgr = NULL;
552 src_mgr = kzalloc(sizeof(*src_mgr), GFP_KERNEL); 552 src_mgr = kzalloc(sizeof(*src_mgr), GFP_KERNEL);
553 if (NULL == src_mgr) 553 if (!src_mgr)
554 return -ENOMEM; 554 return -ENOMEM;
555 555
556 err = rsc_mgr_init(&src_mgr->mgr, SRC, SRC_RESOURCE_NUM, hw); 556 err = rsc_mgr_init(&src_mgr->mgr, SRC, SRC_RESOURCE_NUM, hw);
@@ -679,7 +679,7 @@ static int srcimp_rsc_init(struct srcimp *srcimp,
679 /* Reserve memory for imapper nodes */ 679 /* Reserve memory for imapper nodes */
680 srcimp->imappers = kzalloc(sizeof(struct imapper)*desc->msr, 680 srcimp->imappers = kzalloc(sizeof(struct imapper)*desc->msr,
681 GFP_KERNEL); 681 GFP_KERNEL);
682 if (NULL == srcimp->imappers) { 682 if (!srcimp->imappers) {
683 err = -ENOMEM; 683 err = -ENOMEM;
684 goto error1; 684 goto error1;
685 } 685 }
@@ -833,7 +833,7 @@ int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrcimp_mgr)
833 833
834 *rsrcimp_mgr = NULL; 834 *rsrcimp_mgr = NULL;
835 srcimp_mgr = kzalloc(sizeof(*srcimp_mgr), GFP_KERNEL); 835 srcimp_mgr = kzalloc(sizeof(*srcimp_mgr), GFP_KERNEL);
836 if (NULL == srcimp_mgr) 836 if (!srcimp_mgr)
837 return -ENOMEM; 837 return -ENOMEM;
838 838
839 err = rsc_mgr_init(&srcimp_mgr->mgr, SRCIMP, SRCIMP_RESOURCE_NUM, hw); 839 err = rsc_mgr_init(&srcimp_mgr->mgr, SRCIMP, SRCIMP_RESOURCE_NUM, hw);
@@ -844,7 +844,7 @@ int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrcimp_mgr)
844 spin_lock_init(&srcimp_mgr->imap_lock); 844 spin_lock_init(&srcimp_mgr->imap_lock);
845 INIT_LIST_HEAD(&srcimp_mgr->imappers); 845 INIT_LIST_HEAD(&srcimp_mgr->imappers);
846 entry = kzalloc(sizeof(*entry), GFP_KERNEL); 846 entry = kzalloc(sizeof(*entry), GFP_KERNEL);
847 if (NULL == entry) { 847 if (!entry) {
848 err = -ENOMEM; 848 err = -ENOMEM;
849 goto error2; 849 goto error2;
850 } 850 }
diff --git a/sound/pci/ctxfi/ctvmem.c b/sound/pci/ctxfi/ctvmem.c
index 67665a7e43c6..6b78752e9503 100644
--- a/sound/pci/ctxfi/ctvmem.c
+++ b/sound/pci/ctxfi/ctvmem.c
@@ -60,7 +60,7 @@ get_vm_block(struct ct_vm *vm, unsigned int size)
60 } 60 }
61 61
62 block = kzalloc(sizeof(*block), GFP_KERNEL); 62 block = kzalloc(sizeof(*block), GFP_KERNEL);
63 if (NULL == block) 63 if (!block)
64 goto out; 64 goto out;
65 65
66 block->addr = entry->addr; 66 block->addr = entry->addr;
@@ -181,7 +181,7 @@ int ct_vm_create(struct ct_vm **rvm)
181 *rvm = NULL; 181 *rvm = NULL;
182 182
183 vm = kzalloc(sizeof(*vm), GFP_KERNEL); 183 vm = kzalloc(sizeof(*vm), GFP_KERNEL);
184 if (NULL == vm) 184 if (!vm)
185 return -ENOMEM; 185 return -ENOMEM;
186 186
187 mutex_init(&vm->lock); 187 mutex_init(&vm->lock);
@@ -189,7 +189,7 @@ int ct_vm_create(struct ct_vm **rvm)
189 /* Allocate page table pages */ 189 /* Allocate page table pages */
190 for (i = 0; i < CT_PTP_NUM; i++) { 190 for (i = 0; i < CT_PTP_NUM; i++) {
191 vm->ptp[i] = kmalloc(PAGE_SIZE, GFP_KERNEL); 191 vm->ptp[i] = kmalloc(PAGE_SIZE, GFP_KERNEL);
192 if (NULL == vm->ptp[i]) 192 if (!vm->ptp[i])
193 break; 193 break;
194 } 194 }
195 if (!i) { 195 if (!i) {