* [PATCH] platform/x86: constify rfkill_ops structures
@ 2017-06-08 11:17 Bhumika Goyal
2017-06-08 12:38 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Bhumika Goyal @ 2017-06-08 11:17 UTC (permalink / raw)
To: julia.lawall, pali.rohar, dvhart, andy, ike.pan, corentin.chary,
platform-driver-x86, linux-kernel
Cc: Bhumika Goyal
Add const to rfkill_ops structures that are only passed as an argument
to the functions rfkill_alloc or samsung_new_rfkill. These arguments are
of type const, so such structures can be annotated with const.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/platform/x86/dell-rbtn.c | 2 +-
drivers/platform/x86/ideapad-laptop.c | 2 +-
drivers/platform/x86/samsung-laptop.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/dell-rbtn.c b/drivers/platform/x86/dell-rbtn.c
index dcd9f40..6b5bbaf 100644
--- a/drivers/platform/x86/dell-rbtn.c
+++ b/drivers/platform/x86/dell-rbtn.c
@@ -110,7 +110,7 @@ static int rbtn_rfkill_set_block(void *data, bool blocked)
return -EINVAL;
}
-static struct rfkill_ops rbtn_ops = {
+static const struct rfkill_ops rbtn_ops = {
.query = rbtn_rfkill_query,
.set_block = rbtn_rfkill_set_block,
};
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 24ca9fb..3beec1e 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -478,7 +478,7 @@ static int ideapad_rfk_set(void *data, bool blocked)
return write_ec_cmd(priv->priv->adev->handle, opcode, !blocked);
}
-static struct rfkill_ops ideapad_rfk_ops = {
+static const struct rfkill_ops ideapad_rfk_ops = {
.set_block = ideapad_rfk_set,
};
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
index 8c146e2..e1e8897 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -591,7 +591,7 @@ static int seclinux_rfkill_set(void *data, bool blocked)
!blocked);
}
-static struct rfkill_ops seclinux_rfkill_ops = {
+static const struct rfkill_ops seclinux_rfkill_ops = {
.set_block = seclinux_rfkill_set,
};
@@ -651,7 +651,7 @@ static void swsmi_rfkill_query(struct rfkill *rfkill, void *priv)
rfkill_set_sw_state(rfkill, !ret);
}
-static struct rfkill_ops swsmi_rfkill_ops = {
+static const struct rfkill_ops swsmi_rfkill_ops = {
.set_block = swsmi_rfkill_set,
.query = swsmi_rfkill_query,
};
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: constify rfkill_ops structures
2017-06-08 11:17 [PATCH] platform/x86: constify rfkill_ops structures Bhumika Goyal
@ 2017-06-08 12:38 ` Andy Shevchenko
2017-06-08 12:41 ` Bhumika Goyal
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2017-06-08 12:38 UTC (permalink / raw)
To: Bhumika Goyal
Cc: Julia Lawall, Pali Rohár, dvhart, Andy Shevchenko,
Ike Panhc, Corentin Chary, Platform Driver, linux-kernel
On Thu, Jun 8, 2017 at 2:17 PM, Bhumika Goyal <bhumirks@gmail.com> wrote:
> Add const to rfkill_ops structures that are only passed as an argument
> to the functions rfkill_alloc or samsung_new_rfkill. These arguments are
> of type const, so such structures can be annotated with const.
Change is fine by me, but please split to one patch per vendor.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> drivers/platform/x86/dell-rbtn.c | 2 +-
> drivers/platform/x86/ideapad-laptop.c | 2 +-
> drivers/platform/x86/samsung-laptop.c | 4 ++--
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/dell-rbtn.c b/drivers/platform/x86/dell-rbtn.c
> index dcd9f40..6b5bbaf 100644
> --- a/drivers/platform/x86/dell-rbtn.c
> +++ b/drivers/platform/x86/dell-rbtn.c
> @@ -110,7 +110,7 @@ static int rbtn_rfkill_set_block(void *data, bool blocked)
> return -EINVAL;
> }
>
> -static struct rfkill_ops rbtn_ops = {
> +static const struct rfkill_ops rbtn_ops = {
> .query = rbtn_rfkill_query,
> .set_block = rbtn_rfkill_set_block,
> };
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index 24ca9fb..3beec1e 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -478,7 +478,7 @@ static int ideapad_rfk_set(void *data, bool blocked)
> return write_ec_cmd(priv->priv->adev->handle, opcode, !blocked);
> }
>
> -static struct rfkill_ops ideapad_rfk_ops = {
> +static const struct rfkill_ops ideapad_rfk_ops = {
> .set_block = ideapad_rfk_set,
> };
>
> diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
> index 8c146e2..e1e8897 100644
> --- a/drivers/platform/x86/samsung-laptop.c
> +++ b/drivers/platform/x86/samsung-laptop.c
> @@ -591,7 +591,7 @@ static int seclinux_rfkill_set(void *data, bool blocked)
> !blocked);
> }
>
> -static struct rfkill_ops seclinux_rfkill_ops = {
> +static const struct rfkill_ops seclinux_rfkill_ops = {
> .set_block = seclinux_rfkill_set,
> };
>
> @@ -651,7 +651,7 @@ static void swsmi_rfkill_query(struct rfkill *rfkill, void *priv)
> rfkill_set_sw_state(rfkill, !ret);
> }
>
> -static struct rfkill_ops swsmi_rfkill_ops = {
> +static const struct rfkill_ops swsmi_rfkill_ops = {
> .set_block = swsmi_rfkill_set,
> .query = swsmi_rfkill_query,
> };
> --
> 2.7.4
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: constify rfkill_ops structures
2017-06-08 12:38 ` Andy Shevchenko
@ 2017-06-08 12:41 ` Bhumika Goyal
0 siblings, 0 replies; 3+ messages in thread
From: Bhumika Goyal @ 2017-06-08 12:41 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Julia Lawall, Pali Rohár, dvhart, Andy Shevchenko,
Ike Panhc, Corentin Chary, Platform Driver, linux-kernel
On Thu, Jun 8, 2017 at 6:08 PM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Jun 8, 2017 at 2:17 PM, Bhumika Goyal <bhumirks@gmail.com> wrote:
>> Add const to rfkill_ops structures that are only passed as an argument
>> to the functions rfkill_alloc or samsung_new_rfkill. These arguments are
>> of type const, so such structures can be annotated with const.
>
> Change is fine by me, but please split to one patch per vendor.
>
Okay.
Thanks,
Bhumika
>>
>> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
>> ---
>> drivers/platform/x86/dell-rbtn.c | 2 +-
>> drivers/platform/x86/ideapad-laptop.c | 2 +-
>> drivers/platform/x86/samsung-laptop.c | 4 ++--
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/platform/x86/dell-rbtn.c b/drivers/platform/x86/dell-rbtn.c
>> index dcd9f40..6b5bbaf 100644
>> --- a/drivers/platform/x86/dell-rbtn.c
>> +++ b/drivers/platform/x86/dell-rbtn.c
>> @@ -110,7 +110,7 @@ static int rbtn_rfkill_set_block(void *data, bool blocked)
>> return -EINVAL;
>> }
>>
>> -static struct rfkill_ops rbtn_ops = {
>> +static const struct rfkill_ops rbtn_ops = {
>> .query = rbtn_rfkill_query,
>> .set_block = rbtn_rfkill_set_block,
>> };
>> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
>> index 24ca9fb..3beec1e 100644
>> --- a/drivers/platform/x86/ideapad-laptop.c
>> +++ b/drivers/platform/x86/ideapad-laptop.c
>> @@ -478,7 +478,7 @@ static int ideapad_rfk_set(void *data, bool blocked)
>> return write_ec_cmd(priv->priv->adev->handle, opcode, !blocked);
>> }
>>
>> -static struct rfkill_ops ideapad_rfk_ops = {
>> +static const struct rfkill_ops ideapad_rfk_ops = {
>> .set_block = ideapad_rfk_set,
>> };
>>
>> diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
>> index 8c146e2..e1e8897 100644
>> --- a/drivers/platform/x86/samsung-laptop.c
>> +++ b/drivers/platform/x86/samsung-laptop.c
>> @@ -591,7 +591,7 @@ static int seclinux_rfkill_set(void *data, bool blocked)
>> !blocked);
>> }
>>
>> -static struct rfkill_ops seclinux_rfkill_ops = {
>> +static const struct rfkill_ops seclinux_rfkill_ops = {
>> .set_block = seclinux_rfkill_set,
>> };
>>
>> @@ -651,7 +651,7 @@ static void swsmi_rfkill_query(struct rfkill *rfkill, void *priv)
>> rfkill_set_sw_state(rfkill, !ret);
>> }
>>
>> -static struct rfkill_ops swsmi_rfkill_ops = {
>> +static const struct rfkill_ops swsmi_rfkill_ops = {
>> .set_block = swsmi_rfkill_set,
>> .query = swsmi_rfkill_query,
>> };
>> --
>> 2.7.4
>>
>
>
>
> --
> With Best Regards,
> Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-08 12:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-08 11:17 [PATCH] platform/x86: constify rfkill_ops structures Bhumika Goyal
2017-06-08 12:38 ` Andy Shevchenko
2017-06-08 12:41 ` Bhumika Goyal
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).