Skip to content

Commit ba89709

Browse files
author
Paul Walmsley
committed
riscv: signal: fix some warnings reported by sparse
Clean up a few warnings reported by sparse in arch/riscv/kernel/signal.c. These come from code that was added recently; they were missed when I initially reviewed the patch. Fixes: 818d78b ("riscv: signal: abstract header saving for setup_sigcontext") Cc: Andy Chiu <andybnac@gmail.com> Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202601171848.ydLTJYrz-lkp@intel.com/ [pjw@kernel.org: updated to apply] Signed-off-by: Paul Walmsley <pjw@kernel.org>
1 parent 63804fe commit ba89709

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

arch/riscv/kernel/signal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ struct arch_ext_priv {
145145
long (*save)(struct pt_regs *regs, void __user *sc_vec);
146146
};
147147

148-
struct arch_ext_priv arch_ext_list[] = {
148+
static struct arch_ext_priv arch_ext_list[] = {
149149
{
150150
.magic = RISCV_V_MAGIC,
151151
.save = &save_v_state,
152152
},
153153
};
154154

155-
const size_t nr_arch_exts = ARRAY_SIZE(arch_ext_list);
155+
static const size_t nr_arch_exts = ARRAY_SIZE(arch_ext_list);
156156

157157
static long restore_sigcontext(struct pt_regs *regs,
158158
struct sigcontext __user *sc)
@@ -297,7 +297,7 @@ static long setup_sigcontext(struct rt_sigframe __user *frame,
297297
} else {
298298
err |= __put_user(arch_ext->magic, &sc_ext_ptr->magic);
299299
err |= __put_user(ext_size, &sc_ext_ptr->size);
300-
sc_ext_ptr = (void *)sc_ext_ptr + ext_size;
300+
sc_ext_ptr = (void __user *)sc_ext_ptr + ext_size;
301301
}
302302
}
303303
/* Write zero to fp-reserved space and check it on restore_sigcontext */

0 commit comments

Comments
 (0)