Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1547138 > unrolled thread
| Started by | Bhumika Goyal <bhumirks@gmail.com> |
|---|---|
| First post | 2016-12-25 09:10 +0100 |
| Last post | 2016-12-26 11:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] drivers: watchdog: pika_wdt: add __ro_after_init to ident Bhumika Goyal <bhumirks@gmail.com> - 2016-12-25 09:10 +0100
Re: [PATCH] drivers: watchdog: pika_wdt: add __ro_after_init to ident Guenter Roeck <linux@roeck-us.net> - 2016-12-26 11:40 +0100
| From | Bhumika Goyal <bhumirks@gmail.com> |
|---|---|
| Date | 2016-12-25 09:10 +0100 |
| Subject | [PATCH] drivers: watchdog: pika_wdt: add __ro_after_init to ident |
| Message-ID | <sSc2t-2bl-3@gated-at.bofh.it> |
The object ident of type watchdog_info structure is not
modified after getting initialized by pikawdt_init. Apart from getting
referenced in init it is also passed as an argument to the function
copy_to_user but this argument is of type const void *. Therefore add
__ro_after_init to its declaration.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/watchdog/pika_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c
index 0cdfee2..e35cf5e 100644
--- a/drivers/watchdog/pika_wdt.c
+++ b/drivers/watchdog/pika_wdt.c
@@ -54,7 +54,7 @@
struct timer_list timer; /* The timer that pings the watchdog */
} pikawdt_private;
-static struct watchdog_info ident = {
+static struct watchdog_info ident __ro_after_init = {
.identity = DRV_NAME,
.options = WDIOF_CARDRESET |
WDIOF_SETTIMEOUT |
--
1.9.1
[toc] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2016-12-26 11:40 +0100 |
| Message-ID | <sSARb-3Co-1@gated-at.bofh.it> |
| In reply to | #1547138 |
On 12/25/2016 12:00 AM, Bhumika Goyal wrote:
> The object ident of type watchdog_info structure is not
> modified after getting initialized by pikawdt_init. Apart from getting
> referenced in init it is also passed as an argument to the function
> copy_to_user but this argument is of type const void *. Therefore add
> __ro_after_init to its declaration.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/pika_wdt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c
> index 0cdfee2..e35cf5e 100644
> --- a/drivers/watchdog/pika_wdt.c
> +++ b/drivers/watchdog/pika_wdt.c
> @@ -54,7 +54,7 @@
> struct timer_list timer; /* The timer that pings the watchdog */
> } pikawdt_private;
>
> -static struct watchdog_info ident = {
> +static struct watchdog_info ident __ro_after_init = {
> .identity = DRV_NAME,
> .options = WDIOF_CARDRESET |
> WDIOF_SETTIMEOUT |
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web