diff mbox series

[v1,2/3] pwm: core: Drop unneeded casting in pwm_seq_show()

Message ID 20221101174255.54452-2-andriy.shevchenko@linux.intel.com
State Rejected
Headers show
Series [v1,1/3] pwm: core: Refactor pwmchip_add() to avoid extra checks | expand

Commit Message

Andy Shevchenko Nov. 1, 2022, 5:42 p.m. UTC
The casting form void * to char * is not needed and done implicitly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Nov. 1, 2022, 5:47 p.m. UTC | #1
On Tue, Nov 01, 2022 at 07:42:54PM +0200, Andy Shevchenko wrote:
> The casting form void * to char * is not needed and done implicitly.

This patch is wrong and it seems I have tried something like this in the past.
The rest in the series is okay.
kernel test robot Nov. 1, 2022, 8:53 p.m. UTC | #2
Hi Andy,

I love your patch! Perhaps something to improve:

[auto build test WARNING on thierry-reding-pwm/for-next]
[also build test WARNING on linus/master v6.1-rc3 next-20221101]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/pwm-core-Refactor-pwmchip_add-to-avoid-extra-checks/20221102-014412
base:   https://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git for-next
patch link:    https://lore.kernel.org/r/20221101174255.54452-2-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 2/3] pwm: core: Drop unneeded casting in pwm_seq_show()
config: i386-randconfig-a013
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/5e2a7f06a8d355d7dcc059703bb5990ae6358fef
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Andy-Shevchenko/pwm-core-Refactor-pwmchip_add-to-avoid-extra-checks/20221102-014412
        git checkout 5e2a7f06a8d355d7dcc059703bb5990ae6358fef
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/pwm/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/pwm/core.c:1192:46: warning: format specifies type 'char *' but the argument has type 'void *' [-Wformat]
           seq_printf(s, "%s%s/%s, %d PWM device%s\n", s->private,
                          ~~                           ^~~~~~~~~~
   1 warning generated.


vim +1192 drivers/pwm/core.c

  1187	
  1188	static int pwm_seq_show(struct seq_file *s, void *v)
  1189	{
  1190		struct pwm_chip *chip = list_entry(v, struct pwm_chip, list);
  1191	
> 1192		seq_printf(s, "%s%s/%s, %d PWM device%s\n", s->private,
  1193			   chip->dev->bus ? chip->dev->bus->name : "no-bus",
  1194			   dev_name(chip->dev), chip->npwm,
  1195			   (chip->npwm != 1) ? "s" : "");
  1196	
  1197		pwm_dbg_show(chip, s);
  1198	
  1199		return 0;
  1200	}
  1201
diff mbox series

Patch

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 855abd0a776f..36128f3301ac 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -1158,7 +1158,7 @@  static int pwm_seq_show(struct seq_file *s, void *v)
 {
 	struct pwm_chip *chip = list_entry(v, struct pwm_chip, list);
 
-	seq_printf(s, "%s%s/%s, %d PWM device%s\n", (char *)s->private,
+	seq_printf(s, "%s%s/%s, %d PWM device%s\n", s->private,
 		   chip->dev->bus ? chip->dev->bus->name : "no-bus",
 		   dev_name(chip->dev), chip->npwm,
 		   (chip->npwm != 1) ? "s" : "");