redundant code bugs
Ted Unangst
tedu at coverity.com
Thu Feb 19 17:45:17 PST 2004
These are some more bugs from Coverity. Most look like typos.
-------------- next part --------------
############################################################
# New errors.
#
---------------------------------------------------------
[UNINSPECTED]
X [BUG]
X [FALSE]
X [UNKNOWN]
X [BROKE]
X [SKIP]
/home/tedu/sys/cam/cam_xpt.c|1885|xptdevicematch|ERROR|NOP| 1885|1885|Operation 'patterns == 0 || patterns == 0' is a redundant short-circuit or.
/*
* If there are no match entries, then this device matches no
* matter what.
*/
Error --->
if ((patterns == NULL) || (patterns == 0))
return(DM_RET_DESCEND | DM_RET_COPY);
for (i = 0; i < num_patterns; i++) {
struct device_match_pattern *cur_pattern;
---------------------------------------------------------
[UNINSPECTED]
X [BUG]
X [FALSE]
X [UNKNOWN]
X [BROKE]
X [SKIP]
/home/tedu/sys/dev/asr/asr.c|3428|asr_intr|ERROR|NOP| 3428|3428|Operation 'ReplyOffset = (*(*sc).ha_Virt).FromFIFO == -1 && ReplyOffset = (*(*sc).ha_Virt).FromFIFO == -1' is a redundant short-circuit and.
processed = 1) {
union asr_ccb * ccb;
U32 ReplyOffset;
PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME Reply;
Error --->
if (((ReplyOffset = sc->ha_Virt->FromFIFO) == EMPTY_QUEUE)
&& ((ReplyOffset = sc->ha_Virt->FromFIFO) == EMPTY_QUEUE)) {
break;
}
Reply = (PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME)(ReplyOffset
- sc->ha_Msgs_Phys + (char *)(sc->ha_Msgs));
---------------------------------------------------------
[UNINSPECTED]
X [BUG]
X [FALSE]
X [UNKNOWN]
X [BROKE]
X [SKIP]
/home/tedu/sys/netsmb/smb_trantcp.c|611|smb_nbst_connect|ERROR|NOP| 611|611|Operation '(ts2).tv_sec == 0 && (ts2).tv_sec == 0' is a redundant short-circuit and.
error = nb_connect_in(nbp, &sin, td);
if (error)
return error;
getnanotime(&ts2);
timespecsub(&ts2, &ts1);
Error --->
if (ts2.tv_sec == 0 && ts2.tv_sec == 0)
ts2.tv_sec = 1;
nbp->nbp_timo = ts2;
timespecadd(&nbp->nbp_timo, &ts2);
timespecadd(&nbp->nbp_timo, &ts2);
timespecadd(&nbp->nbp_timo, &ts2); /* * 4 */
---------------------------------------------------------
[UNINSPECTED]
X [BUG]
X [FALSE]
X [UNKNOWN]
X [BROKE]
X [SKIP]
/home/tedu/sys/contrib/ngatm/netnatm/sig/sig_call.c|3862|uni_sig_call|ERROR|NOP| 3862|3862|Operation '(*c).cstate == 11 || (*c).cstate == 11' is a redundant short-circuit or.
/* Q.2971:Call-Control-U 13/39 (U6) */
/* Q.2971:Call-Control-U 17/39 (U9) */
unx_alerting_request(c, msg, cookie, CALLST_U7);
break;
}
Error --->
if (c->cstate == CALLST_N1 || c->cstate == CALLST_N1) {
/* Q.2971:Call-Control-N 38/39 (N1) */
/* Q.2971:Call-Control-N 7/39 (N3) */
unx_alerting_request(c, msg, cookie, CALLST_N4);
break;
}
More information about the freebsd-hackers
mailing list