linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword
@ 2021-05-19  8:19 Hriday Hegde
  2021-05-19  8:31 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: Hriday Hegde @ 2021-05-19  8:19 UTC (permalink / raw)
  Cc: hridayhegde1999, Greg Kroah-Hartman, Arve Hjønnevåg,
	Todd Kjos, Martijn Coenen, Joel Fernandes, Christian Brauner,
	Hridya Valsaraju, Suren Baghdasaryan, linux-kernel, linux-staging

Fixing following warnings found by checkpatch.pl
WARNING: struct file_operations should normally be const
380: FILE: drivers/staging/android/ashmem.c:380:
+	static struct file_operations vmfile_fops;

Signed-off-by: Hriday Hegde <hridayhegde1999@gmail.com>
---
 drivers/staging/android/ashmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
index 8ee4320a5dc6..8ff2794b08e3 100644
--- a/drivers/staging/android/ashmem.c
+++ b/drivers/staging/android/ashmem.c
@@ -377,7 +377,7 @@ ashmem_vmfile_get_unmapped_area(struct file *file, unsigned long addr,
 
 static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
 {
-	static struct file_operations vmfile_fops;
+	static const struct file_operations vmfile_fops;
 	struct ashmem_area *asma = file->private_data;
 	int ret = 0;
 
-- 
2.25.1


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

* Re: [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword
  2021-05-19  8:19 [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword Hriday Hegde
@ 2021-05-19  8:31 ` Greg Kroah-Hartman
  2021-05-19  9:30   ` Hriday Hegde
  0 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-19  8:31 UTC (permalink / raw)
  To: Hriday Hegde
  Cc: Arve Hjønnevåg, Todd Kjos, Martijn Coenen,
	Joel Fernandes, Christian Brauner, Hridya Valsaraju,
	Suren Baghdasaryan, linux-kernel, linux-staging

On Wed, May 19, 2021 at 01:19:58AM -0700, Hriday Hegde wrote:
> Fixing following warnings found by checkpatch.pl
> WARNING: struct file_operations should normally be const
> 380: FILE: drivers/staging/android/ashmem.c:380:
> +	static struct file_operations vmfile_fops;
> 
> Signed-off-by: Hriday Hegde <hridayhegde1999@gmail.com>
> ---
>  drivers/staging/android/ashmem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
> index 8ee4320a5dc6..8ff2794b08e3 100644
> --- a/drivers/staging/android/ashmem.c
> +++ b/drivers/staging/android/ashmem.c
> @@ -377,7 +377,7 @@ ashmem_vmfile_get_unmapped_area(struct file *file, unsigned long addr,
>  
>  static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
>  {
> -	static struct file_operations vmfile_fops;
> +	static const struct file_operations vmfile_fops;
>  	struct ashmem_area *asma = file->private_data;
>  	int ret = 0;
>  
> -- 
> 2.25.1
> 
> 

Any reason why you didn't build your change before submitting this
patch?

thanks,

greg k-h

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

* Re: [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword
  2021-05-19  8:31 ` Greg Kroah-Hartman
@ 2021-05-19  9:30   ` Hriday Hegde
  2021-05-19  9:50     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 9+ messages in thread
From: Hriday Hegde @ 2021-05-19  9:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arve Hjønnevåg, Todd Kjos, Martijn Coenen,
	Joel Fernandes, Christian Brauner, Hridya Valsaraju,
	Suren Baghdasaryan, linux-kernel, linux-staging

I am not really sure how to do that and how to reflect it in the patch i followed what was taught in the Beginners course and it does not mention building. I know i need to test it out but is running 'patch -p1 < x.patch what i need to do?

On 19-05-2021 14:01, Greg Kroah-Hartman wrote:
> On Wed, May 19, 2021 at 01:19:58AM -0700, Hriday Hegde wrote:
>> Fixing following warnings found by checkpatch.pl
>> WARNING: struct file_operations should normally be const
>> 380: FILE: drivers/staging/android/ashmem.c:380:
>> +	static struct file_operations vmfile_fops;
>>
>> Signed-off-by: Hriday Hegde <hridayhegde1999@gmail.com>
>> ---
>>  drivers/staging/android/ashmem.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c
>> index 8ee4320a5dc6..8ff2794b08e3 100644
>> --- a/drivers/staging/android/ashmem.c
>> +++ b/drivers/staging/android/ashmem.c
>> @@ -377,7 +377,7 @@ ashmem_vmfile_get_unmapped_area(struct file *file, unsigned long addr,
>>  
>>  static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
>>  {
>> -	static struct file_operations vmfile_fops;
>> +	static const struct file_operations vmfile_fops;
>>  	struct ashmem_area *asma = file->private_data;
>>  	int ret = 0;
>>  
>> -- 
>> 2.25.1
>>
>>
> Any reason why you didn't build your change before submitting this
> patch?
>
> thanks,
>
> greg k-h

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

* Re: [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword
  2021-05-19  9:30   ` Hriday Hegde
@ 2021-05-19  9:50     ` Greg Kroah-Hartman
  2021-05-19 14:36       ` Hriday Hegde
  0 siblings, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-19  9:50 UTC (permalink / raw)
  To: Hriday Hegde
  Cc: Arve Hjønnevåg, Todd Kjos, Martijn Coenen,
	Joel Fernandes, Christian Brauner, Hridya Valsaraju,
	Suren Baghdasaryan, linux-kernel, linux-staging

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://daringfireball.net/2007/07/on_top

On Wed, May 19, 2021 at 03:00:08PM +0530, Hriday Hegde wrote:
> I am not really sure how to do that and how to reflect it in the patch i followed what was taught in the Beginners course and it does not mention building. I know i need to test it out but is running 'patch -p1 < x.patch what i need to do?

That does not build the code you changed, right?

I'm sure whatever course you took, it did reference the fact that you
need to ensure that your change actually works properly by the very
least being able to be compiled correctly.  Please go over those
instructions again.

good luck!

greg k-h

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

* Re: [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword
  2021-05-19  9:50     ` Greg Kroah-Hartman
@ 2021-05-19 14:36       ` Hriday Hegde
  2021-05-19 14:51         ` Fabio Aiuto
  2021-05-19 14:55         ` Greg Kroah-Hartman
  0 siblings, 2 replies; 9+ messages in thread
From: Hriday Hegde @ 2021-05-19 14:36 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arve Hjønnevåg, Todd Kjos, Martijn Coenen,
	Joel Fernandes, Christian Brauner, Hridya Valsaraju,
	Suren Baghdasaryan, linux-kernel, linux-staging

On 19-05-2021 15:20, Greg Kroah-Hartman wrote:
> A: http://en.wikipedia.org/wiki/Top_post
> Q: Were do I find info about this thing called top-posting?
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing in e-mail?
>
> http://daringfireball.net/2007/07/on_top
>
> On Wed, May 19, 2021 at 03:00:08PM +0530, Hriday Hegde wrote:
>> I am not really sure how to do that and how to reflect it in the patch i followed what was taught in the Beginners course and it does not mention building. I know i need to test it out but is running 'patch -p1 < x.patch what i need to do?
> That does not build the code you changed, right?
>
> I'm sure whatever course you took, it did reference the fact that you
> need to ensure that your change actually works properly by the very
> least being able to be compiled correctly.  Please go over those
> instructions again.
>
> good luck!
>
> greg k-h

I am using the A Beginner's Guide to Linux Kernel Development (LFD103) by the linux foundation for this but i cant find any commands to as to build and test , the only way i tried compiling is with a custom Makefile and it didn't work, i've got a few errors so the const keyword might not work here since the variable is being written to.


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

* Re: [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword
  2021-05-19 14:36       ` Hriday Hegde
@ 2021-05-19 14:51         ` Fabio Aiuto
  2021-05-19 15:54           ` Hriday Hegde
  2021-05-19 14:55         ` Greg Kroah-Hartman
  1 sibling, 1 reply; 9+ messages in thread
From: Fabio Aiuto @ 2021-05-19 14:51 UTC (permalink / raw)
  To: Hriday Hegde
  Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Christian Brauner,
	Hridya Valsaraju, Suren Baghdasaryan, linux-kernel, linux-staging

Hi Hriday,

On Wed, May 19, 2021 at 08:06:14PM +0530, Hriday Hegde wrote:
> On 19-05-2021 15:20, Greg Kroah-Hartman wrote:
> > A: http://en.wikipedia.org/wiki/Top_post
> > Q: Were do I find info about this thing called top-posting?
> > A: Because it messes up the order in which people normally read text.
> > Q: Why is top-posting such a bad thing?
> > A: Top-posting.
> > Q: What is the most annoying thing in e-mail?
> >
> > http://daringfireball.net/2007/07/on_top
> >
> > On Wed, May 19, 2021 at 03:00:08PM +0530, Hriday Hegde wrote:
> >> I am not really sure how to do that and how to reflect it in the patch i followed what was taught in the Beginners course and it does not mention building. I know i need to test it out but is running 'patch -p1 < x.patch what i need to do?
> > That does not build the code you changed, right?
> >
> > I'm sure whatever course you took, it did reference the fact that you
> > need to ensure that your change actually works properly by the very
> > least being able to be compiled correctly.  Please go over those
> > instructions again.
> >
> > good luck!
> >
> > greg k-h
> 
> I am using the A Beginner's Guide to Linux Kernel Development (LFD103) by the linux foundation for this but i cant find any commands to as to build and test , the only way i tried compiling is with a custom Makefile and it didn't work, i've got a few errors so the const keyword might not work here since the variable is being written to.
> 
> 

try following this tutorial from scratch:

https://kernelnewbies.org/FirstKernelPatch

it's simply complete and helps a lot, from
gathering all tools needed to contribute to the
community to sending whole patchsets.

In your emails don't go over 80-100 character per line,
when you ask things or your mails will be difficult
to read.

thank you,

fabio

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

* Re: [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword
  2021-05-19 14:36       ` Hriday Hegde
  2021-05-19 14:51         ` Fabio Aiuto
@ 2021-05-19 14:55         ` Greg Kroah-Hartman
  2021-05-19 15:56           ` Hriday Hegde
  1 sibling, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-19 14:55 UTC (permalink / raw)
  To: Hriday Hegde
  Cc: Arve Hjønnevåg, Todd Kjos, Martijn Coenen,
	Joel Fernandes, Christian Brauner, Hridya Valsaraju,
	Suren Baghdasaryan, linux-kernel, linux-staging

On Wed, May 19, 2021 at 08:06:14PM +0530, Hriday Hegde wrote:
> On 19-05-2021 15:20, Greg Kroah-Hartman wrote:
> > A: http://en.wikipedia.org/wiki/Top_post
> > Q: Were do I find info about this thing called top-posting?
> > A: Because it messes up the order in which people normally read text.
> > Q: Why is top-posting such a bad thing?
> > A: Top-posting.
> > Q: What is the most annoying thing in e-mail?
> >
> > http://daringfireball.net/2007/07/on_top
> >
> > On Wed, May 19, 2021 at 03:00:08PM +0530, Hriday Hegde wrote:
> >> I am not really sure how to do that and how to reflect it in the patch i followed what was taught in the Beginners course and it does not mention building. I know i need to test it out but is running 'patch -p1 < x.patch what i need to do?
> > That does not build the code you changed, right?
> >
> > I'm sure whatever course you took, it did reference the fact that you
> > need to ensure that your change actually works properly by the very
> > least being able to be compiled correctly.  Please go over those
> > instructions again.
> >
> > good luck!
> >
> > greg k-h
> 
> I am using the A Beginner's Guide to Linux Kernel Development (LFD103) by the linux foundation for this but i cant find any commands to as to build and test , the only way i tried compiling is with a custom Makefile and it didn't work, i've got a few errors so the const keyword might not work here since the variable is being written to.
> 
> 

That is correct, when compiling (i.e. building), the compiler shows that
this is not a correct change.

thanks,

greg k-h

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

* Re: [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword
  2021-05-19 14:51         ` Fabio Aiuto
@ 2021-05-19 15:54           ` Hriday Hegde
  0 siblings, 0 replies; 9+ messages in thread
From: Hriday Hegde @ 2021-05-19 15:54 UTC (permalink / raw)
  To: Fabio Aiuto
  Cc: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Martijn Coenen, Joel Fernandes, Christian Brauner,
	Hridya Valsaraju, Suren Baghdasaryan, linux-kernel, linux-staging



On 19-05-2021 20:21, Fabio Aiuto wrote:
> Hi Hriday,
>
> On Wed, May 19, 2021 at 08:06:14PM +0530, Hriday Hegde wrote:
>> On 19-05-2021 15:20, Greg Kroah-Hartman wrote:
>>> A: http://en.wikipedia.org/wiki/Top_post
>>> Q: Were do I find info about this thing called top-posting?
>>> A: Because it messes up the order in which people normally read text.
>>> Q: Why is top-posting such a bad thing?
>>> A: Top-posting.
>>> Q: What is the most annoying thing in e-mail?
>>>
>>> http://daringfireball.net/2007/07/on_top
>>>
>>> On Wed, May 19, 2021 at 03:00:08PM +0530, Hriday Hegde wrote:
>>>> I am not really sure how to do that and how to reflect it in the patch i followed what was taught in the Beginners course and it does not mention building. I know i need to test it out but is running 'patch -p1 < x.patch what i need to do?
>>> That does not build the code you changed, right?
>>>
>>> I'm sure whatever course you took, it did reference the fact that you
>>> need to ensure that your change actually works properly by the very
>>> least being able to be compiled correctly.  Please go over those
>>> instructions again.
>>>
>>> good luck!
>>>
>>> greg k-h
>> I am using the A Beginner's Guide to Linux Kernel Development (LFD103) by the linux foundation for this but i cant find any commands to as to build and test , the only way i tried compiling is with a custom Makefile and it didn't work, i've got a few errors so the const keyword might not work here since the variable is being written to.
>>
>>
> try following this tutorial from scratch:
>
> https://kernelnewbies.org/FirstKernelPatch
>
> it's simply complete and helps a lot, from
> gathering all tools needed to contribute to the
> community to sending whole patchsets.
>
> In your emails don't go over 80-100 character per line,
> when you ask things or your mails will be difficult
> to read.
>
> thank you,
>
> fabio
Thank you for the guidance,  and will keep the char limit in
mind.


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

* Re: [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword
  2021-05-19 14:55         ` Greg Kroah-Hartman
@ 2021-05-19 15:56           ` Hriday Hegde
  0 siblings, 0 replies; 9+ messages in thread
From: Hriday Hegde @ 2021-05-19 15:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arve Hjønnevåg, Todd Kjos, Martijn Coenen,
	Joel Fernandes, Christian Brauner, Hridya Valsaraju,
	Suren Baghdasaryan, linux-kernel, linux-staging

On 19-05-2021 20:25, Greg Kroah-Hartman wrote:
> On Wed, May 19, 2021 at 08:06:14PM +0530, Hriday Hegde wrote:
>> On 19-05-2021 15:20, Greg Kroah-Hartman wrote:
>>> A: http://en.wikipedia.org/wiki/Top_post
>>> Q: Were do I find info about this thing called top-posting?
>>> A: Because it messes up the order in which people normally read text.
>>> Q: Why is top-posting such a bad thing?
>>> A: Top-posting.
>>> Q: What is the most annoying thing in e-mail?
>>>
>>> http://daringfireball.net/2007/07/on_top
>>>
>>> On Wed, May 19, 2021 at 03:00:08PM +0530, Hriday Hegde wrote:
>>>> I am not really sure how to do that and how to reflect it in the patch i followed what was taught in the Beginners course and it does not mention building. I know i need to test it out but is running 'patch -p1 < x.patch what i need to do?
>>> That does not build the code you changed, right?
>>>
>>> I'm sure whatever course you took, it did reference the fact that you
>>> need to ensure that your change actually works properly by the very
>>> least being able to be compiled correctly.  Please go over those
>>> instructions again.
>>>
>>> good luck!
>>>
>>> greg k-h
>> I am using the A Beginner's Guide to Linux Kernel Development (LFD103) by the linux foundation for this but i cant find any commands to as to build and test , the only way i tried compiling is with a custom Makefile and it didn't work, i've got a few errors so the const keyword might not work here since the variable is being written to.
>>
>>
> That is correct, when compiling (i.e. building), the compiler shows that
> this is not a correct change.
>
> thanks,
>
> greg k-h
Oh ok will work with something else.

Thanks.


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

end of thread, other threads:[~2021-05-19 15:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-19  8:19 [PATCH] staging: android: ashmem: Declared file operation with 'const' keyword Hriday Hegde
2021-05-19  8:31 ` Greg Kroah-Hartman
2021-05-19  9:30   ` Hriday Hegde
2021-05-19  9:50     ` Greg Kroah-Hartman
2021-05-19 14:36       ` Hriday Hegde
2021-05-19 14:51         ` Fabio Aiuto
2021-05-19 15:54           ` Hriday Hegde
2021-05-19 14:55         ` Greg Kroah-Hartman
2021-05-19 15:56           ` Hriday Hegde

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