mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: add missing newlines to sysfs_emit
@ 2026-09-11 19:02 Matthew Zvolsky
  2026-09-11 19:36 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matthew Zvolsky @ 2026-09-11 19:02 UTC (permalink / raw)
  To: gregkh
  Cc: vaibhav.sr, mgreer, johan, elder, greybus-dev, linux-staging,
	linux-kernel, Matthew Zvolsky

Add terminating newlines to sysfs_emit format strings to conform with
kernel sysfs guidelines. Also clean up envp array declaration to be
static const char * const.

Signed-off-by: Matthew Zvolsky <matthew-kernel@post.cz>
---
 drivers/staging/greybus/audio_manager_module.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c
index dc90cc2d2308..16b688cfac75 100644
--- a/drivers/staging/greybus/audio_manager_module.c
+++ b/drivers/staging/greybus/audio_manager_module.c
@@ -75,7 +75,7 @@ static void gb_audio_module_release(struct kobject *kobj)
 static ssize_t gb_audio_module_name_show(struct gb_audio_manager_module *module,
 					 struct gb_audio_manager_module_attribute *attr, char *buf)
 {
-	return sysfs_emit(buf, "%s", module->desc.name);
+	return sysfs_emit(buf, "%s\n", module->desc.name);
 }
 
 static struct gb_audio_manager_module_attribute gb_audio_module_name_attribute =
@@ -84,7 +84,7 @@ static struct gb_audio_manager_module_attribute gb_audio_module_name_attribute =
 static ssize_t gb_audio_module_vid_show(struct gb_audio_manager_module *module,
 					struct gb_audio_manager_module_attribute *attr, char *buf)
 {
-	return sysfs_emit(buf, "%d", module->desc.vid);
+	return sysfs_emit(buf, "%d\n", module->desc.vid);
 }
 
 static struct gb_audio_manager_module_attribute gb_audio_module_vid_attribute =
@@ -93,7 +93,7 @@ static struct gb_audio_manager_module_attribute gb_audio_module_vid_attribute =
 static ssize_t gb_audio_module_pid_show(struct gb_audio_manager_module *module,
 					struct gb_audio_manager_module_attribute *attr, char *buf)
 {
-	return sysfs_emit(buf, "%d", module->desc.pid);
+	return sysfs_emit(buf, "%d\n", module->desc.pid);
 }
 
 static struct gb_audio_manager_module_attribute gb_audio_module_pid_attribute =
@@ -103,7 +103,7 @@ static ssize_t gb_audio_module_intf_id_show(struct gb_audio_manager_module *modu
 					    struct gb_audio_manager_module_attribute *attr,
 					    char *buf)
 {
-	return sysfs_emit(buf, "%d", module->desc.intf_id);
+	return sysfs_emit(buf, "%d\n", module->desc.intf_id);
 }
 
 static struct gb_audio_manager_module_attribute
@@ -114,7 +114,7 @@ static ssize_t gb_audio_module_ip_devices_show(struct gb_audio_manager_module *m
 					       struct gb_audio_manager_module_attribute *attr,
 					       char *buf)
 {
-	return sysfs_emit(buf, "0x%X", module->desc.ip_devices);
+	return sysfs_emit(buf, "0x%X\n", module->desc.ip_devices);
 }
 
 static struct gb_audio_manager_module_attribute
@@ -125,7 +125,7 @@ static ssize_t gb_audio_module_op_devices_show(struct gb_audio_manager_module *m
 					       struct gb_audio_manager_module_attribute *attr,
 					       char *buf)
 {
-	return sysfs_emit(buf, "0x%X", module->desc.op_devices);
+	return sysfs_emit(buf, "0x%X\n", module->desc.op_devices);
 }
 
 static struct gb_audio_manager_module_attribute
@@ -158,7 +158,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
 	char ip_devices_string[64];
 	char op_devices_string[64];
 
-	char *envp[] = {
+	static const char * const envp[] = {
 		name_string,
 		vid_string,
 		pid_string,
-- 
2.39.5


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

* Re: [PATCH] staging: greybus: add missing newlines to sysfs_emit
  2026-09-11 19:02 [PATCH] staging: greybus: add missing newlines to sysfs_emit Matthew Zvolsky
@ 2026-09-11 19:36 ` Dan Carpenter
  2026-09-12  7:10 ` kernel test robot
  2026-09-12  7:51 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2026-09-11 19:36 UTC (permalink / raw)
  To: Matthew Zvolsky
  Cc: gregkh, vaibhav.sr, mgreer, johan, elder, greybus-dev,
	linux-staging, linux-kernel

On Fri, Sep 11, 2026 at 09:02:53PM +0200, Matthew Zvolsky wrote:
> Add terminating newlines to sysfs_emit format strings to conform with
> kernel sysfs guidelines. Also clean up envp array declaration to be
> static const char * const.
> 
> Signed-off-by: Matthew Zvolsky <matthew-kernel@post.cz>
> ---

This has been discussed before.  Do a search for the function
names on lore.kernel.org.

regards,
dan carpenter


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

* Re: [PATCH] staging: greybus: add missing newlines to sysfs_emit
  2026-09-11 19:02 [PATCH] staging: greybus: add missing newlines to sysfs_emit Matthew Zvolsky
  2026-09-11 19:36 ` Dan Carpenter
@ 2026-09-12  7:10 ` kernel test robot
  2026-09-12  7:51 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-09-12  7:10 UTC (permalink / raw)
  To: Matthew Zvolsky, gregkh
  Cc: llvm, oe-kbuild-all, vaibhav.sr, mgreer, johan, elder,
	greybus-dev, linux-staging, linux-kernel, Matthew Zvolsky

Hi Matthew,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Matthew-Zvolsky/staging-greybus-add-missing-newlines-to-sysfs_emit/20260911-210253
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260911190253.894650-1-matthew-kernel%40post.cz
patch subject: [PATCH] staging: greybus: add missing newlines to sysfs_emit
config: i386-randconfig-014-20260912 (https://download.01.org/0day-ci/archive/20260912/202609121559.mKrcvsr6-lkp@intel.com/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260912/202609121559.mKrcvsr6-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609121559.mKrcvsr6-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/staging/greybus/audio_manager_module.c:162:3: error: initializer element is not a compile-time constant
     162 |                 name_string,
         |                 ^~~~~~~~~~~
>> drivers/staging/greybus/audio_manager_module.c:180:46: error: passing 'const char *const[7]' to parameter of type 'char **' discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     180 |         kobject_uevent_env(&module->kobj, KOBJ_ADD, envp);
         |                                                     ^~~~
   include/linux/kobject.h:283:10: note: passing argument to parameter 'envp' here
     283 |                         char *envp[]);
         |                               ^
   2 errors generated.


vim +162 drivers/staging/greybus/audio_manager_module.c

8db00736d365b7 Svetlin Ankov    2016-01-13  151  
8db00736d365b7 Svetlin Ankov    2016-01-13  152  static void send_add_uevent(struct gb_audio_manager_module *module)
8db00736d365b7 Svetlin Ankov    2016-01-13  153  {
8db00736d365b7 Svetlin Ankov    2016-01-13  154  	char name_string[128];
8db00736d365b7 Svetlin Ankov    2016-01-13  155  	char vid_string[64];
8db00736d365b7 Svetlin Ankov    2016-01-13  156  	char pid_string[64];
d0af1bd5f6f449 Pankaj Bharadiya 2016-10-16  157  	char intf_id_string[64];
a9234bfd6cec44 Vaibhav Agarwal  2016-03-30  158  	char ip_devices_string[64];
a9234bfd6cec44 Vaibhav Agarwal  2016-03-30  159  	char op_devices_string[64];
8db00736d365b7 Svetlin Ankov    2016-01-13  160  
a33c60996e0881 Matthew Zvolsky  2026-09-11  161  	static const char * const envp[] = {
8db00736d365b7 Svetlin Ankov    2016-01-13 @162  		name_string,
8db00736d365b7 Svetlin Ankov    2016-01-13  163  		vid_string,
8db00736d365b7 Svetlin Ankov    2016-01-13  164  		pid_string,
d0af1bd5f6f449 Pankaj Bharadiya 2016-10-16  165  		intf_id_string,
a9234bfd6cec44 Vaibhav Agarwal  2016-03-30  166  		ip_devices_string,
a9234bfd6cec44 Vaibhav Agarwal  2016-03-30  167  		op_devices_string,
8db00736d365b7 Svetlin Ankov    2016-01-13  168  		NULL
8db00736d365b7 Svetlin Ankov    2016-01-13  169  	};
8db00736d365b7 Svetlin Ankov    2016-01-13  170  
8db00736d365b7 Svetlin Ankov    2016-01-13  171  	snprintf(name_string, 128, "NAME=%s", module->desc.name);
8db00736d365b7 Svetlin Ankov    2016-01-13  172  	snprintf(vid_string, 64, "VID=%d", module->desc.vid);
8db00736d365b7 Svetlin Ankov    2016-01-13  173  	snprintf(pid_string, 64, "PID=%d", module->desc.pid);
d0af1bd5f6f449 Pankaj Bharadiya 2016-10-16  174  	snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id);
a9234bfd6cec44 Vaibhav Agarwal  2016-03-30  175  	snprintf(ip_devices_string, 64, "I/P DEVICES=0x%X",
a9234bfd6cec44 Vaibhav Agarwal  2016-03-30  176  		 module->desc.ip_devices);
a9234bfd6cec44 Vaibhav Agarwal  2016-03-30  177  	snprintf(op_devices_string, 64, "O/P DEVICES=0x%X",
a9234bfd6cec44 Vaibhav Agarwal  2016-03-30  178  		 module->desc.op_devices);
8db00736d365b7 Svetlin Ankov    2016-01-13  179  
8db00736d365b7 Svetlin Ankov    2016-01-13 @180  	kobject_uevent_env(&module->kobj, KOBJ_ADD, envp);
8db00736d365b7 Svetlin Ankov    2016-01-13  181  }
8db00736d365b7 Svetlin Ankov    2016-01-13  182  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH] staging: greybus: add missing newlines to sysfs_emit
  2026-09-11 19:02 [PATCH] staging: greybus: add missing newlines to sysfs_emit Matthew Zvolsky
  2026-09-11 19:36 ` Dan Carpenter
  2026-09-12  7:10 ` kernel test robot
@ 2026-09-12  7:51 ` kernel test robot
  2 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2026-09-12  7:51 UTC (permalink / raw)
  To: Matthew Zvolsky, gregkh
  Cc: oe-kbuild-all, vaibhav.sr, mgreer, johan, elder, greybus-dev,
	linux-staging, linux-kernel, Matthew Zvolsky

Hi Matthew,

kernel test robot noticed the following build errors:

[auto build test ERROR on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Matthew-Zvolsky/staging-greybus-add-missing-newlines-to-sysfs_emit/20260911-210253
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260911190253.894650-1-matthew-kernel%40post.cz
patch subject: [PATCH] staging: greybus: add missing newlines to sysfs_emit
config: nios2-randconfig-001-20260912 (https://download.01.org/0day-ci/archive/20260912/202609121553.VPi1qrGB-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260912/202609121553.VPi1qrGB-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609121553.VPi1qrGB-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/staging/greybus/audio_manager_module.c: In function 'send_add_uevent':
>> drivers/staging/greybus/audio_manager_module.c:162:3: error: initializer element is not constant
      name_string,
      ^~~~~~~~~~~
   drivers/staging/greybus/audio_manager_module.c:162:3: note: (near initialization for 'envp[0]')
   drivers/staging/greybus/audio_manager_module.c:163:3: error: initializer element is not constant
      vid_string,
      ^~~~~~~~~~
   drivers/staging/greybus/audio_manager_module.c:163:3: note: (near initialization for 'envp[1]')
   drivers/staging/greybus/audio_manager_module.c:164:3: error: initializer element is not constant
      pid_string,
      ^~~~~~~~~~
   drivers/staging/greybus/audio_manager_module.c:164:3: note: (near initialization for 'envp[2]')
   drivers/staging/greybus/audio_manager_module.c:165:3: error: initializer element is not constant
      intf_id_string,
      ^~~~~~~~~~~~~~
   drivers/staging/greybus/audio_manager_module.c:165:3: note: (near initialization for 'envp[3]')
   drivers/staging/greybus/audio_manager_module.c:166:3: error: initializer element is not constant
      ip_devices_string,
      ^~~~~~~~~~~~~~~~~
   drivers/staging/greybus/audio_manager_module.c:166:3: note: (near initialization for 'envp[4]')
   drivers/staging/greybus/audio_manager_module.c:167:3: error: initializer element is not constant
      op_devices_string,
      ^~~~~~~~~~~~~~~~~
   drivers/staging/greybus/audio_manager_module.c:167:3: note: (near initialization for 'envp[5]')
>> drivers/staging/greybus/audio_manager_module.c:180:46: error: passing argument 3 of 'kobject_uevent_env' from incompatible pointer type [-Werror=incompatible-pointer-types]
     kobject_uevent_env(&module->kobj, KOBJ_ADD, envp);
                                                 ^~~~
   In file included from drivers/staging/greybus/audio_manager.h:11,
                    from drivers/staging/greybus/audio_manager_module.c:10:
   include/linux/kobject.h:283:10: note: expected 'char **' but argument is of type 'const char * const*'
       char *envp[]);
       ~~~~~~^~~~~~
   cc1: some warnings being treated as errors


vim +162 drivers/staging/greybus/audio_manager_module.c

8db00736d365b75 Svetlin Ankov    2016-01-13  151  
8db00736d365b75 Svetlin Ankov    2016-01-13  152  static void send_add_uevent(struct gb_audio_manager_module *module)
8db00736d365b75 Svetlin Ankov    2016-01-13  153  {
8db00736d365b75 Svetlin Ankov    2016-01-13  154  	char name_string[128];
8db00736d365b75 Svetlin Ankov    2016-01-13  155  	char vid_string[64];
8db00736d365b75 Svetlin Ankov    2016-01-13  156  	char pid_string[64];
d0af1bd5f6f4497 Pankaj Bharadiya 2016-10-16  157  	char intf_id_string[64];
a9234bfd6cec442 Vaibhav Agarwal  2016-03-30  158  	char ip_devices_string[64];
a9234bfd6cec442 Vaibhav Agarwal  2016-03-30  159  	char op_devices_string[64];
8db00736d365b75 Svetlin Ankov    2016-01-13  160  
a33c60996e08817 Matthew Zvolsky  2026-09-11  161  	static const char * const envp[] = {
8db00736d365b75 Svetlin Ankov    2016-01-13 @162  		name_string,
8db00736d365b75 Svetlin Ankov    2016-01-13  163  		vid_string,
8db00736d365b75 Svetlin Ankov    2016-01-13  164  		pid_string,
d0af1bd5f6f4497 Pankaj Bharadiya 2016-10-16  165  		intf_id_string,
a9234bfd6cec442 Vaibhav Agarwal  2016-03-30  166  		ip_devices_string,
a9234bfd6cec442 Vaibhav Agarwal  2016-03-30  167  		op_devices_string,
8db00736d365b75 Svetlin Ankov    2016-01-13  168  		NULL
8db00736d365b75 Svetlin Ankov    2016-01-13  169  	};
8db00736d365b75 Svetlin Ankov    2016-01-13  170  
8db00736d365b75 Svetlin Ankov    2016-01-13  171  	snprintf(name_string, 128, "NAME=%s", module->desc.name);
8db00736d365b75 Svetlin Ankov    2016-01-13  172  	snprintf(vid_string, 64, "VID=%d", module->desc.vid);
8db00736d365b75 Svetlin Ankov    2016-01-13  173  	snprintf(pid_string, 64, "PID=%d", module->desc.pid);
d0af1bd5f6f4497 Pankaj Bharadiya 2016-10-16  174  	snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id);
a9234bfd6cec442 Vaibhav Agarwal  2016-03-30  175  	snprintf(ip_devices_string, 64, "I/P DEVICES=0x%X",
a9234bfd6cec442 Vaibhav Agarwal  2016-03-30  176  		 module->desc.ip_devices);
a9234bfd6cec442 Vaibhav Agarwal  2016-03-30  177  	snprintf(op_devices_string, 64, "O/P DEVICES=0x%X",
a9234bfd6cec442 Vaibhav Agarwal  2016-03-30  178  		 module->desc.op_devices);
8db00736d365b75 Svetlin Ankov    2016-01-13  179  
8db00736d365b75 Svetlin Ankov    2016-01-13 @180  	kobject_uevent_env(&module->kobj, KOBJ_ADD, envp);
8db00736d365b75 Svetlin Ankov    2016-01-13  181  }
8db00736d365b75 Svetlin Ankov    2016-01-13  182  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2026-09-12  7:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 19:02 [PATCH] staging: greybus: add missing newlines to sysfs_emit Matthew Zvolsky
2026-09-11 19:36 ` Dan Carpenter
2026-09-12  7:10 ` kernel test robot
2026-09-12  7:51 ` kernel test robot

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

all inboxes | Powered by JetHome®