Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1715737

[PATCH 1/4] rtc: ds1672: constify i2c_device_id

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Arvind Yadav <arvind.yadav.cs@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/4] rtc: ds1672: constify i2c_device_id
Date Sat, 19 Aug 2017 21:10:02 +0200
Message-ID <ughia-5br-3@gated-at.bofh.it> (permalink)
References <ughia-5br-5@gated-at.bofh.it>
X-Original-To a.zummo@towertech.it, alexandre.belloni@free-electrons.com
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vfyjAcRN8BD9jmUmLl1dCd10WRFnG/f2MbjZkmQGGzo=; b=GD8IyUvXrTxlYR2mcN7tjmJvcPcWTv8dnzTBs/VBwcsF4KQEOaLU+yuKH7O+BD+zx6 X5/rkldPKomBDSJwQOE8+rAxtFNoulAV4HiM07ov5h6e5up7xkkWpcwPpNfr3+5eLq2R ggT9gxPtxNvZSl5V5QahPKDOqDpfLnwaRINoOdOv7WgLQwvcvaehGpup/12arlcChfcV rVz2ebArh0FgxWW6uwsFntuYzTsNJihFllubWOAHMcs2Cwfv3mX53NRjHD8kt1S8y+7T ekKdYA7uLNV39m6YN40I7N+MJ7aqd3HGpcQdwz2vMo4eJS6iOX413PtcTPBcadNKQJjo wXLQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vfyjAcRN8BD9jmUmLl1dCd10WRFnG/f2MbjZkmQGGzo=; b=MIOOkwCBmcT6phnoWgX/aoL3GZO6mgfAzhpE1ljqvCXXyvCtEtkIis3rFnK6qMPNL4 jrYBO9iFEnRbOCS6h+8rhR+YfE4j7Df3joKDU7qtMdkRkp82SFHy7Zj4pEuNbj/djraT MISwtPNCT3HHl6Sgypww8U+SdfuKApOB1iCHYF8vzhC8sUK3Jnez5Ct7Ralqj3pA3lt8 /lMU9WppfUfpCl3xaqQ4xvLZI/1/jSqFzDmOKBkugPzASgk1ppJ+Qr0EWp1RrMB0GhJn 1cGspQ7/1NbbkLVF7K+8tKbAeyuljRRjhwJQhevodTAKq+xzDVj1b60Ij4A+wU+acx0a n9LA==
X-Gm-Message-State AHYfb5jFxbSemWtHlPPCZIyz0m+Uzdqz8fDqHO63VGcUouaec8ebzmOe jm7bUpzDCRAR+Q==
X-Received by 10.99.117.71 with SMTP id f7mr11811866pgn.245.1503169691568; Sat, 19 Aug 2017 12:08:11 -0700 (PDT)
X-Mailer git-send-email 2.7.4
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 24
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org
X-Original-Date Sun, 20 Aug 2017 00:37:55 +0530
X-Original-Message-ID <1503169678-18078-2-git-send-email-arvind.yadav.cs@gmail.com>
X-Original-References <1503169678-18078-1-git-send-email-arvind.yadav.cs@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1715737

Show key headers only | View raw


i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/rtc/rtc-ds1672.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-ds1672.c b/drivers/rtc/rtc-ds1672.c
index 7bf46bf..9caaccc 100644
--- a/drivers/rtc/rtc-ds1672.c
+++ b/drivers/rtc/rtc-ds1672.c
@@ -190,7 +190,7 @@ static int ds1672_probe(struct i2c_client *client,
 	return 0;
 }
 
-static struct i2c_device_id ds1672_id[] = {
+static const struct i2c_device_id ds1672_id[] = {
 	{ "ds1672", 0 },
 	{ }
 };
-- 
2.7.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 1/4] rtc: ds1672: constify i2c_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 21:10 +0200

csiph-web