acrn-kernel/arch/powerpc
Nathan Chancellor 6cf07810e9 powerpc/papr_scm: Ensure rc is always initialized in papr_scm_pmu_register()
Clang warns:

  arch/powerpc/platforms/pseries/papr_scm.c:492:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
          if (!p->stat_buffer_len)
              ^~~~~~~~~~~~~~~~~~~
  arch/powerpc/platforms/pseries/papr_scm.c:523:64: note: uninitialized use occurs here
          dev_info(&p->pdev->dev, "nvdimm pmu didn't register rc=%d\n", rc);
                                                                        ^~
  include/linux/dev_printk.h:150:67: note: expanded from macro 'dev_info'
          dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
                                                                          ^~~~~~~~~~~
  include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
                  _p_func(dev, fmt, ##__VA_ARGS__);                       \
                                      ^~~~~~~~~~~
  arch/powerpc/platforms/pseries/papr_scm.c:492:2: note: remove the 'if' if its condition is always false
          if (!p->stat_buffer_len)
          ^~~~~~~~~~~~~~~~~~~~~~~~
  arch/powerpc/platforms/pseries/papr_scm.c:484:8: note: initialize the variable 'rc' to silence this warning
          int rc, nodeid;
                ^
                = 0
  1 warning generated.

The call to papr_scm_pmu_check_events() was eliminated but a return code
was not added to the if statement. Add the same return code from
papr_scm_pmu_check_events() for this condition so there is no more
warning.

Fixes: 9b1ac04698 ("powerpc/papr_scm: Fix nvdimm event mappings")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://github.com/ClangBuiltLinux/linux/issues/1701
Link: https://lore.kernel.org/r/20220830151256.1473169-1-nathan@kernel.org
2022-09-02 18:55:11 +10:00
..
boot powerpc/85xx: P2020: Add law_trgt_if property to PCIe DT nodes 2022-07-28 16:22:14 +10:00
configs
crypto powerpc: Fix all occurences of duplicate words 2022-07-25 12:05:15 +10:00
include Revert "powerpc/irq: Don't open code irq_soft_mask helpers" 2022-09-02 18:54:53 +10:00
kernel powerpc/rtas: Fix RTAS MSR[HV] handling for Cell 2022-08-26 08:41:54 +10:00
kexec powerpc/kexec: Fix build failure from uninitialised variable 2022-08-10 15:55:20 +10:00
kvm KVM: Rename mmu_notifier_* to mmu_invalidate_* 2022-08-19 04:05:41 -04:00
lib powerpc/ppc-opcode: Define and use PPC_RAW_SETB() 2022-07-27 21:36:05 +10:00
math-emu
mm cxl for 6.0 2022-08-10 11:07:26 -07:00
net powerpc/bpf/32: Add instructions for atomic_[cmp]xchg 2022-06-29 19:37:08 +10:00
perf powerpc/perf: Include caps feature for power10 DD1 version 2022-08-01 22:21:18 +10:00
platforms powerpc/papr_scm: Ensure rc is always initialized in papr_scm_pmu_register() 2022-09-02 18:55:11 +10:00
purgatory powerpc/purgatory: Omit use of bin2c 2022-07-27 21:36:03 +10:00
sysdev powerpc/xive: Fix refcount leak in xive_get_max_prio 2022-08-01 22:21:18 +10:00
tools
xmon powerpc/ppc-opcode: Define and use PPC_RAW_TRAP() and PPC_RAW_TW() 2022-07-27 21:36:05 +10:00
Kbuild
Kconfig powerpc updates for 6.0 2022-08-06 16:38:17 -07:00
Kconfig.debug powerpc: Kconfig.debug: Remove extra empty line 2022-06-29 19:43:16 +10:00
Makefile powerpc/64e: Fix build failure with GCC 12 (unrecognized opcode: `wrteei') 2022-07-27 21:36:06 +10:00
Makefile.postlink