|
61 | 61 | #define FMT4SIZE 0
|
62 | 62 | #else
|
63 | 63 | #define FORMAT 0
|
64 |
| -#define FMT4SIZE sizeof(((struct frame *)0)->un.fmt4) |
| 64 | +#define FMT4SIZE sizeof_field(struct frame, un.fmt4) |
65 | 65 | #endif
|
66 | 66 |
|
67 | 67 | 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), |
71 | 71 | [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), */ |
83 | 83 | };
|
84 | 84 |
|
85 | 85 | static inline int frame_extra_sizes(int f)
|
@@ -651,7 +651,7 @@ static int mangle_kernel_stack(struct pt_regs *regs, int formatvec,
|
651 | 651 | } else {
|
652 | 652 | struct switch_stack *sw = (struct switch_stack *)regs - 1;
|
653 | 653 | /* 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]; |
655 | 655 |
|
656 | 656 | /* that'll make sure that expansion won't crap over data */
|
657 | 657 | if (copy_from_user(buf + fsize / 4, fp, fsize))
|
|
0 commit comments