Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1692829 > unrolled thread

[PATCH v2 6/7] x86: therm_throt: constify attribute_group structures.

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-07-20 13:40 +0200
Last post2017-07-20 18:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 6/7] x86: therm_throt: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-20 13:40 +0200
    Re: [PATCH v2 6/7] x86: therm_throt: constify attribute_group  structures. Borislav Petkov <bp@alien8.de> - 2017-07-20 18:00 +0200

#1692829 — [PATCH v2 6/7] x86: therm_throt: constify attribute_group structures.

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-07-20 13:40 +0200
Subject[PATCH v2 6/7] x86: therm_throt: constify attribute_group structures.
Message-ID<u5hYf-6H9-15@gated-at.bofh.it>
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by <linux/sysfs.h> work with
const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
change in v2:
             Remove before/after size comparison from commit message.

 arch/x86/kernel/cpu/mcheck/therm_throt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index d7cc190..f7370ab 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -122,7 +122,7 @@ struct thermal_state {
 	NULL
 };
 
-static struct attribute_group thermal_attr_group = {
+static const struct attribute_group thermal_attr_group = {
 	.attrs	= thermal_throttle_attrs,
 	.name	= "thermal_throttle"
 };
-- 
1.9.1

[toc] | [next] | [standalone]


#1693048 — Re: [PATCH v2 6/7] x86: therm_throt: constify attribute_group structures.

FromBorislav Petkov <bp@alien8.de>
Date2017-07-20 18:00 +0200
SubjectRe: [PATCH v2 6/7] x86: therm_throt: constify attribute_group structures.
Message-ID<u5m1P-11d-5@gated-at.bofh.it>
In reply to#1692829
On Thu, Jul 20, 2017 at 05:00:37PM +0530, Arvind Yadav wrote:
> attribute_group are not supposed to change at runtime. All functions
> working with attribute_group provided by <linux/sysfs.h> work with
> const attribute_group. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> change in v2:
>              Remove before/after size comparison from commit message.
> 
>  arch/x86/kernel/cpu/mcheck/therm_throt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This one and the next:

Acked-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web