From 7077ad2ee316551b4ba9602838d09b67683e20b6 Mon Sep 17 00:00:00 2001 From: Nishka Dasgupta Date: Mon, 19 Aug 2019 13:28:54 +0530 Subject: [PATCH] i2c: synquacer: Make synquacer_i2c_ops constant Static structure synquacer_i2c_ops, of type i2c_adapter, is only used when it is copied into a field of another structure. It is not itself modified. Hence make it const to protect it from unintended modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta Acked-by: Ard Biesheuvel Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-synquacer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-synquacer.c b/drivers/i2c/busses/i2c-synquacer.c index f724c8e..39762f0 100644 --- a/drivers/i2c/busses/i2c-synquacer.c +++ b/drivers/i2c/busses/i2c-synquacer.c @@ -526,7 +526,7 @@ static const struct i2c_algorithm synquacer_i2c_algo = { .functionality = synquacer_i2c_functionality, }; -static struct i2c_adapter synquacer_i2c_ops = { +static const struct i2c_adapter synquacer_i2c_ops = { .owner = THIS_MODULE, .name = "synquacer_i2c-adapter", .algo = &synquacer_i2c_algo, -- 2.7.4