Commit 2770ef7c authored by Masahiro Yamada's avatar Masahiro Yamada

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: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarRandy Dunlap <rdunlap@infradead.org>
parent 92bf2261
...@@ -83,7 +83,7 @@ struct ia64_sal_os_state { ...@@ -83,7 +83,7 @@ struct ia64_sal_os_state {
/* common */ /* common */
unsigned long sal_ra; /* Return address in SAL, physical */ unsigned long sal_ra; /* Return address in SAL, physical */
unsigned long sal_gp; /* GP of the SAL - physical */ unsigned long sal_gp; /* GP of the SAL - physical */
pal_min_state_area_t *pal_min_state; /* from R17. physical in asm, virtual in C */ struct pal_min_state_area *pal_min_state; /* from R17. physical in asm, virtual in C */
/* Previous values of IA64_KR(CURRENT) and IA64_KR(CURRENT_STACK). /* Previous values of IA64_KR(CURRENT) and IA64_KR(CURRENT_STACK).
* Note: if the MCA/INIT recovery code wants to resume to a new context * Note: if the MCA/INIT recovery code wants to resume to a new context
* then it must change these values to reflect the new kernel stack. * then it must change these values to reflect the new kernel stack.
......
...@@ -750,7 +750,7 @@ typedef union pal_mc_error_info_u { ...@@ -750,7 +750,7 @@ typedef union pal_mc_error_info_u {
* for PAL. * for PAL.
*/ */
typedef struct pal_min_state_area_s { struct pal_min_state_area {
u64 pmsa_nat_bits; /* nat bits for saved GRs */ u64 pmsa_nat_bits; /* nat bits for saved GRs */
u64 pmsa_gr[15]; /* GR1 - GR15 */ u64 pmsa_gr[15]; /* GR1 - GR15 */
u64 pmsa_bank0_gr[16]; /* GR16 - GR31 */ u64 pmsa_bank0_gr[16]; /* GR16 - GR31 */
...@@ -766,7 +766,7 @@ typedef struct pal_min_state_area_s { ...@@ -766,7 +766,7 @@ typedef struct pal_min_state_area_s {
u64 pmsa_xfs; /* previous ifs */ u64 pmsa_xfs; /* previous ifs */
u64 pmsa_br1; /* branch register 1 */ u64 pmsa_br1; /* branch register 1 */
u64 pmsa_reserved[70]; /* pal_min_state_area should total to 1KB */ u64 pmsa_reserved[70]; /* pal_min_state_area should total to 1KB */
} pal_min_state_area_t; };
struct ia64_pal_retval { struct ia64_pal_retval {
......
...@@ -385,7 +385,7 @@ typedef struct sal_processor_static_info { ...@@ -385,7 +385,7 @@ typedef struct sal_processor_static_info {
fr : 1, fr : 1,
reserved : 58; reserved : 58;
} valid; } valid;
pal_min_state_area_t min_state_area; struct pal_min_state_area min_state_area;
u64 br[8]; u64 br[8];
u64 cr[128]; u64 cr[128];
u64 ar[128]; u64 ar[128];
......
...@@ -245,23 +245,23 @@ void foo(void) ...@@ -245,23 +245,23 @@ void foo(void)
BLANK(); BLANK();
DEFINE(IA64_PMSA_GR_OFFSET, DEFINE(IA64_PMSA_GR_OFFSET,
offsetof (struct pal_min_state_area_s, pmsa_gr)); offsetof(struct pal_min_state_area, pmsa_gr));
DEFINE(IA64_PMSA_BANK1_GR_OFFSET, DEFINE(IA64_PMSA_BANK1_GR_OFFSET,
offsetof (struct pal_min_state_area_s, pmsa_bank1_gr)); offsetof(struct pal_min_state_area, pmsa_bank1_gr));
DEFINE(IA64_PMSA_PR_OFFSET, DEFINE(IA64_PMSA_PR_OFFSET,
offsetof (struct pal_min_state_area_s, pmsa_pr)); offsetof(struct pal_min_state_area, pmsa_pr));
DEFINE(IA64_PMSA_BR0_OFFSET, DEFINE(IA64_PMSA_BR0_OFFSET,
offsetof (struct pal_min_state_area_s, pmsa_br0)); offsetof(struct pal_min_state_area, pmsa_br0));
DEFINE(IA64_PMSA_RSC_OFFSET, DEFINE(IA64_PMSA_RSC_OFFSET,
offsetof (struct pal_min_state_area_s, pmsa_rsc)); offsetof(struct pal_min_state_area, pmsa_rsc));
DEFINE(IA64_PMSA_IIP_OFFSET, DEFINE(IA64_PMSA_IIP_OFFSET,
offsetof (struct pal_min_state_area_s, pmsa_iip)); offsetof(struct pal_min_state_area, pmsa_iip));
DEFINE(IA64_PMSA_IPSR_OFFSET, DEFINE(IA64_PMSA_IPSR_OFFSET,
offsetof (struct pal_min_state_area_s, pmsa_ipsr)); offsetof(struct pal_min_state_area, pmsa_ipsr));
DEFINE(IA64_PMSA_IFS_OFFSET, DEFINE(IA64_PMSA_IFS_OFFSET,
offsetof (struct pal_min_state_area_s, pmsa_ifs)); offsetof(struct pal_min_state_area, pmsa_ifs));
DEFINE(IA64_PMSA_XIP_OFFSET, DEFINE(IA64_PMSA_XIP_OFFSET,
offsetof (struct pal_min_state_area_s, pmsa_xip)); offsetof(struct pal_min_state_area, pmsa_xip));
BLANK(); BLANK();
/* used by fsys_gettimeofday in arch/ia64/kernel/fsys.S */ /* used by fsys_gettimeofday in arch/ia64/kernel/fsys.S */
......
...@@ -894,7 +894,7 @@ static void ...@@ -894,7 +894,7 @@ static void
finish_pt_regs(struct pt_regs *regs, struct ia64_sal_os_state *sos, finish_pt_regs(struct pt_regs *regs, struct ia64_sal_os_state *sos,
unsigned long *nat) unsigned long *nat)
{ {
const pal_min_state_area_t *ms = sos->pal_min_state; const struct pal_min_state_area *ms = sos->pal_min_state;
const u64 *bank; const u64 *bank;
/* If ipsr.ic then use pmsa_{iip,ipsr,ifs}, else use /* If ipsr.ic then use pmsa_{iip,ipsr,ifs}, else use
...@@ -970,7 +970,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs, ...@@ -970,7 +970,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs,
char *p; char *p;
ia64_va va; ia64_va va;
extern char ia64_leave_kernel[]; /* Need asm address, not function descriptor */ extern char ia64_leave_kernel[]; /* Need asm address, not function descriptor */
const pal_min_state_area_t *ms = sos->pal_min_state; const struct pal_min_state_area *ms = sos->pal_min_state;
struct task_struct *previous_current; struct task_struct *previous_current;
struct pt_regs *old_regs; struct pt_regs *old_regs;
struct switch_stack *old_sw; struct switch_stack *old_sw;
......
...@@ -496,7 +496,7 @@ recover_from_read_error(slidx_table_t *slidx, ...@@ -496,7 +496,7 @@ recover_from_read_error(slidx_table_t *slidx,
struct ia64_sal_os_state *sos) struct ia64_sal_os_state *sos)
{ {
u64 target_identifier; u64 target_identifier;
pal_min_state_area_t *pmsa; struct pal_min_state_area *pmsa;
struct ia64_psr *psr1, *psr2; struct ia64_psr *psr1, *psr2;
ia64_fptr_t *mca_hdlr_bh = (ia64_fptr_t*)mca_handler_bhhook; ia64_fptr_t *mca_hdlr_bh = (ia64_fptr_t*)mca_handler_bhhook;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment