Skip to content

Commit

Permalink
nouveau/svm: Replace one-element array with flexible-array member in …
Browse files Browse the repository at this point in the history
…struct nouveau_svm

One-element and zero-length arrays are deprecated. So, replace
one-element array in struct nouveau_svm with flexible-array member.

This results in no differences in binary output.

Link: KSPP#338
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
  • Loading branch information
GustavoARSilva authored and intel-lab-lkp committed Aug 16, 2023
1 parent 2520508 commit 4721736
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/nouveau/nouveau_svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ struct nouveau_svm {
struct nouveau_svmm *svmm;
} **fault;
int fault_nr;
} buffer[1];
} buffer[];
};

#define FAULT_ACCESS_READ 0
Expand Down Expand Up @@ -1063,7 +1063,7 @@ nouveau_svm_init(struct nouveau_drm *drm)
if (drm->client.device.info.family > NV_DEVICE_INFO_V0_PASCAL)
return;

if (!(drm->svm = svm = kzalloc(sizeof(*drm->svm), GFP_KERNEL)))
if (!(drm->svm = svm = kzalloc(struct_size(drm->svm, buffer, 1), GFP_KERNEL)))
return;

drm->svm->drm = drm;
Expand Down

0 comments on commit 4721736

Please sign in to comment.