[arm-platforms:hack/t6002-usb3 9/12] drivers/phy/apple/./trace.h:101:23: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'}

kernel test robot lkp at intel.com
Sat May 14 13:50:26 PDT 2022


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git hack/t6002-usb3
head:   30d2219bc762b9d23343007bb6c5ee5285ef4cf3
commit: 9a6e9c551badd748a2585fbd53b86113d280ec92 [9/12] WIP: atcphy
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20220515/202205150429.yUP98oM3-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 11.3.0
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://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?id=9a6e9c551badd748a2585fbd53b86113d280ec92
        git remote add arm-platforms https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git
        git fetch --no-tags arm-platforms hack/t6002-usb3
        git checkout 9a6e9c551badd748a2585fbd53b86113d280ec92
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash drivers/phy/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/trace/define_trace.h:102,
                    from drivers/phy/apple/trace.h:128,
                    from drivers/phy/apple/trace.c:3:
   drivers/phy/apple/./trace.h: In function 'trace_raw_output_atcphy_parsed_tunable':
>> drivers/phy/apple/./trace.h:101:23: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
     101 |             TP_printk("%s with %ld entries", __entry->name,
         |                       ^~~~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:203:34: note: in definition of macro 'DECLARE_EVENT_CLASS'
     203 |         trace_event_printf(iter, print);                                \
         |                                  ^~~~~
   include/trace/trace_events.h:45:30: note: in expansion of macro 'PARAMS'
      45 |                              PARAMS(print));                   \
         |                              ^~~~~~
   drivers/phy/apple/./trace.h:92:1: note: in expansion of macro 'TRACE_EVENT'
      92 | TRACE_EVENT(atcphy_parsed_tunable,
         | ^~~~~~~~~~~
   drivers/phy/apple/./trace.h:101:13: note: in expansion of macro 'TP_printk'
     101 |             TP_printk("%s with %ld entries", __entry->name,
         |             ^~~~~~~~~
   In file included from include/trace/trace_events.h:237,
                    from include/trace/define_trace.h:102,
                    from drivers/phy/apple/trace.h:128,
                    from drivers/phy/apple/trace.c:3:
   drivers/phy/apple/./trace.h:101:34: note: format string is defined here
     101 |             TP_printk("%s with %ld entries", __entry->name,
         |                                ~~^
         |                                  |
         |                                  long int
         |                                %d

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for APPLE_ADMAC
   Depends on DMADEVICES && (ARCH_APPLE || COMPILE_TEST
   Selected by
   - SND_SOC_APPLE_MCA && SOUND && !UML && SND && SND_SOC && (ARCH_APPLE || COMPILE_TEST


vim +101 drivers/phy/apple/./trace.h

    18	
    19	#define show_sw_orientation(orientation)                                  \
    20		__print_symbolic(orientation, { TYPEC_ORIENTATION_NONE, "none" }, \
    21				 { TYPEC_ORIENTATION_NORMAL, "normal" },          \
    22				 { TYPEC_ORIENTATION_REVERSE, "reverse" })
    23	
    24	TRACE_EVENT(atcphy_sw_set, TP_PROTO(enum typec_orientation orientation),
    25		    TP_ARGS(orientation),
    26	
    27		    TP_STRUCT__entry(__field(enum typec_orientation, orientation)),
    28	
    29		    TP_fast_assign(__entry->orientation = orientation;),
    30	
    31		    TP_printk("orientation: %s",
    32			      show_sw_orientation(__entry->orientation)));
    33	
    34	#define show_mux_state(state)                                                 \
    35		__print_symbolic(state->mode, { TYPEC_STATE_SAFE, "USB Safe State" }, \
    36				 { TYPEC_STATE_USB, "USB" })
    37	
    38	#define show_atcphy_mode(mode)                                      \
    39		__print_symbolic(mode, { APPLE_ATCPHY_MODE_OFF, "off" },    \
    40				 { APPLE_ATCPHY_MODE_USB2, "USB2" },        \
    41				 { APPLE_ATCPHY_MODE_USB3, "USB3" },        \
    42				 { APPLE_ATCPHY_MODE_USB3_DP, "DP + USB" }, \
    43				 { APPLE_ATCPHY_MODE_USB4, "USB4" },        \
    44				 { APPLE_ATCPHY_MODE_DP, "DP-only" })
    45	
    46	TRACE_EVENT(atcphy_usb3_set_mode,
    47		    TP_PROTO(struct apple_atcphy *atcphy, enum phy_mode mode,
    48			     int submode),
    49		    TP_ARGS(atcphy, mode, submode),
    50	
    51		    TP_STRUCT__entry(__field(enum atcphy_mode, mode)
    52					     __field(enum atcphy_mode, target_mode)
    53						     __field(enum phy_mode, phy_mode)
    54							     __field(int, submode)),
    55	
    56		    TP_fast_assign(__entry->mode = atcphy->mode;
    57				   __entry->target_mode = atcphy->target_mode;
    58				   __entry->phy_mode = mode;
    59				   __entry->submode = submode;),
    60	
    61		    TP_printk("mode: %s, target_mode: %s, phy_mode: %d, submode: %d",
    62			      show_atcphy_mode(__entry->mode),
    63			      show_atcphy_mode(__entry->target_mode), __entry->phy_mode,
    64			      __entry->submode));
    65	
    66	TRACE_EVENT(
    67		atcphy_configure_lanes,
    68		TP_PROTO(enum atcphy_mode mode,
    69			 const struct atcphy_mode_configuration *cfg),
    70		TP_ARGS(mode, cfg),
    71	
    72		TP_STRUCT__entry(__field(enum atcphy_mode, mode) __field(
    73			const struct atcphy_mode_configuration *, cfg)),
    74	
    75		TP_fast_assign(__entry->mode = mode; __entry->cfg = cfg;),
    76	
    77		TP_printk(
    78			"mode: %s, crossbar: 0x%02x, lanes: {0x%02x, 0x%02x}, swap: %d",
    79			show_atcphy_mode(__entry->mode), __entry->cfg->crossbar,
    80			__entry->cfg->lane_mode[0], __entry->cfg->lane_mode[1],
    81			__entry->cfg->set_swap));
    82	
    83	TRACE_EVENT(atcphy_mux_set, TP_PROTO(struct typec_mux_state *state),
    84		    TP_ARGS(state),
    85	
    86		    TP_STRUCT__entry(__field(struct typec_mux_state *, state)),
    87	
    88		    TP_fast_assign(__entry->state = state;),
    89	
    90		    TP_printk("state: %s", show_mux_state(__entry->state)));
    91	
    92	TRACE_EVENT(atcphy_parsed_tunable,
    93		    TP_PROTO(const char *name, struct atcphy_tunable *tunable),
    94		    TP_ARGS(name, tunable),
    95	
    96		    TP_STRUCT__entry(__field(const char *, name)
    97					     __field(struct atcphy_tunable *, tunable)),
    98	
    99		    TP_fast_assign(__entry->name = name; __entry->tunable = tunable;),
   100	
 > 101		    TP_printk("%s with %ld entries", __entry->name,
   102			      __entry->tunable->sz));
   103	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp



More information about the linux-arm-kernel mailing list