NetBSD Problem Report #50668

From www@NetBSD.org  Sun Jan 17 09:38:26 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.NetBSD.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 1C36A7ABFC
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 17 Jan 2016 09:38:26 +0000 (UTC)
Message-Id: <20160117093825.043637ACC7@mollari.NetBSD.org>
Date: Sun, 17 Jan 2016 09:38:25 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/sys/arch/i386/stand/lib/netif/3c90xb.c:349: broken error checking ?
X-Send-Pr-Version: www-1.0

>Number:         50668
>Category:       port-i386
>Synopsis:       src/sys/arch/i386/stand/lib/netif/3c90xb.c:349: broken error checking ?
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 17 09:40:00 +0000 2016
>Closed-Date:    Sun Jan 17 15:24:38 +0000 2016
>Last-Modified:  Sun Jan 17 15:24:38 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160116
>Organization:
>Environment:
>Description:
[src/sys/arch/i386/stand/lib/netif/3c90xb.c:349]: (style) Checking if unsigned variable 'ether_medium' is less than zero.

        ex_probemedia();
        if (ether_medium < 0)
            return 0;

Maybe better code

        ex_probemedia();
        if (ether_medium == (unsigned int) -1)
            return 0;

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50668 CVS commit: src/sys/arch/i386/stand/lib/netif
Date: Sun, 17 Jan 2016 09:57:18 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Sun Jan 17 14:57:18 UTC 2016

 Modified Files:
 	src/sys/arch/i386/stand/lib/netif: 3c90xb.c etherdrv.h

 Log Message:
 PR/50668: David Binderman: Don't compare unsigned to -1


 To generate a diff of this commit:
 cvs rdiff -u -r1.14 -r1.15 src/sys/arch/i386/stand/lib/netif/3c90xb.c
 cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/lib/netif/etherdrv.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Sun, 17 Jan 2016 15:24:38 +0000
State-Changed-Why:
Christos fixed it, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.