Skip to content

Commit 4fac189

Browse files
committed
src/nvidia: nvalloc - constify pioFuncs and memFuncs
Make 'pioFuncs' and 'memFuncs' static const instances and use designated initializers, avoiding build breakage under grsecurity kernels. Signed-off-by: Mathias Krause <minipli@grsecurity.net>
1 parent 3185069 commit 4fac189

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

src/nvidia/arch/nvalloc/unix/src/vbioscall.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -270,22 +270,22 @@ RmInitX86EmuState(OBJGPU *pGpu) {
270270
int i;
271271
struct x86emu_mem_seg *pseg;
272272
X86EMU_intrFuncs *intFuncs;
273-
X86EMU_pioFuncs pioFuncs = {
274-
(&x_inb),
275-
(&x_inw),
276-
(&x_inl),
277-
(&x_outb),
278-
(&x_outw),
279-
(&x_outl)
273+
static const X86EMU_pioFuncs pioFuncs = {
274+
.inb = x_inb,
275+
.inw = x_inw,
276+
.inl = x_inl,
277+
.outb = x_outb,
278+
.outw = x_outw,
279+
.outl = x_outl
280280
};
281281

282-
X86EMU_memFuncs memFuncs = {
283-
(&Mem_rb),
284-
(&Mem_rw),
285-
(&Mem_rl),
286-
(&Mem_wb),
287-
(&Mem_ww),
288-
(&Mem_wl)
282+
static const X86EMU_memFuncs memFuncs = {
283+
.rdb = Mem_rb,
284+
.rdw = Mem_rw,
285+
.rdl = Mem_rl,
286+
.wrb = Mem_wb,
287+
.wrw = Mem_ww,
288+
.wrl = Mem_wl
289289
};
290290

291291
if (!NV_PRIMARY_VGA(NV_GET_NV_STATE(pGpu))) // not the primary GPU

0 commit comments

Comments
 (0)