All of lore.kernel.org
 help / color / mirror / Atom feed
From: Madhavan Srinivasan <maddy@linux.ibm.com>
To: mpe@ellerman.id.au, christophe.leroy@csgroup.eu
Cc: npiggin@gmail.com, naveen@kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	Madhavan Srinivasan <maddy@linux.ibm.com>
Subject: [PATCH 2/6] powerpc/xmon: fix sparse warning "Using plain integer as NULL pointer"
Date: Tue, 22 Apr 2025 18:40:36 +0530	[thread overview]
Message-ID: <20250422131040.374427-3-maddy@linux.ibm.com> (raw)
In-Reply-To: <20250422131040.374427-1-maddy@linux.ibm.com>

Fix passing of argument 0 to NULL to avoid sparse warning

Cleans up sparse warning:
arch/powerpc/xmon/ppc-opc.c:797:15: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:797:18: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:801:15: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:801:18: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:805:14: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:805:17: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:809:16: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:809:19: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:863:15: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:863:18: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:868:15: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:868:18: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:872:15: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:872:18: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:875:15: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:875:18: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:878:15: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:878:18: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:881:14: warning: Using plain integer as NULL pointer
arch/powerpc/xmon/ppc-opc.c:881:17: warning: Using plain integer as NULL pointer

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
 arch/powerpc/xmon/ppc-opc.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/xmon/ppc-opc.c b/arch/powerpc/xmon/ppc-opc.c
index 0774d711453e..b4ca7eb8d765 100644
--- a/arch/powerpc/xmon/ppc-opc.c
+++ b/arch/powerpc/xmon/ppc-opc.c
@@ -794,19 +794,19 @@ const struct powerpc_operand powerpc_operands[] =
 #define PSWM WS + 1
   /* The BO16 field in a BD8 form instruction.  */
 #define BO16 PSWM
-  {  0x1, 10, 0, 0, 0 },
+  {  0x1, 10, NULL, NULL, 0 },
 
   /* IDX bits for quantization in the pair singles instructions.  */
 #define PSQ PSWM + 1
-  {  0x7, 12, 0, 0, 0 },
+  {  0x7, 12, NULL, NULL, 0 },
 
   /* IDX bits for quantization in the pair singles x-type instructions.  */
 #define PSQM PSQ + 1
-  {  0x7, 7, 0, 0, 0 },
+  {  0x7, 7, NULL, NULL, 0 },
 
   /* Smaller D field for quantization in the pair singles instructions.  */
 #define PSD PSQM + 1
-  {  0xfff, 0, 0, 0,  PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
+  {  0xfff, 0, NULL, NULL,  PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED },
 
   /* The L field in an mtmsrd or A form instruction or R or W in an X form.  */
 #define A_L PSD + 1
@@ -860,25 +860,25 @@ const struct powerpc_operand powerpc_operands[] =
   /* Xilinx APU related masks and macros */
 #define FCRT XFL_L + 1
 #define FCRT_MASK (0x1f << 21)
-  { 0x1f, 21, 0, 0, PPC_OPERAND_FCR },
+  { 0x1f, 21, NULL, NULL, PPC_OPERAND_FCR },
 
   /* Xilinx FSL related masks and macros */
 #define FSL FCRT + 1
 #define FSL_MASK (0x1f << 11)
-  { 0x1f, 11, 0, 0, PPC_OPERAND_FSL },
+  { 0x1f, 11, NULL, NULL, PPC_OPERAND_FSL },
 
   /* Xilinx UDI related masks and macros */
 #define URT FSL + 1
-  { 0x1f, 21, 0, 0, PPC_OPERAND_UDI },
+  { 0x1f, 21, NULL, NULL, PPC_OPERAND_UDI },
 
 #define URA URT + 1
-  { 0x1f, 16, 0, 0, PPC_OPERAND_UDI },
+  { 0x1f, 16, NULL, NULL, PPC_OPERAND_UDI },
 
 #define URB URA + 1
-  { 0x1f, 11, 0, 0, PPC_OPERAND_UDI },
+  { 0x1f, 11, NULL, NULL, PPC_OPERAND_UDI },
 
 #define URC URB + 1
-  { 0x1f, 6, 0, 0, PPC_OPERAND_UDI },
+  { 0x1f, 6, NULL, NULL, PPC_OPERAND_UDI },
 
   /* The VLESIMM field in a D form instruction.  */
 #define VLESIMM URC + 1
-- 
2.49.0



  parent reply	other threads:[~2025-04-22 13:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22 13:10 [PATCH 0/6] Fixes for shellcheck/sparse warnings Madhavan Srinivasan
2025-04-22 13:10 ` [PATCH 1/6] powerpc/kvm: Fix sparse warning Madhavan Srinivasan
2025-04-22 13:10 ` Madhavan Srinivasan [this message]
2025-05-02 10:08   ` [PATCH 2/6] powerpc/xmon: fix sparse warning "Using plain integer as NULL pointer" Christophe Leroy
2025-05-18  3:51     ` Madhavan Srinivasan
2025-04-22 13:10 ` [PATCH 3/6] powerpc/perf:make isa207_pmu_format_group struct static Madhavan Srinivasan
2025-05-07 11:52   ` kernel test robot
2025-04-22 13:10 ` [PATCH 4/6] powerpc: fix sparse warnings Madhavan Srinivasan
2025-05-02 10:16   ` Christophe Leroy
2025-05-18  3:54     ` Madhavan Srinivasan
2025-05-07 11:11   ` kernel test robot
2025-04-22 13:10 ` [PATCH 5/6] powerpc/prom_init: Fix shellcheck warnings Madhavan Srinivasan
2025-04-22 13:42   ` Stephen Rothwell
2025-04-22 13:10 ` [PATCH 6/6] powerpc/boot/install.sh: " Madhavan Srinivasan
2025-04-22 13:46   ` Stephen Rothwell
2025-04-23  8:44 ` [PATCH 0/6] Fixes for shellcheck/sparse warnings Venkat Rao Bagalkote

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250422131040.374427-3-maddy@linux.ibm.com \
    --to=maddy@linux.ibm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.