Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: add const type to struct kobj_type gb_audio_module_type
@ 2024-03-13 19:02 Ayush Tiwari
  2024-03-14  2:25 ` Alison Schofield
  0 siblings, 1 reply; 2+ messages in thread
From: Ayush Tiwari @ 2024-03-13 19:02 UTC (permalink / raw)
  To: Larry.Finger, florian.c.schilhabel, gregkh, linux-kernel,
	linux-staging
  Cc: outreachy

Add type qualifier const in struct kobj_type gb_audio_module_type to
address checkpatch warning and conform to the kernel coding style.

Signed-off-by: Ayush Tiwari <ayushtiw0110@gmail.com>
---
 drivers/staging/greybus/audio_manager_module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
index 5f9dcbdbc191..4a4dfb42f50f 100644
--- a/drivers/staging/greybus/audio_manager_module.c
+++ b/drivers/staging/greybus/audio_manager_module.c
@@ -144,7 +144,7 @@ static struct attribute *gb_audio_module_default_attrs[] = {
 };
 ATTRIBUTE_GROUPS(gb_audio_module_default);
 
-static struct kobj_type gb_audio_module_type = {
+static const struct kobj_type gb_audio_module_type = {
 	.sysfs_ops = &gb_audio_module_sysfs_ops,
 	.release = gb_audio_module_release,
 	.default_groups = gb_audio_module_default_groups,
-- 
2.40.1


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

* Re: [PATCH] staging: greybus: add const type to struct kobj_type gb_audio_module_type
  2024-03-13 19:02 [PATCH] staging: greybus: add const type to struct kobj_type gb_audio_module_type Ayush Tiwari
@ 2024-03-14  2:25 ` Alison Schofield
  0 siblings, 0 replies; 2+ messages in thread
From: Alison Schofield @ 2024-03-14  2:25 UTC (permalink / raw)
  To: Ayush Tiwari
  Cc: Larry.Finger, florian.c.schilhabel, gregkh, linux-kernel,
	linux-staging, outreachy

On Thu, Mar 14, 2024 at 12:32:57AM +0530, Ayush Tiwari wrote:
> Add type qualifier const in struct kobj_type gb_audio_module_type to
> address checkpatch warning and conform to the kernel coding style.

Thanks for the patch. A couple of things you could address in a v2:

1) 'Constify' is not a real English word, or maybe it's made its way
into an urban dictionary by now. Anyway, it's a common patch action
and you can read more about and improve the 'why' in your description.

Try: $ git log --pretty=oneline --abbrev-commit | grep Constify
and you'll find many patch examples. I think you'll find a crisper
'why' for your patch description.

Also, here's a former Outreachy Interns blog about the topic:
https://medium.com/@bhumikagoyal/linux-kernel-const-annotation-8db591148e58

2) Now that you know about the work 'Constify' please use it in your
commit message so that it doesn't cause line wrap (80 lines) when doing 
$ git log --pretty=oneline --abbrev-commit audio_manager_module.c

See the First Patch Tutorial Section: Following the Driver commit style

Alison

> 
> Signed-off-by: Ayush Tiwari <ayushtiw0110@gmail.com>
> ---
>  drivers/staging/greybus/audio_manager_module.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
> index 5f9dcbdbc191..4a4dfb42f50f 100644
> --- a/drivers/staging/greybus/audio_manager_module.c
> +++ b/drivers/staging/greybus/audio_manager_module.c
> @@ -144,7 +144,7 @@ static struct attribute *gb_audio_module_default_attrs[] = {
>  };
>  ATTRIBUTE_GROUPS(gb_audio_module_default);
>  
> -static struct kobj_type gb_audio_module_type = {
> +static const struct kobj_type gb_audio_module_type = {
>  	.sysfs_ops = &gb_audio_module_sysfs_ops,
>  	.release = gb_audio_module_release,
>  	.default_groups = gb_audio_module_default_groups,
> -- 
> 2.40.1
> 
> 

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

end of thread, other threads:[~2024-03-14  2:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 19:02 [PATCH] staging: greybus: add const type to struct kobj_type gb_audio_module_type Ayush Tiwari
2024-03-14  2:25 ` Alison Schofield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox