mbox series

[00/12] Miscellaneous Sparse fixes

Message ID 20231011053711.93427-1-bgray@linux.ibm.com (mailing list archive)
Headers show
Series Miscellaneous Sparse fixes | expand

Message

Benjamin Gray Oct. 11, 2023, 5:36 a.m. UTC
There are many Sparse warnings in the kernel, including the powerpc
directory. This series provides fixes for some low-hanging fruit found
when trying to triage the warnings earlier this year. It addresses about
100 warnings (many have the same root cause).

I know there's concerns about making it harder to backport things. In
general, as someone who was not around during the development of these
features, I think that it is useful make the annotations as correct as
possible. But it's no fuss if some/all of the patches are nacked for this
reason. I just figured some of it might be useful instead of continuing to
sit on it indefinitely.

Benjamin Gray (12):
  powerpc/xive: Fix endian conversion size
  powerpc/pseries: Restructure hvc_get_chars() endianness
  powerpc: Explicitly reverse bytes when checking for byte reversal
  powerpc: Use NULL instead of 0 for null pointers
  powerpc: Remove extern from function implementations
  powerpc: Annotate endianness of various variables and functions
  powerpc/kvm: Force cast endianness of KVM shared regs
  powerpc/opal: Annotate out param endianness
  powerpc/uaccess: Cast away __user annotation after verification
  powerpc: Cast away __iomem in low level IO routines
  powerpc/eeh: Remove unnecessary cast
  powerpc/fadump: Annotate endianness cast with __force

 arch/powerpc/include/asm/book3s/64/pgtable.h    |  2 +-
 arch/powerpc/include/asm/imc-pmu.h              | 16 ++++++++--------
 arch/powerpc/include/asm/kvm_ppc.h              |  8 ++++----
 arch/powerpc/include/asm/opal.h                 |  2 +-
 arch/powerpc/include/asm/uaccess.h              |  2 +-
 arch/powerpc/kernel/eeh_driver.c                |  4 ++--
 arch/powerpc/kernel/io.c                        | 12 ++++++------
 arch/powerpc/kernel/iommu.c                     |  8 ++++----
 arch/powerpc/kernel/prom_init.c                 |  2 +-
 arch/powerpc/kernel/setup_64.c                  |  2 +-
 arch/powerpc/kernel/traps.c                     |  4 ++--
 arch/powerpc/kexec/core_64.c                    |  4 ++--
 arch/powerpc/kexec/file_load_64.c               |  6 +++---
 arch/powerpc/kvm/book3s_64_vio.c                |  8 ++++----
 arch/powerpc/kvm/book3s_xive_native.c           |  2 +-
 arch/powerpc/mm/drmem.c                         |  2 +-
 arch/powerpc/net/bpf_jit_comp.c                 |  8 ++++----
 arch/powerpc/perf/hv-24x7.c                     |  2 +-
 arch/powerpc/perf/imc-pmu.c                     | 11 ++++++-----
 arch/powerpc/platforms/4xx/soc.c                |  2 +-
 arch/powerpc/platforms/powermac/feature.c       |  3 ++-
 arch/powerpc/platforms/powernv/opal-fadump.h    |  2 +-
 arch/powerpc/platforms/pseries/hotplug-memory.c |  3 ++-
 arch/powerpc/platforms/pseries/hvconsole.c      |  6 +++---
 arch/powerpc/platforms/pseries/lpar.c           |  8 ++++----
 arch/powerpc/sysdev/mpic.c                      |  2 +-
 arch/powerpc/sysdev/xive/native.c               |  2 +-
 27 files changed, 68 insertions(+), 65 deletions(-)

Comments

Michael Ellerman Oct. 27, 2023, 9:59 a.m. UTC | #1
On Wed, 11 Oct 2023 16:36:59 +1100, Benjamin Gray wrote:
> There are many Sparse warnings in the kernel, including the powerpc
> directory. This series provides fixes for some low-hanging fruit found
> when trying to triage the warnings earlier this year. It addresses about
> 100 warnings (many have the same root cause).
> 
> I know there's concerns about making it harder to backport things. In
> general, as someone who was not around during the development of these
> features, I think that it is useful make the annotations as correct as
> possible. But it's no fuss if some/all of the patches are nacked for this
> reason. I just figured some of it might be useful instead of continuing to
> sit on it indefinitely.
> 
> [...]

Patch 1, and 3-12 applied to powerpc/next.

[01/12] powerpc/xive: Fix endian conversion size
        https://git.kernel.org/powerpc/c/ff7a60ab1e065257a0e467c13b519f4debcd7fcf
[03/12] powerpc: Explicitly reverse bytes when checking for byte reversal
        https://git.kernel.org/powerpc/c/340a60e3725b9a229eaf03a9b3f8538f22f6ac16
[04/12] powerpc: Use NULL instead of 0 for null pointers
        https://git.kernel.org/powerpc/c/ddfb7d9db843fd4fbdff81fb8a8743f865c3dd96
[05/12] powerpc: Remove extern from function implementations
        https://git.kernel.org/powerpc/c/419d5d112c2e1e78beda9c3299f71c35141d8dba
[06/12] powerpc: Annotate endianness of various variables and functions
        https://git.kernel.org/powerpc/c/2b4a6cc9a1a7cf6958c8b11f94e61c8e81b60b88
[07/12] powerpc/kvm: Force cast endianness of KVM shared regs
        https://git.kernel.org/powerpc/c/b7bce570430e42229fb63f775fcbb10f38b83c71
[08/12] powerpc/opal: Annotate out param endianness
        https://git.kernel.org/powerpc/c/8577dd00a6ba335bc359313599d6100522a1931c
[09/12] powerpc/uaccess: Cast away __user annotation after verification
        https://git.kernel.org/powerpc/c/c6519c6df0722e432f330afbc7c00d16d5be5c58
[10/12] powerpc: Cast away __iomem in low level IO routines
        https://git.kernel.org/powerpc/c/2c4ce3e65b1a543123ffcec4b021ad6ebd4e4e4e
[11/12] powerpc/eeh: Remove unnecessary cast
        https://git.kernel.org/powerpc/c/82f635243f209a85d3deb9f64439c3ea84cd4ecb
[12/12] powerpc/fadump: Annotate endianness cast with __force
        https://git.kernel.org/powerpc/c/b574b817cc7bfcc87bbc92b4b19525442401ae5e

cheers