NetBSD Problem Report #51189

From www@NetBSD.org  Mon May 30 06:27:46 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 DD5A17A46A
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 30 May 2016 06:27:45 +0000 (UTC)
Message-Id: <20160530062745.16CCE7AB41@mollari.NetBSD.org>
Date: Mon, 30 May 2016 06:27:45 +0000 (UTC)
From: dcb314@hotmail.com
Reply-To: dcb314@hotmail.com
To: gnats-bugs@NetBSD.org
Subject: src/sys/kern/subr_optstr.c: 2 * Redundant condition:
X-Send-Pr-Version: www-1.0

>Number:         51189
>Category:       kern
>Synopsis:       src/sys/kern/subr_optstr.c: 2 * Redundant condition:
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 30 06:30:00 +0000 2016
>Closed-Date:    Mon May 30 11:25:45 +0000 2016
>Last-Modified:  Mon May 30 11:25:45 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160529
>Organization:
>Environment:
>Description:
src/sys/kern/subr_optstr.c:54]: (style) Redundant condition: If 'EXPR == ' '', the comparison 'EXPR != 0' is always true.

Source code is

    while (*optstr == ' ' && *optstr != '\0')

Suggest new code

     while (*optstr == ' ')

src/sys/kern/subr_optstr.c:76]: (style) Redundant condition: If 'EXPR == ' '', the comparison 'EXPR != 0' is always true.

Source code is

        while (*optstr == ' ' && *optstr != '\0')




>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51189 CVS commit: src/sys/kern
Date: Mon, 30 May 2016 11:24:40 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon May 30 11:24:40 UTC 2016

 Modified Files:
 	src/sys/kern: subr_optstr.c

 Log Message:
 David Binderman in PR kern/51189: simplify loop conditions


 To generate a diff of this commit:
 cvs rdiff -u -r1.5 -r1.6 src/sys/kern/subr_optstr.c

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

Responsible-Changed-From-To: kern-bug-people->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Mon, 30 May 2016 11:25:45 +0000
Responsible-Changed-Why:
Take


State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Mon, 30 May 2016 11:25:45 +0000
State-Changed-Why:
Fixed as suggested, 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.