OpenCloudOS-Kernel/drivers/net/ethernet/chelsio/cxgb4
Arnd Bergmann 047a013f8d chelsio: use BUG() instead of BUG_ON(1)
clang warns about possible bugs in a dead code branch after
BUG_ON(1) when CONFIG_PROFILE_ALL_BRANCHES is enabled:

 drivers/net/ethernet/chelsio/cxgb4/sge.c:479:3: error: variable 'buf_size' is used uninitialized whenever 'if'
      condition is false [-Werror,-Wsometimes-uninitialized]
                BUG_ON(1);
                ^~~~~~~~~
 include/asm-generic/bug.h:61:36: note: expanded from macro 'BUG_ON'
 #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                                   ^~~~~~~~~~~~~~~~~~~
 include/linux/compiler.h:48:23: note: expanded from macro 'unlikely'
 #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 drivers/net/ethernet/chelsio/cxgb4/sge.c:482:9: note: uninitialized use occurs here
        return buf_size;
               ^~~~~~~~
 drivers/net/ethernet/chelsio/cxgb4/sge.c:479:3: note: remove the 'if' if its condition is always true
                BUG_ON(1);
                ^
 include/asm-generic/bug.h:61:32: note: expanded from macro 'BUG_ON'
 #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
                               ^
 drivers/net/ethernet/chelsio/cxgb4/sge.c:459:14: note: initialize the variable 'buf_size' to silence this warning
        int buf_size;
                    ^
                     = 0

Use BUG() here to create simpler code that clang understands
correctly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-26 11:42:11 -07:00
..
Makefile cxgb4: fix thermal zone build error 2018-11-15 09:49:07 -08:00
clip_tbl.c cxgb4: clip_tbl: Use struct_size() in kvzalloc() 2019-01-29 10:55:02 -08:00
clip_tbl.h drivers, net, ethernet: convert clip_entry.refcnt from atomic_t to refcount_t 2017-10-22 02:22:38 +01:00
cudbg_common.c cxgb4: update dump collection logic to use compression 2018-01-19 14:56:32 -05:00
cudbg_entity.h cxgb4: collect hardware queue descriptors 2018-09-03 22:10:37 -07:00
cudbg_if.h cxgb4: collect hardware queue descriptors 2018-09-03 22:10:37 -07:00
cudbg_lib.c cxgb4/chtls: Prefix adapter flags with CXGB4 2019-03-04 10:21:32 -08:00
cudbg_lib.h cxgb4: collect hardware queue descriptors 2018-09-03 22:10:37 -07:00
cudbg_lib_common.h cxgb4: use zlib deflate to compress firmware dump 2018-01-19 14:56:32 -05:00
cudbg_zlib.c cxgb4: properly initialize variables 2018-01-24 10:56:59 -05:00
cudbg_zlib.h cxgb4: enable ZLIB_DEFLATE when building cxgb4 2018-01-24 10:56:59 -05:00
cxgb4.h cxgb4/chtls: Prefix adapter flags with CXGB4 2019-03-04 10:21:32 -08:00
cxgb4_cudbg.c cxgb4: collect hardware queue descriptors 2018-09-03 22:10:37 -07:00
cxgb4_cudbg.h cxgb4: collect hardware dump in second kernel 2018-05-14 13:46:05 -04:00
cxgb4_dcb.c cxgb4: Use proper enum in cxgb4_dcb_handle_fw_update 2018-10-02 22:30:26 -07:00
cxgb4_dcb.h cxgb4: Use proper enum in IEEE_FAUX_SYNC 2018-10-02 22:30:52 -07:00
cxgb4_debugfs.c chelsio: use BUG() instead of BUG_ON(1) 2019-03-26 11:42:11 -07:00
cxgb4_debugfs.h cxgb4: remove DEFINE_SIMPLE_DEBUGFS_FILE() 2018-12-15 11:21:22 -08:00
cxgb4_ethtool.c cxgb4/chtls: Prefix adapter flags with CXGB4 2019-03-04 10:21:32 -08:00
cxgb4_fcoe.c cxgb4/chtls: Prefix adapter flags with CXGB4 2019-03-04 10:21:32 -08:00
cxgb4_fcoe.h
cxgb4_filter.c cxgb4/chtls: Prefix adapter flags with CXGB4 2019-03-04 10:21:32 -08:00
cxgb4_filter.h cxgb4: add support to create hash-filters via tc-flower offload 2017-11-01 22:06:03 +09:00
cxgb4_main.c cxgb4/chtls: Prefix adapter flags with CXGB4 2019-03-04 10:21:32 -08:00
cxgb4_ptp.c net: cxgb4: fix various indentation issues 2019-01-10 09:30:49 -05:00
cxgb4_ptp.h cxgb4: time stamping interface for PTP 2017-07-05 09:21:54 +01:00
cxgb4_tc_flower.c drivers: net: use flow action infrastructure 2019-02-06 10:38:25 -08:00
cxgb4_tc_flower.h cxgb4: convert flower table to use rhashtable 2017-11-01 22:06:03 +09:00
cxgb4_tc_u32.c cxgb4: cxgb4_tc_u32: use struct_size() in kvzalloc() 2019-01-29 10:55:25 -08:00
cxgb4_tc_u32.h net: sched: push cls related args into cls_common structure 2017-08-07 09:42:37 -07:00
cxgb4_tc_u32_parse.h
cxgb4_thermal.c cxgb4: Add thermal zone support 2018-10-09 11:16:28 -07:00
cxgb4_uld.c cxgb4/chtls: Prefix adapter flags with CXGB4 2019-03-04 10:21:32 -08:00
cxgb4_uld.h cxgb4: Export sge_host_page_size to ulds 2019-02-15 09:39:39 -07:00
l2t.c cxgb4/l2t: Use struct_size() in kvzalloc() 2019-01-16 21:11:09 -08:00
l2t.h
sched.c cxgb4: sched: use struct_size() in kvzalloc() 2019-02-01 15:12:29 -08:00
sched.h cxgb4: remove the unneeded locks 2018-10-03 09:34:52 -07:00
sge.c chelsio: use BUG() instead of BUG_ON(1) 2019-03-26 11:42:11 -07:00
smt.c cxgb4: smt: use struct_size() in kvzalloc() 2019-02-01 15:12:29 -08:00
smt.h cxgb4: introduce SMT ops to prepare for SMAC rewrite support 2017-10-20 13:06:53 +01:00
srq.c cxgb4/chtls: Prefix adapter flags with CXGB4 2019-03-04 10:21:32 -08:00
srq.h cxgb4: Add support to initialise/read SRQ entries 2018-03-22 11:59:11 -04:00
t4_chip_type.h cxgb4: clean up init_one 2018-05-25 14:59:38 -04:00
t4_hw.c cxgb4/chtls: Prefix adapter flags with CXGB4 2019-03-04 10:21:32 -08:00
t4_hw.h cxgb4/cxgb4vf: Add support for SGE doorbell queue timer 2019-02-14 12:39:35 -05:00
t4_msg.h cxgb4: add tcb flags and tcb rpl struct 2019-02-08 17:02:05 -07:00
t4_pci_id_tbl.h cxgb4: Add new T6 PCI device ids 0x608b 2019-02-06 13:41:48 -08:00
t4_regs.h cxgb4: collect number of free PSTRUCT page pointers 2018-07-24 10:12:21 -07:00
t4_tcb.h cxgb4: add tcb flags and tcb rpl struct 2019-02-08 17:02:05 -07:00
t4_values.h cxgb4/cxgb4vf: Add support for SGE doorbell queue timer 2019-02-14 12:39:35 -05:00
t4fw_api.h cxgb4: Add VF Link state support 2019-03-01 23:20:20 -08:00
t4fw_version.h cxgb4: Update 1.22.9.0 as the latest firmware supported. 2019-02-06 13:42:09 -08:00