Skip to content

Commit b574b81

Browse files
BenjaminGrayNp1mpe
authored andcommitted
powerpc/fadump: Annotate endianness cast with __force
Sparse reports an endianness error with the else case of val = (cpu_endian ? be64_to_cpu(reg_entry->reg_val) : (u64)(reg_entry->reg_val)); This is a safe operation because the code is explicitly working with dynamic endianness, so add the __force annotation to tell Sparse to ignore it. Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20231011053711.93427-13-bgray@linux.ibm.com
1 parent 82f6352 commit b574b81

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/powerpc/platforms/powernv/opal-fadump.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static inline void opal_fadump_read_regs(char *bufp, unsigned int regs_cnt,
135135
for (i = 0; i < regs_cnt; i++, bufp += reg_entry_size) {
136136
reg_entry = (struct hdat_fadump_reg_entry *)bufp;
137137
val = (cpu_endian ? be64_to_cpu(reg_entry->reg_val) :
138-
(u64)(reg_entry->reg_val));
138+
(u64 __force)(reg_entry->reg_val));
139139
opal_fadump_set_regval_regnum(regs,
140140
be32_to_cpu(reg_entry->reg_type),
141141
be32_to_cpu(reg_entry->reg_num),

0 commit comments

Comments
 (0)