linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen: constify all instances of "struct attribute_group"
@ 2012-02-24 11:47 Jan Beulich
  2012-02-26 16:02 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2012-02-24 11:47 UTC (permalink / raw)
  To: Jeremy Fitzhardinge, Konrad Rzeszutek Wilk; +Cc: xen-devel, linux-kernel

The functions these get passed to have been taking pointers to const
since at least 2.6.16.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

---
 drivers/xen/sys-hypervisor.c  |    6 +++---
 drivers/xen/xen-balloon.c     |    2 +-
 drivers/xen/xen-selfballoon.c |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

--- 3.3-rc4/drivers/xen/sys-hypervisor.c
+++ 3.3-rc4-xen-const-attribute_group/drivers/xen/sys-hypervisor.c
@@ -97,7 +97,7 @@ static struct attribute *version_attrs[]
 	NULL
 };
 
-static struct attribute_group version_group = {
+static const struct attribute_group version_group = {
 	.name = "version",
 	.attrs = version_attrs,
 };
@@ -210,7 +210,7 @@ static struct attribute *xen_compile_att
 	NULL
 };
 
-static struct attribute_group xen_compilation_group = {
+static const struct attribute_group xen_compilation_group = {
 	.name = "compilation",
 	.attrs = xen_compile_attrs,
 };
@@ -340,7 +340,7 @@ static struct attribute *xen_properties_
 	NULL
 };
 
-static struct attribute_group xen_properties_group = {
+static const struct attribute_group xen_properties_group = {
 	.name = "properties",
 	.attrs = xen_properties_attrs,
 };
--- 3.3-rc4/drivers/xen/xen-balloon.c
+++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-balloon.c
@@ -207,7 +207,7 @@ static struct attribute *balloon_info_at
 	NULL
 };
 
-static struct attribute_group balloon_info_group = {
+static const struct attribute_group balloon_info_group = {
 	.name = "info",
 	.attrs = balloon_info_attrs
 };
--- 3.3-rc4/drivers/xen/xen-selfballoon.c
+++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-selfballoon.c
@@ -488,7 +488,7 @@ static struct attribute *selfballoon_att
 	NULL
 };
 
-static struct attribute_group selfballoon_group = {
+static const struct attribute_group selfballoon_group = {
 	.name = "selfballoon",
 	.attrs = selfballoon_attrs
 };




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen: constify all instances of "struct attribute_group"
  2012-02-24 11:47 [PATCH] xen: constify all instances of "struct attribute_group" Jan Beulich
@ 2012-02-26 16:02 ` Konrad Rzeszutek Wilk
  2012-02-27  8:27   ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-02-26 16:02 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Jeremy Fitzhardinge, xen-devel, linux-kernel

On Fri, Feb 24, 2012 at 11:47:57AM +0000, Jan Beulich wrote:
> The functions these get passed to have been taking pointers to const
> since at least 2.6.16.

What is this based on? I get:

HEAD is now at b01543d... Linux 3.3-rc4
konrad@phenom:~/ssd/linux$ patch -p1 < /tmp/jan-1
patching file drivers/xen/sys-hypervisor.c
Hunk #1 FAILED at 97.
Hunk #2 FAILED at 210.
Hunk #3 FAILED at 340.
3 out of 3 hunks FAILED -- saving rejects to file drivers/xen/sys-hypervisor.c.rej
patching file drivers/xen/xen-balloon.c
Hunk #1 FAILED at 207.
1 out of 1 hunk FAILED -- saving rejects to file drivers/xen/xen-balloon.c.rej
patching file drivers/xen/xen-selfballoon.c
Hunk #1 FAILED at 488.
1 out of 1 hunk FAILED -- saving rejects to file drivers/xen/xen-selfballoon.c.rej


> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> ---
>  drivers/xen/sys-hypervisor.c  |    6 +++---
>  drivers/xen/xen-balloon.c     |    2 +-
>  drivers/xen/xen-selfballoon.c |    2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> --- 3.3-rc4/drivers/xen/sys-hypervisor.c
> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/sys-hypervisor.c
> @@ -97,7 +97,7 @@ static struct attribute *version_attrs[]
>  	NULL
>  };
>  
> -static struct attribute_group version_group = {
> +static const struct attribute_group version_group = {
>  	.name = "version",
>  	.attrs = version_attrs,
>  };
> @@ -210,7 +210,7 @@ static struct attribute *xen_compile_att
>  	NULL
>  };
>  
> -static struct attribute_group xen_compilation_group = {
> +static const struct attribute_group xen_compilation_group = {
>  	.name = "compilation",
>  	.attrs = xen_compile_attrs,
>  };
> @@ -340,7 +340,7 @@ static struct attribute *xen_properties_
>  	NULL
>  };
>  
> -static struct attribute_group xen_properties_group = {
> +static const struct attribute_group xen_properties_group = {
>  	.name = "properties",
>  	.attrs = xen_properties_attrs,
>  };
> --- 3.3-rc4/drivers/xen/xen-balloon.c
> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-balloon.c
> @@ -207,7 +207,7 @@ static struct attribute *balloon_info_at
>  	NULL
>  };
>  
> -static struct attribute_group balloon_info_group = {
> +static const struct attribute_group balloon_info_group = {
>  	.name = "info",
>  	.attrs = balloon_info_attrs
>  };
> --- 3.3-rc4/drivers/xen/xen-selfballoon.c
> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-selfballoon.c
> @@ -488,7 +488,7 @@ static struct attribute *selfballoon_att
>  	NULL
>  };
>  
> -static struct attribute_group selfballoon_group = {
> +static const struct attribute_group selfballoon_group = {
>  	.name = "selfballoon",
>  	.attrs = selfballoon_attrs
>  };
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen: constify all instances of "struct attribute_group"
  2012-02-26 16:02 ` Konrad Rzeszutek Wilk
@ 2012-02-27  8:27   ` Jan Beulich
  2012-03-14 16:35     ` [Xen-devel] " Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2012-02-27  8:27 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Jeremy Fitzhardinge, xen-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3261 bytes --]

>>> On 26.02.12 at 17:02, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Fri, Feb 24, 2012 at 11:47:57AM +0000, Jan Beulich wrote:
>> The functions these get passed to have been taking pointers to const
>> since at least 2.6.16.
> 
> What is this based on? I get:

Plain 3.3-rc4.

> HEAD is now at b01543d... Linux 3.3-rc4
> konrad@phenom:~/ssd/linux$ patch -p1 < /tmp/jan-1
> patching file drivers/xen/sys-hypervisor.c
> Hunk #1 FAILED at 97.
> Hunk #2 FAILED at 210.
> Hunk #3 FAILED at 340.
> 3 out of 3 hunks FAILED -- saving rejects to file 
> drivers/xen/sys-hypervisor.c.rej
> patching file drivers/xen/xen-balloon.c
> Hunk #1 FAILED at 207.
> 1 out of 1 hunk FAILED -- saving rejects to file drivers/xen/xen-balloon.c.rej
> patching file drivers/xen/xen-selfballoon.c
> Hunk #1 FAILED at 488.
> 1 out of 1 hunk FAILED -- saving rejects to file 
> drivers/xen/xen-selfballoon.c.rej

Is /tmp/jan-1 perhaps suffering whitespace corruption (which would
have happened at your end, as I can take the tail of your response,
remove the reply quotation, and apply it successfully), even though
I don't think we had problems of this kind in the past? I'll attach the
patch here, just in case.

Jan

>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> ---
>>  drivers/xen/sys-hypervisor.c  |    6 +++---
>>  drivers/xen/xen-balloon.c     |    2 +-
>>  drivers/xen/xen-selfballoon.c |    2 +-
>>  3 files changed, 5 insertions(+), 5 deletions(-)
>> 
>> --- 3.3-rc4/drivers/xen/sys-hypervisor.c
>> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/sys-hypervisor.c
>> @@ -97,7 +97,7 @@ static struct attribute *version_attrs[]
>>  	NULL
>>  };
>>  
>> -static struct attribute_group version_group = {
>> +static const struct attribute_group version_group = {
>>  	.name = "version",
>>  	.attrs = version_attrs,
>>  };
>> @@ -210,7 +210,7 @@ static struct attribute *xen_compile_att
>>  	NULL
>>  };
>>  
>> -static struct attribute_group xen_compilation_group = {
>> +static const struct attribute_group xen_compilation_group = {
>>  	.name = "compilation",
>>  	.attrs = xen_compile_attrs,
>>  };
>> @@ -340,7 +340,7 @@ static struct attribute *xen_properties_
>>  	NULL
>>  };
>>  
>> -static struct attribute_group xen_properties_group = {
>> +static const struct attribute_group xen_properties_group = {
>>  	.name = "properties",
>>  	.attrs = xen_properties_attrs,
>>  };
>> --- 3.3-rc4/drivers/xen/xen-balloon.c
>> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-balloon.c
>> @@ -207,7 +207,7 @@ static struct attribute *balloon_info_at
>>  	NULL
>>  };
>>  
>> -static struct attribute_group balloon_info_group = {
>> +static const struct attribute_group balloon_info_group = {
>>  	.name = "info",
>>  	.attrs = balloon_info_attrs
>>  };
>> --- 3.3-rc4/drivers/xen/xen-selfballoon.c
>> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-selfballoon.c
>> @@ -488,7 +488,7 @@ static struct attribute *selfballoon_att
>>  	NULL
>>  };
>>  
>> -static struct attribute_group selfballoon_group = {
>> +static const struct attribute_group selfballoon_group = {
>>  	.name = "selfballoon",
>>  	.attrs = selfballoon_attrs
>>  };
>> 
>> 




[-- Attachment #2: linux-3.3-rc4-xen-const-attribute_group.patch --]
[-- Type: text/plain, Size: 1981 bytes --]

xen: constify all instances of "struct attribute_group"

The functions these get passed to have been taking pointers to const
since at least 2.6.16.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

---
 drivers/xen/sys-hypervisor.c  |    6 +++---
 drivers/xen/xen-balloon.c     |    2 +-
 drivers/xen/xen-selfballoon.c |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

--- 3.3-rc4/drivers/xen/sys-hypervisor.c
+++ 3.3-rc4-xen-const-attribute_group/drivers/xen/sys-hypervisor.c
@@ -97,7 +97,7 @@ static struct attribute *version_attrs[]
 	NULL
 };
 
-static struct attribute_group version_group = {
+static const struct attribute_group version_group = {
 	.name = "version",
 	.attrs = version_attrs,
 };
@@ -210,7 +210,7 @@ static struct attribute *xen_compile_att
 	NULL
 };
 
-static struct attribute_group xen_compilation_group = {
+static const struct attribute_group xen_compilation_group = {
 	.name = "compilation",
 	.attrs = xen_compile_attrs,
 };
@@ -340,7 +340,7 @@ static struct attribute *xen_properties_
 	NULL
 };
 
-static struct attribute_group xen_properties_group = {
+static const struct attribute_group xen_properties_group = {
 	.name = "properties",
 	.attrs = xen_properties_attrs,
 };
--- 3.3-rc4/drivers/xen/xen-balloon.c
+++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-balloon.c
@@ -207,7 +207,7 @@ static struct attribute *balloon_info_at
 	NULL
 };
 
-static struct attribute_group balloon_info_group = {
+static const struct attribute_group balloon_info_group = {
 	.name = "info",
 	.attrs = balloon_info_attrs
 };
--- 3.3-rc4/drivers/xen/xen-selfballoon.c
+++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-selfballoon.c
@@ -488,7 +488,7 @@ static struct attribute *selfballoon_att
 	NULL
 };
 
-static struct attribute_group selfballoon_group = {
+static const struct attribute_group selfballoon_group = {
 	.name = "selfballoon",
 	.attrs = selfballoon_attrs
 };

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xen-devel] [PATCH] xen: constify all instances of "struct attribute_group"
  2012-02-27  8:27   ` Jan Beulich
@ 2012-03-14 16:35     ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-03-14 16:35 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Jeremy Fitzhardinge, linux-kernel, xen-devel

On Mon, Feb 27, 2012 at 08:27:57AM +0000, Jan Beulich wrote:
> >>> On 26.02.12 at 17:02, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > On Fri, Feb 24, 2012 at 11:47:57AM +0000, Jan Beulich wrote:
> >> The functions these get passed to have been taking pointers to const
> >> since at least 2.6.16.
> > 
> > What is this based on? I get:
> 
> Plain 3.3-rc4.
> 
> > HEAD is now at b01543d... Linux 3.3-rc4
> > konrad@phenom:~/ssd/linux$ patch -p1 < /tmp/jan-1
> > patching file drivers/xen/sys-hypervisor.c
> > Hunk #1 FAILED at 97.
> > Hunk #2 FAILED at 210.
> > Hunk #3 FAILED at 340.
> > 3 out of 3 hunks FAILED -- saving rejects to file 
> > drivers/xen/sys-hypervisor.c.rej
> > patching file drivers/xen/xen-balloon.c
> > Hunk #1 FAILED at 207.
> > 1 out of 1 hunk FAILED -- saving rejects to file drivers/xen/xen-balloon.c.rej
> > patching file drivers/xen/xen-selfballoon.c
> > Hunk #1 FAILED at 488.
> > 1 out of 1 hunk FAILED -- saving rejects to file 
> > drivers/xen/xen-selfballoon.c.rej
> 
> Is /tmp/jan-1 perhaps suffering whitespace corruption (which would
> have happened at your end, as I can take the tail of your response,
> remove the reply quotation, and apply it successfully), even though
> I don't think we had problems of this kind in the past? I'll attach the
> patch here, just in case.

Thanks. Used the attached patch and it applied nicely. 
> 
> Jan
> 
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> 
> >> ---
> >>  drivers/xen/sys-hypervisor.c  |    6 +++---
> >>  drivers/xen/xen-balloon.c     |    2 +-
> >>  drivers/xen/xen-selfballoon.c |    2 +-
> >>  3 files changed, 5 insertions(+), 5 deletions(-)
> >> 
> >> --- 3.3-rc4/drivers/xen/sys-hypervisor.c
> >> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/sys-hypervisor.c
> >> @@ -97,7 +97,7 @@ static struct attribute *version_attrs[]
> >>  	NULL
> >>  };
> >>  
> >> -static struct attribute_group version_group = {
> >> +static const struct attribute_group version_group = {
> >>  	.name = "version",
> >>  	.attrs = version_attrs,
> >>  };
> >> @@ -210,7 +210,7 @@ static struct attribute *xen_compile_att
> >>  	NULL
> >>  };
> >>  
> >> -static struct attribute_group xen_compilation_group = {
> >> +static const struct attribute_group xen_compilation_group = {
> >>  	.name = "compilation",
> >>  	.attrs = xen_compile_attrs,
> >>  };
> >> @@ -340,7 +340,7 @@ static struct attribute *xen_properties_
> >>  	NULL
> >>  };
> >>  
> >> -static struct attribute_group xen_properties_group = {
> >> +static const struct attribute_group xen_properties_group = {
> >>  	.name = "properties",
> >>  	.attrs = xen_properties_attrs,
> >>  };
> >> --- 3.3-rc4/drivers/xen/xen-balloon.c
> >> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-balloon.c
> >> @@ -207,7 +207,7 @@ static struct attribute *balloon_info_at
> >>  	NULL
> >>  };
> >>  
> >> -static struct attribute_group balloon_info_group = {
> >> +static const struct attribute_group balloon_info_group = {
> >>  	.name = "info",
> >>  	.attrs = balloon_info_attrs
> >>  };
> >> --- 3.3-rc4/drivers/xen/xen-selfballoon.c
> >> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-selfballoon.c
> >> @@ -488,7 +488,7 @@ static struct attribute *selfballoon_att
> >>  	NULL
> >>  };
> >>  
> >> -static struct attribute_group selfballoon_group = {
> >> +static const struct attribute_group selfballoon_group = {
> >>  	.name = "selfballoon",
> >>  	.attrs = selfballoon_attrs
> >>  };
> >> 
> >> 
> 
> 
> 

> xen: constify all instances of "struct attribute_group"
> 
> The functions these get passed to have been taking pointers to const
> since at least 2.6.16.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> ---
>  drivers/xen/sys-hypervisor.c  |    6 +++---
>  drivers/xen/xen-balloon.c     |    2 +-
>  drivers/xen/xen-selfballoon.c |    2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> --- 3.3-rc4/drivers/xen/sys-hypervisor.c
> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/sys-hypervisor.c
> @@ -97,7 +97,7 @@ static struct attribute *version_attrs[]
>  	NULL
>  };
>  
> -static struct attribute_group version_group = {
> +static const struct attribute_group version_group = {
>  	.name = "version",
>  	.attrs = version_attrs,
>  };
> @@ -210,7 +210,7 @@ static struct attribute *xen_compile_att
>  	NULL
>  };
>  
> -static struct attribute_group xen_compilation_group = {
> +static const struct attribute_group xen_compilation_group = {
>  	.name = "compilation",
>  	.attrs = xen_compile_attrs,
>  };
> @@ -340,7 +340,7 @@ static struct attribute *xen_properties_
>  	NULL
>  };
>  
> -static struct attribute_group xen_properties_group = {
> +static const struct attribute_group xen_properties_group = {
>  	.name = "properties",
>  	.attrs = xen_properties_attrs,
>  };
> --- 3.3-rc4/drivers/xen/xen-balloon.c
> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-balloon.c
> @@ -207,7 +207,7 @@ static struct attribute *balloon_info_at
>  	NULL
>  };
>  
> -static struct attribute_group balloon_info_group = {
> +static const struct attribute_group balloon_info_group = {
>  	.name = "info",
>  	.attrs = balloon_info_attrs
>  };
> --- 3.3-rc4/drivers/xen/xen-selfballoon.c
> +++ 3.3-rc4-xen-const-attribute_group/drivers/xen/xen-selfballoon.c
> @@ -488,7 +488,7 @@ static struct attribute *selfballoon_att
>  	NULL
>  };
>  
> -static struct attribute_group selfballoon_group = {
> +static const struct attribute_group selfballoon_group = {
>  	.name = "selfballoon",
>  	.attrs = selfballoon_attrs
>  };

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-14 16:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-24 11:47 [PATCH] xen: constify all instances of "struct attribute_group" Jan Beulich
2012-02-26 16:02 ` Konrad Rzeszutek Wilk
2012-02-27  8:27   ` Jan Beulich
2012-03-14 16:35     ` [Xen-devel] " Konrad Rzeszutek Wilk

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).