__wdcwait_reset(): if we hare there we have a wdc pointer, so no need to check

if wdc is not NULL here at all (we were doing it after wdc has been
dereferenced anyway).
Coverity ID 2441.
This commit is contained in:
bouyer 2006-03-18 10:59:58 +00:00
parent 216a33af30
commit d3f24ba785

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdc.c,v 1.235 2006/02/20 16:50:37 thorpej Exp $ */
/* $NetBSD: wdc.c,v 1.236 2006/03/18 10:59:58 bouyer Exp $ */
/*
* Copyright (c) 1998, 2001, 2003 Manuel Bouyer. All rights reserved.
@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.235 2006/02/20 16:50:37 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.236 2006/03/18 10:59:58 bouyer Exp $");
#ifndef ATADEBUG
#define ATADEBUG
@ -1010,7 +1010,7 @@ __wdcwait_reset(struct ata_channel *chp, int drv_mask, int poll)
/* wait for BSY to deassert */
for (timeout = 0; timeout < nloop; timeout++) {
if ((drv_mask & 0x01) != 0) {
if (wdc && wdc->select)
if (wdc->select)
wdc->select(chp,0);
bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
0, WDSD_IBM); /* master */
@ -1029,7 +1029,7 @@ __wdcwait_reset(struct ata_channel *chp, int drv_mask, int poll)
#endif
}
if ((drv_mask & 0x02) != 0) {
if (wdc && wdc->select)
if (wdc->select)
wdc->select(chp,1);
bus_space_write_1(wdr->cmd_iot, wdr->cmd_iohs[wd_sdh],
0, WDSD_IBM | 0x10); /* slave */