From owner-freebsd-bugs@FreeBSD.ORG Wed Mar 20 22:30:00 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3429B3D for ; Wed, 20 Mar 2013 22:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B6BDA8A9 for ; Wed, 20 Mar 2013 22:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r2KMU0Bi003725 for ; Wed, 20 Mar 2013 22:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r2KMU0ct003713; Wed, 20 Mar 2013 22:30:00 GMT (envelope-from gnats) Resent-Date: Wed, 20 Mar 2013 22:30:00 GMT Resent-Message-Id: <201303202230.r2KMU0ct003713@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, hiren panchasara Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 33A7AAF5 for ; Wed, 20 Mar 2013 22:23:07 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 2487D887 for ; Wed, 20 Mar 2013 22:23:07 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r2KMN682001789 for ; Wed, 20 Mar 2013 22:23:06 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r2KMN69R001788; Wed, 20 Mar 2013 22:23:06 GMT (envelope-from nobody) Message-Id: <201303202223.r2KMN69R001788@red.freebsd.org> Date: Wed, 20 Mar 2013 22:23:06 GMT From: hiren panchasara To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/177163: [patch] Fixing clang warnings at /sys/dev/mps X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2013 22:30:00 -0000 >Number: 177163 >Category: kern >Synopsis: [patch] Fixing clang warnings at /sys/dev/mps >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 20 22:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: hiren panchasara >Release: current >Organization: >Environment: 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r248555: Wed Mar 20 15:00:20 UTC 2013 >Description: ===> mps (all) /usr/src/sys/modules/mps/../../dev/mps/mps_mapping.c:337:6: warning: variable 'start_idx_ir' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (sc->ir_firmware) ^~~~~~~~~~~~~~~ /usr/src/sys/modules/mps/../../dev/mps/mps_mapping.c:339:19: note: uninitialized use occurs here if (start_idx == start_idx_ir) ^~~~~~~~~~~~ /usr/src/sys/modules/mps/../../dev/mps/mps_mapping.c:337:2: note: remove the 'if' if its condition is always true if (sc->ir_firmware) ^~~~~~~~~~~~~~~~~~~~ /usr/src/sys/modules/mps/../../dev/mps/mps_mapping.c:329:38: note: initialize the variable 'start_idx_ir' to silence this warning u32 start_idx, end_idx, start_idx_ir, end_idx_ir; ^ = 0 1 warning generated. >How-To-Repeat: cd /sys/modules/mps and do "make" to see clang warnings. >Fix: Index: sys/dev/mps/mps_mapping.c =================================================================== --- sys/dev/mps/mps_mapping.c (revision 248555) +++ sys/dev/mps/mps_mapping.c (working copy) @@ -331,6 +331,7 @@ u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags); start_idx = 0; + start_idx_ir = 0; end_idx = sc->max_devices; if (ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_RESERVED_TARGETID_0) start_idx = 1; >Release-Note: >Audit-Trail: >Unformatted: