Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1727248
| From | Jiri Kosina <jikos@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/6] hid: make device_attribute const |
| Date | 2017-09-06 11:00 +0200 |
| Message-ID | <umElI-7Em-21@gated-at.bofh.it> (permalink) |
| References | <ugTnr-3Rl-5@gated-at.bofh.it> <ugTns-3Rl-33@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, 21 Aug 2017, Bhumika Goyal wrote:
> Make this const as it is only passed as an argument to the
> function device_create_file and device_remove_file and the corresponding
> arguments are of type const.
> Done using Coccinelle
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> drivers/hid/hid-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index 9bc9116..24e929c 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -1662,7 +1662,7 @@ static bool hid_hiddev(struct hid_device *hdev)
> .size = HID_MAX_DESCRIPTOR_SIZE,
> };
>
> -static struct device_attribute dev_attr_country = {
> +static const struct device_attribute dev_attr_country = {
> .attr = { .name = "country", .mode = 0444 },
> .show = show_country,
Applied, thanks.
--
Jiri Kosina
SUSE Labs
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 3/6] hid: make device_attribute const Jiri Kosina <jikos@kernel.org> - 2017-09-06 11:00 +0200
csiph-web