Skip to content

Commit 636dcd0

Browse files
rikardfalkebornMarc Zyngier
authored andcommitted
KVM: arm64: Constify kvm_io_gic_ops
The only usage of kvm_io_gic_ops is to make a comparison with its address and to pass its address to kvm_iodevice_init() which takes a pointer to const kvm_io_device_ops as input. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 00e228b commit 636dcd0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/arm64/kvm/vgic/vgic-mmio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ static int dispatch_mmio_write(struct kvm_vcpu *vcpu, struct kvm_io_device *dev,
10501050
return 0;
10511051
}
10521052

1053-
struct kvm_io_device_ops kvm_io_gic_ops = {
1053+
const struct kvm_io_device_ops kvm_io_gic_ops = {
10541054
.read = dispatch_mmio_read,
10551055
.write = dispatch_mmio_write,
10561056
};

arch/arm64/kvm/vgic/vgic-mmio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct vgic_register_region {
3434
};
3535
};
3636

37-
extern struct kvm_io_device_ops kvm_io_gic_ops;
37+
extern const struct kvm_io_device_ops kvm_io_gic_ops;
3838

3939
#define VGIC_ACCESS_8bit 1
4040
#define VGIC_ACCESS_32bit 2

0 commit comments

Comments
 (0)