From owner-svn-src-all@freebsd.org Fri Jun 3 11:18:32 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 295B5B684C5; Fri, 3 Jun 2016 11:18:32 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF4F919E5; Fri, 3 Jun 2016 11:18:31 +0000 (UTC) (envelope-from skra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u53BIVYP077243; Fri, 3 Jun 2016 11:18:31 GMT (envelope-from skra@FreeBSD.org) Received: (from skra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u53BIVqc077242; Fri, 3 Jun 2016 11:18:31 GMT (envelope-from skra@FreeBSD.org) Message-Id: <201606031118.u53BIVqc077242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: skra set sender to skra@FreeBSD.org using -f From: Svatopluk Kraus Date: Fri, 3 Jun 2016 11:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301267 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Fri, 03 Jun 2016 11:18:32 -0000 Author: skra Date: Fri Jun 3 11:18:30 2016 New Revision: 301267 URL: https://svnweb.freebsd.org/changeset/base/301267 Log: Define irq variable only in the block where used. Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Fri Jun 3 11:05:55 2016 (r301266) +++ head/sys/arm/arm/gic.c Fri Jun 3 11:18:30 2016 (r301267) @@ -1109,12 +1109,10 @@ arm_gic_setup_intr(device_t dev, struct { struct arm_gic_softc *sc = device_get_softc(dev); struct gic_irqsrc *gi = (struct gic_irqsrc *)isrc; - u_int irq; enum intr_trigger trig; enum intr_polarity pol; if ((gi->gi_flags & GI_FLAG_MSI) == GI_FLAG_MSI) { - irq = gi->gi_irq; pol = gi->gi_pol; trig = gi->gi_trig; KASSERT(pol == INTR_POLARITY_HIGH, @@ -1122,14 +1120,13 @@ arm_gic_setup_intr(device_t dev, struct KASSERT(trig == INTR_TRIGGER_EDGE, ("%s: MSI interrupts must be edge triggered", __func__)); } else if (data != NULL) { - /* Get config for resource. */ - if (gic_map_intr(dev, data, &irq, &pol, &trig)) - return (EINVAL); + u_int irq; - if (gi->gi_irq != irq) + /* Get config for resource. */ + if (gic_map_intr(dev, data, &irq, &pol, &trig) || + gi->gi_irq != irq) return (EINVAL); } else { - irq = gi->gi_irq; pol = INTR_POLARITY_CONFORM; trig = INTR_TRIGGER_CONFORM; }