Skip to content

Commit 8ded03a

Browse files
nathanlynchmpe
authored andcommitted
powerpc/pseries/papr-sysparm: use u8 arrays for payloads
Some PAPR system parameter values are formatted by firmware as nul-terminated strings (e.g. LPAR name, shared processor attributes). But the values returned for other parameters, such as processor module info and TLB block invalidate characteristics, are binary data with parameter-specific layouts. So char[] isn't the appropriate type for the general case. Use u8/__u8. Signed-off-by: Nathan Lynch <[email protected]> Fixes: 905b9e4 ("powerpc/pseries/papr-sysparm: Expose character device to user space") Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/20240202-papr-sysparm-ioblock-data-use-u8-v1-1-f5c6c89f65ec@linux.ibm.com
1 parent 41bccc9 commit 8ded03a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/powerpc/include/asm/papr-sysparm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ typedef struct {
3232
*/
3333
struct papr_sysparm_buf {
3434
__be16 len;
35-
char val[PAPR_SYSPARM_MAX_OUTPUT];
35+
u8 val[PAPR_SYSPARM_MAX_OUTPUT];
3636
};
3737

3838
struct papr_sysparm_buf *papr_sysparm_buf_alloc(void);

arch/powerpc/include/uapi/asm/papr-sysparm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ enum {
1414
struct papr_sysparm_io_block {
1515
__u32 parameter;
1616
__u16 length;
17-
char data[PAPR_SYSPARM_MAX_OUTPUT];
17+
__u8 data[PAPR_SYSPARM_MAX_OUTPUT];
1818
};
1919

2020
/**

0 commit comments

Comments
 (0)