Bug 177163 - [patch] Fixing clang warnings at /sys/dev/mps
Summary: [patch] Fixing clang warnings at /sys/dev/mps
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-20 22:30 UTC by Hiren Panchasara
Modified: 2017-12-31 22:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hiren Panchasara 2013-03-20 22:30:00 UTC
===> 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.

Fix: 

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;--kwnZkcL8ssAWLWuPYo5kRhtWyef0F6hLgZqhXHMmrfNtiZsb
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

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);
How-To-Repeat: cd /sys/modules/mps and do "make" to see clang warnings.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2013-03-21 04:53:52 UTC
Responsible Changed
From-To: freebsd-bugs->eadler

I'll take it.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2013-07-19 19:57:56 UTC
Responsible Changed
From-To: eadler->hiren

I don't have time to deal with this bug in the near future
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:34 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped