* [PATCH] sgi-xp: xpc_uv: Make structure xpc_arch_ops_uv constant
@ 2019-08-08 8:04 Nishka Dasgupta
0 siblings, 0 replies; only message in thread
From: Nishka Dasgupta @ 2019-08-08 8:04 UTC (permalink / raw)
To: cpw, robinmholt, arnd, gregkh, linux-kernel; +Cc: Nishka Dasgupta
The static xpc_arch_operations structure xpc_arch_ops_uv is only copied
into the structure xpc_arch_ops, after which it is never modified; nor
is it used in any other way. Hence it can be declared as a constant to
prevent unintended modifications of its fields.
Issue found with Coccinelle.
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
drivers/misc/sgi-xp/xpc_uv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
index 0c6de97dd347..89c4b04337d3 100644
--- a/drivers/misc/sgi-xp/xpc_uv.c
+++ b/drivers/misc/sgi-xp/xpc_uv.c
@@ -1678,7 +1678,7 @@ xpc_received_payload_uv(struct xpc_channel *ch, void *payload)
XPC_DEACTIVATE_PARTITION(&xpc_partitions[ch->partid], ret);
}
-static struct xpc_arch_operations xpc_arch_ops_uv = {
+static const struct xpc_arch_operations xpc_arch_ops_uv = {
.setup_partitions = xpc_setup_partitions_uv,
.teardown_partitions = xpc_teardown_partitions_uv,
.process_activate_IRQ_rcvd = xpc_process_activate_IRQ_rcvd_uv,
--
2.19.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-08-08 8:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08 8:04 [PATCH] sgi-xp: xpc_uv: Make structure xpc_arch_ops_uv constant Nishka Dasgupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®