Skip to contentSkip to conversation

pinctrl: stm32: Implement .pin_config_dbg_show()

DISCUSSION Dan Carpenter 2 participants 2 messages May 17, 2016 GPIO

lore
Share & tools
lore
#0 lore raw

Hello Patrice Chotard,

The patch 3beed93c1617: "pinctrl: stm32: Implement .pin_config_dbg_show()" from Apr 29, 2016, leads to the following static checker warning:

	drivers/pinctrl/stm32/pinctrl-stm32.c:798 stm32_pconf_dbg_show()
	warn: excess argument passed to 'seq_printf'

drivers/pinctrl/stm32/pinctrl-stm32.c
781 /* output */
782 case 1:

   783                  drive = stm32_pconf_get_driving(bank, offset);
   784                  speed = stm32_pconf_get_speed(bank, offset);
   785                  val = stm32_pconf_output_get(bank, offset);
   786                  seq_printf(s, "- %s - %s - %s - %s %s",
   787                             val ? "high" : "low",
   788                             drive ? "open drain" : "push pull",
   789                             biasing[bias],
   790                             speeds[speed], "speed");
   791                  break;
   792  
   793          /* alternate */
   794          case 2:
   795                  drive = stm32_pconf_get_driving(bank, offset);
   796                  speed = stm32_pconf_get_speed(bank, offset);
   797                  seq_printf(s, "%d - %s -%s", alt,
   798                             drive ? "open drain" : "push pull",
   799                             biasing[bias],
   800                             speeds[speed], "speed");

Yup. Too many arguments. Also do you want a space between "-%s"?

801 break;
802
803 /* analog */
804 case 3:
805 break;
806 }

regards,
dan carpenter

#1 lore raw

Hi Dan

I have already send a fix for this to the mailing list:

_ [PATCH 0/2] pinctrl: stm32: .pin_config_dbg_show fixes

Sorry for that

Patrice

Quoted 42 lines · Dan Carpenter

Hello Patrice Chotard,

The patch 3beed93c1617: "pinctrl: stm32: Implement .pin_config_dbg_show()" from Apr 29, 2016, leads to the following static checker warning:

	drivers/pinctrl/stm32/pinctrl-stm32.c:798 stm32_pconf_dbg_show()
	warn: excess argument passed to 'seq_printf'

drivers/pinctrl/stm32/pinctrl-stm32.c

    781          /* output */
    782          case 1:
    783                  drive = stm32_pconf_get_driving(bank, offset);
    784                  speed = stm32_pconf_get_speed(bank, offset);
    785                  val = stm32_pconf_output_get(bank, offset);
    786                  seq_printf(s, "- %s - %s - %s - %s %s",
    787                             val ? "high" : "low",
    788                             drive ? "open drain" : "push pull",
    789                             biasing[bias],
    790                             speeds[speed], "speed");
    791                  break;
    792
    793          /* alternate */
    794          case 2:
    795                  drive = stm32_pconf_get_driving(bank, offset);
    796                  speed = stm32_pconf_get_speed(bank, offset);
    797                  seq_printf(s, "%d - %s -%s", alt,
    798                             drive ? "open drain" : "push pull",
    799                             biasing[bias],
    800                             speeds[speed], "speed");

Yup. Too many arguments. Also do you want a space between "-%s"?

    801                  break;
    802
    803          /* analog */
    804          case 3:
    805                  break;
    806          }

regards,
dan carpenter