From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 19 17:45:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A68C516A4CE for ; Thu, 19 Feb 2004 17:45:17 -0800 (PST) Received: from chococat.sd.dreamhost.com (chococat.sd.dreamhost.com [66.33.206.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E52843D31 for ; Thu, 19 Feb 2004 17:45:17 -0800 (PST) (envelope-from tedu@coverity.com) Received: from webmail.coverity.com (localhost [127.0.0.1]) by chococat.sd.dreamhost.com (Postfix) with SMTP id 892E8FA22 for ; Thu, 19 Feb 2004 17:45:17 -0800 (PST) Received: from 66.93.171.98 (SquirrelMail authenticated user tedu@coverity.com) by webmail.coverity.com with HTTP; Thu, 19 Feb 2004 17:45:17 -0800 (PST) Message-ID: <19392.66.93.171.98.1077241517.spork@webmail.coverity.com> Date: Thu, 19 Feb 2004 17:45:17 -0800 (PST) From: "Ted Unangst" To: hackers@freebsd.org User-Agent: DreamHost Webmail MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20040219174517_23596" X-Mailman-Approved-At: Thu, 19 Feb 2004 20:39:19 -0800 Subject: redundant code bugs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 01:45:17 -0000 ------=_20040219174517_23596 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit These are some more bugs from Coverity. Most look like typos. ------=_20040219174517_23596 Content-Type: text/plain; name="report-red" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="report-red" ############################################################ # 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; } ------=_20040219174517_23596--