Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ia64: do not typedef struct pal_min_state_area_s

Documentation/process/coding-style.rst says:

Please don't use things like ``vps_t``.
It's a **mistake** to use typedef for structures and pointers.

This commit converts as follows:

struct pal_min_state_area_s -> struct pal_min_state_area
pal_min_state_area_t -> struct pal_min_state_area

My main motivation for this is to slim down the include directives
of <asm/mca.h> in the next commit.

Currently, <asm/mca.h> is required to include <asm/pal.h> directly
or indirectly due to (pal_min_state_area_t *). Otherwise, it would
have no idea what pal_min_state_area_t is.

Replacing it with (struct pal_min_state_area *) will relax the header
dependency since it is enough to tell it is a pointer to a structure,
and to resolve the size of struct pal_min_state_area. It will make
<asm/mca.h> independent of <asm/pal.h>.

<asm/pal.h> typedef's a lot of structures, but it is trivial to
convert the others in the same way.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>

+16 -16
+1 -1
arch/ia64/include/asm/mca.h
··· 83 83 /* common */ 84 84 unsigned long sal_ra; /* Return address in SAL, physical */ 85 85 unsigned long sal_gp; /* GP of the SAL - physical */ 86 - pal_min_state_area_t *pal_min_state; /* from R17. physical in asm, virtual in C */ 86 + struct pal_min_state_area *pal_min_state; /* from R17. physical in asm, virtual in C */ 87 87 /* Previous values of IA64_KR(CURRENT) and IA64_KR(CURRENT_STACK). 88 88 * Note: if the MCA/INIT recovery code wants to resume to a new context 89 89 * then it must change these values to reflect the new kernel stack.
+2 -2
arch/ia64/include/asm/pal.h
··· 750 750 * for PAL. 751 751 */ 752 752 753 - typedef struct pal_min_state_area_s { 753 + struct pal_min_state_area { 754 754 u64 pmsa_nat_bits; /* nat bits for saved GRs */ 755 755 u64 pmsa_gr[15]; /* GR1 - GR15 */ 756 756 u64 pmsa_bank0_gr[16]; /* GR16 - GR31 */ ··· 766 766 u64 pmsa_xfs; /* previous ifs */ 767 767 u64 pmsa_br1; /* branch register 1 */ 768 768 u64 pmsa_reserved[70]; /* pal_min_state_area should total to 1KB */ 769 - } pal_min_state_area_t; 769 + }; 770 770 771 771 772 772 struct ia64_pal_retval {
+1 -1
arch/ia64/include/asm/sal.h
··· 385 385 fr : 1, 386 386 reserved : 58; 387 387 } valid; 388 - pal_min_state_area_t min_state_area; 388 + struct pal_min_state_area min_state_area; 389 389 u64 br[8]; 390 390 u64 cr[128]; 391 391 u64 ar[128];
+9 -9
arch/ia64/kernel/asm-offsets.c
··· 245 245 BLANK(); 246 246 247 247 DEFINE(IA64_PMSA_GR_OFFSET, 248 - offsetof (struct pal_min_state_area_s, pmsa_gr)); 248 + offsetof(struct pal_min_state_area, pmsa_gr)); 249 249 DEFINE(IA64_PMSA_BANK1_GR_OFFSET, 250 - offsetof (struct pal_min_state_area_s, pmsa_bank1_gr)); 250 + offsetof(struct pal_min_state_area, pmsa_bank1_gr)); 251 251 DEFINE(IA64_PMSA_PR_OFFSET, 252 - offsetof (struct pal_min_state_area_s, pmsa_pr)); 252 + offsetof(struct pal_min_state_area, pmsa_pr)); 253 253 DEFINE(IA64_PMSA_BR0_OFFSET, 254 - offsetof (struct pal_min_state_area_s, pmsa_br0)); 254 + offsetof(struct pal_min_state_area, pmsa_br0)); 255 255 DEFINE(IA64_PMSA_RSC_OFFSET, 256 - offsetof (struct pal_min_state_area_s, pmsa_rsc)); 256 + offsetof(struct pal_min_state_area, pmsa_rsc)); 257 257 DEFINE(IA64_PMSA_IIP_OFFSET, 258 - offsetof (struct pal_min_state_area_s, pmsa_iip)); 258 + offsetof(struct pal_min_state_area, pmsa_iip)); 259 259 DEFINE(IA64_PMSA_IPSR_OFFSET, 260 - offsetof (struct pal_min_state_area_s, pmsa_ipsr)); 260 + offsetof(struct pal_min_state_area, pmsa_ipsr)); 261 261 DEFINE(IA64_PMSA_IFS_OFFSET, 262 - offsetof (struct pal_min_state_area_s, pmsa_ifs)); 262 + offsetof(struct pal_min_state_area, pmsa_ifs)); 263 263 DEFINE(IA64_PMSA_XIP_OFFSET, 264 - offsetof (struct pal_min_state_area_s, pmsa_xip)); 264 + offsetof(struct pal_min_state_area, pmsa_xip)); 265 265 BLANK(); 266 266 267 267 /* used by fsys_gettimeofday in arch/ia64/kernel/fsys.S */
+2 -2
arch/ia64/kernel/mca.c
··· 894 894 finish_pt_regs(struct pt_regs *regs, struct ia64_sal_os_state *sos, 895 895 unsigned long *nat) 896 896 { 897 - const pal_min_state_area_t *ms = sos->pal_min_state; 897 + const struct pal_min_state_area *ms = sos->pal_min_state; 898 898 const u64 *bank; 899 899 900 900 /* If ipsr.ic then use pmsa_{iip,ipsr,ifs}, else use ··· 970 970 char *p; 971 971 ia64_va va; 972 972 extern char ia64_leave_kernel[]; /* Need asm address, not function descriptor */ 973 - const pal_min_state_area_t *ms = sos->pal_min_state; 973 + const struct pal_min_state_area *ms = sos->pal_min_state; 974 974 struct task_struct *previous_current; 975 975 struct pt_regs *old_regs; 976 976 struct switch_stack *old_sw;
+1 -1
arch/ia64/kernel/mca_drv.c
··· 496 496 struct ia64_sal_os_state *sos) 497 497 { 498 498 u64 target_identifier; 499 - pal_min_state_area_t *pmsa; 499 + struct pal_min_state_area *pmsa; 500 500 struct ia64_psr *psr1, *psr2; 501 501 ia64_fptr_t *mca_hdlr_bh = (ia64_fptr_t*)mca_handler_bhhook; 502 502