From owner-svn-src-all@FreeBSD.ORG Wed Jan 14 23:19:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BB4F1065670 for ; Wed, 14 Jan 2009 23:19:06 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 0E4918FC1E for ; Wed, 14 Jan 2009 23:19:06 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 3A9B08FC4F for ; Thu, 15 Jan 2009 02:08:02 +0300 (MSK) Received: from orion.SpringDaemons.com (drsun1.dialup.corbina.ru [85.21.245.235]) by mx0.deglitch.com (Postfix) with ESMTPA id 7F0718FC18; Thu, 15 Jan 2009 02:08:00 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 0433A398F3; Thu, 15 Jan 2009 02:08:01 +0300 (MSK) Date: Thu, 15 Jan 2009 02:07:52 +0300 From: Stanislav Sedov To: Oleksandr Tymoshenko Message-Id: <20090115020752.52566769.stas@FreeBSD.org> In-Reply-To: <200901142232.n0EMWhGw055895@svn.freebsd.org> References: <200901142232.n0EMWhGw055895@svn.freebsd.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Thu Jan 15 02:08:01 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 496e7051967003867013891 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r187251 - head/sys/mips/malta X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 14 Jan 2009 23:19:06 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, 14 Jan 2009 22:32:43 +0000 (UTC) Oleksandr Tymoshenko mentioned: > Author: gonzo > Date: Wed Jan 14 22:32:43 2009 > New Revision: 187251 > URL: http://svn.freebsd.org/changeset/base/187251 > > Log: > o Simplify code: trade 15 lines of case for one multiplication > > Modified: > head/sys/mips/malta/gt_pci.c > > Modified: head/sys/mips/malta/gt_pci.c > ============================================================================== > --- head/sys/mips/malta/gt_pci.c Wed Jan 14 22:11:01 2009 (r187250) > +++ head/sys/mips/malta/gt_pci.c Wed Jan 14 22:32:43 2009 (r187251) > @@ -457,21 +457,7 @@ gt_pci_write_config(device_t dev, int bu > * Should we set the mode explicitly during chip > * Initialization? > */ > - switch(reg % 4) > - { > - case 3: > - shift = 24; > - break; > - case 2: > - shift = 16; > - break; > - case 1: > - shift = 8; > - break; > - default: > - shift = 0; > - break; > - } > + shift = 8 * (reg & 3); > Would it make sense to replace this with > + shift = (reg & 3) << 3; to not rely on possible compiler optimizations? - -- Stanislav Sedov ST4096-RIPE -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAklucFAACgkQK/VZk+smlYHvawCdFWtJKfuX3xBOkQ66BURedB8I hy0AmgMGQKaqzVS3gIUeOFOLwYB67L93 =BTIx -----END PGP SIGNATURE----- !DSPAM:496e7051967003867013891!