From patchwork Mon Dec 26 13:47:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9488639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 729F560860 for ; Mon, 26 Dec 2016 13:51:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68ACE1FF65 for ; Mon, 26 Dec 2016 13:51:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CC401FFB9; Mon, 26 Dec 2016 13:51:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B081F1FF65 for ; Mon, 26 Dec 2016 13:51:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cLVdh-0005ES-IG; Mon, 26 Dec 2016 13:48:33 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cLVdd-0005D3-3d for linux-arm-kernel@lists.infradead.org; Mon, 26 Dec 2016 13:48:30 +0000 Received: by mail-pf0-x242.google.com with SMTP id y68so16984332pfb.1 for ; Mon, 26 Dec 2016 05:48:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=1oG40btm+mHVRaJO4pPLQwAlCmy907XAeXUm/oF9E4A=; b=ROUYI6EvOfbU81/2LnVs+Ji7eiMO9yenVR3iaro0i6GwctfcnzBXT2mTugs/ABNPAw QApiJrrVrMyXjCL+H1JJkLZ4zhM96DaVelNlxR61OFB2J5y2mFwQCaTdBRHnQFSZhbWR GImhUPIgB7Z+2ueCaxVMeVxSQouhfvJC2HHLJlmxn3IbJG7P2akmMyyAIiBPGlVB1gwr xH73eI4TmT0hMLMdxD01cIm4LS/02JGTbRftjK9FvbnoBWQTrrrUXKBfrophz/dcoiXO ThWWzryi5laqKEAjcvjk912kCgItcjP7E7djuObR/iKqe8BC7f+5kUKdPlUZvgpfuxEZ iX9A== 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; bh=1oG40btm+mHVRaJO4pPLQwAlCmy907XAeXUm/oF9E4A=; b=AGSs/OaA/BROMHK/nYUeKCpJ9bPzOtn9MexRg3p7QRNPZok6Bgcvs2N2dO3ZfMUq0N rNiCJsS1VnfzmlNbEHMqy9Y6K51SkM02cEoj8ofBezm4QdAlS46kByTZzj3hflqQQn0D EuEnryUZY1gyHoSz38zUK3KC6K/t3oxALp91YkHqsAOJN7fT34XShY1sdCMet1Kpz1yG 0kbsC7LSYMFvpG+KQALVtdw8lBHNSOh0C62h9rrHXTsgqQA9odQR/1jZb8S32E3ESyXK MF9g+Aq7tu3Zn06M+oZMStRB2k8KMS/k2mvTFi2pxf1YXcb2/EWbVfTNATmKSVscX09I at1A== X-Gm-Message-State: AIkVDXIjM3aQ3UZiAHj2h3XevydRTUk3NBCkcl394LR9XQdGXoHvCnNqbxrmOMGCxCrc8A== X-Received: by 10.99.217.81 with SMTP id e17mr49667390pgj.127.1482760086446; Mon, 26 Dec 2016 05:48:06 -0800 (PST) Received: from gmail.com ([117.196.102.47]) by smtp.gmail.com with ESMTPSA id p25sm82583466pfk.20.2016.12.26.05.47.58 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 26 Dec 2016 05:48:04 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Mon, 26 Dec 2016 19:17:55 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, wim@iguana.be, linux@roeck-us.net, f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, support.opensource@diasemi.com, baruch@tkos.co.il, manabian@gmail.com, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] drivers: watchdog: constify watchdog_info structures Date: Mon, 26 Dec 2016 19:17:49 +0530 Message-Id: <1482760069-8959-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161226_054829_247556_4562D77F X-CRM114-Status: GOOD ( 12.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bhumika Goyal MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Declare watchdog_info structures as const as they are only stored in the info field of watchdog_device structures. This field is of type const struct watchdog_info *, so watchdog_info structures having this property can be declared const too. Done using Coccinelle: @r1 disable optional_qualifier@ identifier i; position p; @@ static struct watchdog_info i@p={...}; @ok@ identifier r1.i; position p; struct watchdog_device obj; @@ obj.info=&i@p; @bad@ position p!={r1.p,ok.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct watchdog_info i; Size details: text data bss dec hex filename 1882 249 0 2131 853 drivers/watchdog/bcm7038_wdt.o 1938 193 0 2131 853 drivers/watchdog/bcm7038_wdt.o 1673 720 8 2401 961 drivers/watchdog/bcm_kona_wdt.o 1729 656 8 2393 959 drivers/watchdog/bcm_kona_wdt.o 2370 760 8 3138 c42 drivers/watchdog/cadence_wdt.o 2434 704 8 3146 c4a drivers/watchdog/cadence_wdt.o 1448 248 0 1696 6a0 drivers/watchdog/da9052_wdt.o 1512 192 0 1704 6a8 drivers/watchdog/da9052_wdt.o 1077 249 0 1326 52e drivers/watchdog/da9055_wdt.o 1141 193 0 1334 536 drivers/watchdog/da9055_wdt.o 1416 544 12 1972 7b4 drivers/watchdog/digicolor_wdt.o 1480 480 12 1972 7b4 drivers/watchdog/digicolor_wdt.o 2653 249 4 2906 b5a drivers/watchdog/imgpdc_wdt.o 2717 193 4 2914 b62 drivers/watchdog/imgpdc_wdt.o 2923 257 4 3184 c70 drivers/watchdog/kempld_wdt.o 2987 201 4 3192 c78 drivers/watchdog/kempld_wdt.o 2469 249 20 2738 ab2 drivers/watchdog/lpc18xx_wdt.o 2533 193 20 2746 aba drivers/watchdog/lpc18xx_wdt.o 1119 249 4 1372 55c drivers/watchdog/rn5t618_wdt.o 1183 193 4 1380 564 drivers/watchdog/rn5t618_wdt.o 1218 528 8 1754 6da drivers/watchdog/softdog.o 1282 464 8 1754 6da drivers/watchdog/softdog.o 2934 249 24 3207 c87 drivers/watchdog/w83627hf_wdt.o 2998 185 24 3207 c87 drivers/watchdog/w83627hf_wdt.o Signed-off-by: Bhumika Goyal --- drivers/watchdog/bcm7038_wdt.c | 2 +- drivers/watchdog/bcm_kona_wdt.c | 2 +- drivers/watchdog/cadence_wdt.c | 2 +- drivers/watchdog/da9052_wdt.c | 2 +- drivers/watchdog/da9055_wdt.c | 2 +- drivers/watchdog/digicolor_wdt.c | 2 +- drivers/watchdog/imgpdc_wdt.c | 2 +- drivers/watchdog/kempld_wdt.c | 2 +- drivers/watchdog/lpc18xx_wdt.c | 2 +- drivers/watchdog/rn5t618_wdt.c | 2 +- drivers/watchdog/sbsa_gwdt.c | 2 +- drivers/watchdog/w83627hf_wdt.c | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/watchdog/bcm7038_wdt.c b/drivers/watchdog/bcm7038_wdt.c index e238df4..37c6a49 100644 --- a/drivers/watchdog/bcm7038_wdt.c +++ b/drivers/watchdog/bcm7038_wdt.c @@ -101,7 +101,7 @@ static unsigned int bcm7038_wdt_get_timeleft(struct watchdog_device *wdog) return time_left / wdt->rate; } -static struct watchdog_info bcm7038_wdt_info = { +static const struct watchdog_info bcm7038_wdt_info = { .identity = "Broadcom BCM7038 Watchdog Timer", .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c index e0c9842..76b0080 100644 --- a/drivers/watchdog/bcm_kona_wdt.c +++ b/drivers/watchdog/bcm_kona_wdt.c @@ -274,7 +274,7 @@ static int bcm_kona_wdt_stop(struct watchdog_device *wdog) .get_timeleft = bcm_kona_wdt_get_timeleft, }; -static struct watchdog_info bcm_kona_wdt_info = { +static const struct watchdog_info bcm_kona_wdt_info = { .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING, .identity = "Broadcom Kona Watchdog Timer", diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c index 98acef7..8d61e8b 100644 --- a/drivers/watchdog/cadence_wdt.c +++ b/drivers/watchdog/cadence_wdt.c @@ -262,7 +262,7 @@ static irqreturn_t cdns_wdt_irq_handler(int irq, void *dev_id) * Info structure used to indicate the features supported by the device * to the upper layers. This is defined in watchdog.h header file. */ -static struct watchdog_info cdns_wdt_info = { +static const struct watchdog_info cdns_wdt_info = { .identity = "cdns_wdt watchdog", .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, diff --git a/drivers/watchdog/da9052_wdt.c b/drivers/watchdog/da9052_wdt.c index 2fc19a3..d86a57e 100644 --- a/drivers/watchdog/da9052_wdt.c +++ b/drivers/watchdog/da9052_wdt.c @@ -140,7 +140,7 @@ static int da9052_wdt_ping(struct watchdog_device *wdt_dev) return ret; } -static struct watchdog_info da9052_wdt_info = { +static const struct watchdog_info da9052_wdt_info = { .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, .identity = "DA9052 Watchdog", }; diff --git a/drivers/watchdog/da9055_wdt.c b/drivers/watchdog/da9055_wdt.c index 8377c43..4f30818 100644 --- a/drivers/watchdog/da9055_wdt.c +++ b/drivers/watchdog/da9055_wdt.c @@ -108,7 +108,7 @@ static int da9055_wdt_stop(struct watchdog_device *wdt_dev) return da9055_wdt_set_timeout(wdt_dev, 0); } -static struct watchdog_info da9055_wdt_info = { +static const struct watchdog_info da9055_wdt_info = { .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, .identity = "DA9055 Watchdog", }; diff --git a/drivers/watchdog/digicolor_wdt.c b/drivers/watchdog/digicolor_wdt.c index 77df772..dfe7294 100644 --- a/drivers/watchdog/digicolor_wdt.c +++ b/drivers/watchdog/digicolor_wdt.c @@ -105,7 +105,7 @@ static unsigned int dc_wdt_get_timeleft(struct watchdog_device *wdog) .restart = dc_wdt_restart, }; -static struct watchdog_info dc_wdt_info = { +static const struct watchdog_info dc_wdt_info = { .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING, .identity = "Conexant Digicolor Watchdog", diff --git a/drivers/watchdog/imgpdc_wdt.c b/drivers/watchdog/imgpdc_wdt.c index 516fbef..6ed39de 100644 --- a/drivers/watchdog/imgpdc_wdt.c +++ b/drivers/watchdog/imgpdc_wdt.c @@ -161,7 +161,7 @@ static int pdc_wdt_restart(struct watchdog_device *wdt_dev, return 0; } -static struct watchdog_info pdc_wdt_info = { +static const struct watchdog_info pdc_wdt_info = { .identity = "IMG PDC Watchdog", .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | diff --git a/drivers/watchdog/kempld_wdt.c b/drivers/watchdog/kempld_wdt.c index 8e302d0..73c46b3 100644 --- a/drivers/watchdog/kempld_wdt.c +++ b/drivers/watchdog/kempld_wdt.c @@ -422,7 +422,7 @@ static int kempld_wdt_probe_stages(struct watchdog_device *wdd) return 0; } -static struct watchdog_info kempld_wdt_info = { +static const struct watchdog_info kempld_wdt_info = { .identity = "KEMPLD Watchdog", .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | diff --git a/drivers/watchdog/lpc18xx_wdt.c b/drivers/watchdog/lpc18xx_wdt.c index fd171e6..3b8bb59 100644 --- a/drivers/watchdog/lpc18xx_wdt.c +++ b/drivers/watchdog/lpc18xx_wdt.c @@ -181,7 +181,7 @@ static int lpc18xx_wdt_restart(struct watchdog_device *wdt_dev, return 0; } -static struct watchdog_info lpc18xx_wdt_info = { +static const struct watchdog_info lpc18xx_wdt_info = { .identity = "NXP LPC18xx Watchdog", .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | diff --git a/drivers/watchdog/rn5t618_wdt.c b/drivers/watchdog/rn5t618_wdt.c index 0805ee2..e60f557 100644 --- a/drivers/watchdog/rn5t618_wdt.c +++ b/drivers/watchdog/rn5t618_wdt.c @@ -130,7 +130,7 @@ static int rn5t618_wdt_ping(struct watchdog_device *wdt_dev) RN5T618_PWRIRQ_IR_WDOG, 0); } -static struct watchdog_info rn5t618_wdt_info = { +static const struct watchdog_info rn5t618_wdt_info = { .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING, .identity = DRIVER_NAME, diff --git a/drivers/watchdog/sbsa_gwdt.c b/drivers/watchdog/sbsa_gwdt.c index ce0c38b..e9966bc 100644 --- a/drivers/watchdog/sbsa_gwdt.c +++ b/drivers/watchdog/sbsa_gwdt.c @@ -207,7 +207,7 @@ static irqreturn_t sbsa_gwdt_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static struct watchdog_info sbsa_gwdt_info = { +static const struct watchdog_info sbsa_gwdt_info = { .identity = WATCHDOG_NAME, .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c index ef2ecaf..98fd186 100644 --- a/drivers/watchdog/w83627hf_wdt.c +++ b/drivers/watchdog/w83627hf_wdt.c @@ -297,7 +297,7 @@ static unsigned int wdt_get_time(struct watchdog_device *wdog) * Kernel Interfaces */ -static struct watchdog_info wdt_info = { +static const struct watchdog_info wdt_info = { .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, .identity = "W83627HF Watchdog", };