From owner-svn-src-all@freebsd.org Tue Apr 19 19:26:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1735FB14C8F; Tue, 19 Apr 2016 19:26:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDA331053; Tue, 19 Apr 2016 19:26:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id F2A0FB9B7; Tue, 19 Apr 2016 15:26:22 -0400 (EDT) From: John Baldwin To: Marcelo Araujo Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298247 - head/sbin/fdisk_pc98 Date: Tue, 19 Apr 2016 09:16 -0700 Message-ID: <4114217.PtcV9LDMal@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604190446.u3J4kD9G050780@repo.freebsd.org> References: <201604190446.u3J4kD9G050780@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 19 Apr 2016 15:26:23 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 19:26:24 -0000 On Tuesday, April 19, 2016 04:46:13 AM Marcelo Araujo wrote: > Author: araujo > Date: Tue Apr 19 04:46:13 2016 > New Revision: 298247 > URL: https://svnweb.freebsd.org/changeset/base/298247 > > Log: > Remove redundant parenthesis. > > Submitted by: pfg > MFC after: 2 weeks. For this case, it might be better to remove numentries and use nitems() directly in the one place it is used. I would probably even do this as a for-loop: struct part_type *ptr; int counter; for (counter = 0, ptr = part_types; counter < nitems(part_types); counter++, ptr++) { if (ptr->type == (type & 0x7f)) return (ptr->name); } return ("unknown"); If you renamed 'counter' to 'i' you could probably fit it all on one line. -- John Baldwin