linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: krzk@kernel.org (Krzysztof Kozlowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/7] watchdog: s3c2410: Constify local structures
Date: Fri, 24 Feb 2017 23:07:44 +0200	[thread overview]
Message-ID: <20170224210746.12459-5-krzk@kernel.org> (raw)
In-Reply-To: <20170224210746.12459-1-krzk@kernel.org>

Structures watchdog_device, watchdog_ops and s3c2410_wdt_variant are not
modified so they can be made const to increase code safeness.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/watchdog/s3c2410_wdt.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index a031842ffcb0..5eaec319e499 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -131,7 +131,7 @@ struct s3c2410_wdt {
 	unsigned long		wtdat_save;
 	struct watchdog_device	wdt_device;
 	struct notifier_block	freq_transition;
-	struct s3c2410_wdt_variant *drv_data;
+	const struct s3c2410_wdt_variant *drv_data;
 	struct regmap *pmureg;
 };
 
@@ -392,7 +392,7 @@ static const struct watchdog_info s3c2410_wdt_ident = {
 	.identity         =	"S3C2410 Watchdog",
 };
 
-static struct watchdog_ops s3c2410wdt_ops = {
+static const struct watchdog_ops s3c2410wdt_ops = {
 	.owner = THIS_MODULE,
 	.start = s3c2410wdt_start,
 	.stop = s3c2410wdt_stop,
@@ -401,7 +401,7 @@ static struct watchdog_ops s3c2410wdt_ops = {
 	.restart = s3c2410wdt_restart,
 };
 
-static struct watchdog_device s3c2410_wdd = {
+static const struct watchdog_device s3c2410_wdd = {
 	.info = &s3c2410_wdt_ident,
 	.ops = &s3c2410wdt_ops,
 	.timeout = S3C2410_WATCHDOG_DEFAULT_TIME,
@@ -507,15 +507,15 @@ static inline unsigned int s3c2410wdt_get_bootstatus(struct s3c2410_wdt *wdt)
 	return 0;
 }
 
-static inline struct s3c2410_wdt_variant *
+static inline const struct s3c2410_wdt_variant *
 s3c2410_get_wdt_drv_data(struct platform_device *pdev)
 {
 	if (pdev->dev.of_node) {
 		const struct of_device_id *match;
 		match = of_match_node(s3c2410_wdt_match, pdev->dev.of_node);
-		return (struct s3c2410_wdt_variant *)match->data;
+		return (const struct s3c2410_wdt_variant *)match->data;
 	} else {
-		return (struct s3c2410_wdt_variant *)
+		return (const struct s3c2410_wdt_variant *)
 			platform_get_device_id(pdev)->driver_data;
 	}
 }
-- 
2.9.3

  parent reply	other threads:[~2017-02-24 21:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 21:07 [PATCH 1/7] watchdog: s3c2410: Use dev_dbg instead of pr_info Krzysztof Kozlowski
2017-02-24 21:07 ` [PATCH 2/7] watchdog: s3c2410: Select MFD_SYSCON on all Exynos platforms Krzysztof Kozlowski
2017-02-24 21:57   ` Guenter Roeck
2017-02-24 21:07 ` [PATCH 3/7] watchdog: s3c2410: Enable COMPILE_TEST Krzysztof Kozlowski
2017-02-24 21:58   ` Guenter Roeck
2017-02-24 21:07 ` [PATCH 4/7] watchdog: s3c2410: Add prefix to local function Krzysztof Kozlowski
2017-02-24 21:58   ` Guenter Roeck
2017-02-24 21:07 ` Krzysztof Kozlowski [this message]
2017-02-24 22:05   ` [PATCH 5/7] watchdog: s3c2410: Constify local structures Guenter Roeck
2017-02-25  7:42     ` Krzysztof Kozlowski
2017-02-27  4:06       ` Guenter Roeck
2017-02-24 21:07 ` [PATCH 6/7] watchdog: s3c2410: Simplify getting driver data Krzysztof Kozlowski
2017-02-24 21:07 ` [PATCH 7/7] watchdog: s3c2410: Minor code cleanup Krzysztof Kozlowski
2017-02-24 21:56 ` [PATCH 1/7] watchdog: s3c2410: Use dev_dbg instead of pr_info Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170224210746.12459-5-krzk@kernel.org \
    --to=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).