Skip to content

Commit 5f5f294

Browse files
GustavoARSilvageertu
authored andcommitted
m68k: Use sizeof_field() helper
Make use of the sizeof_field() helper instead of an open-coded version. Signed-off-by: Gustavo A. R. Silva <[email protected]> Link: https://lore.kernel.org/r/20200527133942.GA10408@embeddedor Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 40b13fd commit 5f5f294

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

arch/m68k/kernel/signal.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,25 @@
6161
#define FMT4SIZE 0
6262
#else
6363
#define FORMAT 0
64-
#define FMT4SIZE sizeof(((struct frame *)0)->un.fmt4)
64+
#define FMT4SIZE sizeof_field(struct frame, un.fmt4)
6565
#endif
6666

6767
static const int frame_size_change[16] = {
68-
[1] = -1, /* sizeof(((struct frame *)0)->un.fmt1), */
69-
[2] = sizeof(((struct frame *)0)->un.fmt2),
70-
[3] = sizeof(((struct frame *)0)->un.fmt3),
68+
[1] = -1, /* sizeof_field(struct frame, un.fmt1), */
69+
[2] = sizeof_field(struct frame, un.fmt2),
70+
[3] = sizeof_field(struct frame, un.fmt3),
7171
[4] = FMT4SIZE,
72-
[5] = -1, /* sizeof(((struct frame *)0)->un.fmt5), */
73-
[6] = -1, /* sizeof(((struct frame *)0)->un.fmt6), */
74-
[7] = sizeof(((struct frame *)0)->un.fmt7),
75-
[8] = -1, /* sizeof(((struct frame *)0)->un.fmt8), */
76-
[9] = sizeof(((struct frame *)0)->un.fmt9),
77-
[10] = sizeof(((struct frame *)0)->un.fmta),
78-
[11] = sizeof(((struct frame *)0)->un.fmtb),
79-
[12] = -1, /* sizeof(((struct frame *)0)->un.fmtc), */
80-
[13] = -1, /* sizeof(((struct frame *)0)->un.fmtd), */
81-
[14] = -1, /* sizeof(((struct frame *)0)->un.fmte), */
82-
[15] = -1, /* sizeof(((struct frame *)0)->un.fmtf), */
72+
[5] = -1, /* sizeof_field(struct frame, un.fmt5), */
73+
[6] = -1, /* sizeof_field(struct frame, un.fmt6), */
74+
[7] = sizeof_field(struct frame, un.fmt7),
75+
[8] = -1, /* sizeof_field(struct frame, un.fmt8), */
76+
[9] = sizeof_field(struct frame, un.fmt9),
77+
[10] = sizeof_field(struct frame, un.fmta),
78+
[11] = sizeof_field(struct frame, un.fmtb),
79+
[12] = -1, /* sizeof_field(struct frame, un.fmtc), */
80+
[13] = -1, /* sizeof_field(struct frame, un.fmtd), */
81+
[14] = -1, /* sizeof_field(struct frame, un.fmte), */
82+
[15] = -1, /* sizeof_field(struct frame, un.fmtf), */
8383
};
8484

8585
static inline int frame_extra_sizes(int f)
@@ -651,7 +651,7 @@ static int mangle_kernel_stack(struct pt_regs *regs, int formatvec,
651651
} else {
652652
struct switch_stack *sw = (struct switch_stack *)regs - 1;
653653
/* yes, twice as much as max(sizeof(frame.un.fmt<x>)) */
654-
unsigned long buf[sizeof(((struct frame *)0)->un) / 2];
654+
unsigned long buf[sizeof_field(struct frame, un) / 2];
655655

656656
/* that'll make sure that expansion won't crap over data */
657657
if (copy_from_user(buf + fsize / 4, fp, fsize))

0 commit comments

Comments
 (0)