All of lore.kernel.org
 help / color / mirror / Atom feed
* [frank-w-bpi-r2-4.14:5.15-bpi-r2-pro 90/90] drivers/gpu/drm/bridge/display-connector.c:274:17: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'int'
@ 2021-10-15  1:55 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-10-15  1:55 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 17652 bytes --]

tree:   https://github.com/frank-w/BPI-R2-4.14 5.15-bpi-r2-pro
head:   14a93e4b341569bdb9f0456c3934e62402a82174
commit: 14a93e4b341569bdb9f0456c3934e62402a82174 [90/90] more porting
config: h8300-buildonly-randconfig-r003-20211014 (attached as .config)
compiler: h8300-linux-gcc (GCC) 11.2.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://github.com/frank-w/BPI-R2-4.14/commit/14a93e4b341569bdb9f0456c3934e62402a82174
        git remote add frank-w-bpi-r2-4.14 https://github.com/frank-w/BPI-R2-4.14
        git fetch --no-tags frank-w-bpi-r2-4.14 5.15-bpi-r2-pro
        git checkout 14a93e4b341569bdb9f0456c3934e62402a82174
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=h8300 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/device.h:15,
                    from include/linux/acpi.h:15,
                    from include/linux/i2c.h:13,
                    from drivers/gpu/drm/bridge/display-connector.c:7:
   drivers/gpu/drm/bridge/display-connector.c: In function 'display_connector_probe':
   drivers/gpu/drm/bridge/display-connector.c:275:17: error: implicit declaration of function 'drm_get_connector_type_name'; did you mean 'drm_get_connector_name'? [-Werror=implicit-function-declaration]
     275 |                 drm_get_connector_type_name(conn->bridge.type),
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:129:48: note: in definition of macro 'dev_printk'
     129 |                 _dev_printk(level, dev, fmt, ##__VA_ARGS__);            \
         |                                                ^~~~~~~~~~~
   drivers/gpu/drm/bridge/display-connector.c:273:9: note: in expansion of macro 'dev_dbg'
     273 |         dev_dbg(&pdev->dev,
         |         ^~~~~~~
>> drivers/gpu/drm/bridge/display-connector.c:274:17: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'int' [-Wformat=]
     274 |                 "Found %s display connector '%s' %s DDC bus and %s HPD GPIO (ops 0x%x)\n",
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:129:41: note: in definition of macro 'dev_printk'
     129 |                 _dev_printk(level, dev, fmt, ##__VA_ARGS__);            \
         |                                         ^~~
   include/linux/dev_printk.h:163:45: note: in expansion of macro 'dev_fmt'
     163 |                 dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
         |                                             ^~~~~~~
   drivers/gpu/drm/bridge/display-connector.c:273:9: note: in expansion of macro 'dev_dbg'
     273 |         dev_dbg(&pdev->dev,
         |         ^~~~~~~
   drivers/gpu/drm/bridge/display-connector.c:274:25: note: format string is defined here
     274 |                 "Found %s display connector '%s' %s DDC bus and %s HPD GPIO (ops 0x%x)\n",
         |                        ~^
         |                         |
         |                         char *
         |                        %d
   cc1: some warnings being treated as errors


vim +274 drivers/gpu/drm/bridge/display-connector.c

0c275c30176b2e Laurent Pinchart 2020-02-26  105  
0c275c30176b2e Laurent Pinchart 2020-02-26  106  static int display_connector_probe(struct platform_device *pdev)
0c275c30176b2e Laurent Pinchart 2020-02-26  107  {
0c275c30176b2e Laurent Pinchart 2020-02-26  108  	struct display_connector *conn;
0c275c30176b2e Laurent Pinchart 2020-02-26  109  	unsigned int type;
0c275c30176b2e Laurent Pinchart 2020-02-26  110  	const char *label;
0c275c30176b2e Laurent Pinchart 2020-02-26  111  	int ret;
0c275c30176b2e Laurent Pinchart 2020-02-26  112  
0c275c30176b2e Laurent Pinchart 2020-02-26  113  	conn = devm_kzalloc(&pdev->dev, sizeof(*conn), GFP_KERNEL);
0c275c30176b2e Laurent Pinchart 2020-02-26  114  	if (!conn)
0c275c30176b2e Laurent Pinchart 2020-02-26  115  		return -ENOMEM;
0c275c30176b2e Laurent Pinchart 2020-02-26  116  
0c275c30176b2e Laurent Pinchart 2020-02-26  117  	platform_set_drvdata(pdev, conn);
0c275c30176b2e Laurent Pinchart 2020-02-26  118  
0c275c30176b2e Laurent Pinchart 2020-02-26  119  	type = (uintptr_t)of_device_get_match_data(&pdev->dev);
0c275c30176b2e Laurent Pinchart 2020-02-26  120  
0c275c30176b2e Laurent Pinchart 2020-02-26  121  	/* Get the exact connector type. */
0c275c30176b2e Laurent Pinchart 2020-02-26  122  	switch (type) {
0c275c30176b2e Laurent Pinchart 2020-02-26  123  	case DRM_MODE_CONNECTOR_DVII: {
0c275c30176b2e Laurent Pinchart 2020-02-26  124  		bool analog, digital;
0c275c30176b2e Laurent Pinchart 2020-02-26  125  
0c275c30176b2e Laurent Pinchart 2020-02-26  126  		analog = of_property_read_bool(pdev->dev.of_node, "analog");
0c275c30176b2e Laurent Pinchart 2020-02-26  127  		digital = of_property_read_bool(pdev->dev.of_node, "digital");
0c275c30176b2e Laurent Pinchart 2020-02-26  128  		if (analog && !digital) {
0c275c30176b2e Laurent Pinchart 2020-02-26  129  			conn->bridge.type = DRM_MODE_CONNECTOR_DVIA;
0c275c30176b2e Laurent Pinchart 2020-02-26  130  		} else if (!analog && digital) {
0c275c30176b2e Laurent Pinchart 2020-02-26  131  			conn->bridge.type = DRM_MODE_CONNECTOR_DVID;
0c275c30176b2e Laurent Pinchart 2020-02-26  132  		} else if (analog && digital) {
0c275c30176b2e Laurent Pinchart 2020-02-26  133  			conn->bridge.type = DRM_MODE_CONNECTOR_DVII;
0c275c30176b2e Laurent Pinchart 2020-02-26  134  		} else {
0c275c30176b2e Laurent Pinchart 2020-02-26  135  			dev_err(&pdev->dev, "DVI connector with no type\n");
0c275c30176b2e Laurent Pinchart 2020-02-26  136  			return -EINVAL;
0c275c30176b2e Laurent Pinchart 2020-02-26  137  		}
0c275c30176b2e Laurent Pinchart 2020-02-26  138  		break;
0c275c30176b2e Laurent Pinchart 2020-02-26  139  	}
0c275c30176b2e Laurent Pinchart 2020-02-26  140  
0c275c30176b2e Laurent Pinchart 2020-02-26  141  	case DRM_MODE_CONNECTOR_HDMIA: {
0c275c30176b2e Laurent Pinchart 2020-02-26  142  		const char *hdmi_type;
0c275c30176b2e Laurent Pinchart 2020-02-26  143  
0c275c30176b2e Laurent Pinchart 2020-02-26  144  		ret = of_property_read_string(pdev->dev.of_node, "type",
0c275c30176b2e Laurent Pinchart 2020-02-26  145  					      &hdmi_type);
0c275c30176b2e Laurent Pinchart 2020-02-26  146  		if (ret < 0) {
0c275c30176b2e Laurent Pinchart 2020-02-26  147  			dev_err(&pdev->dev, "HDMI connector with no type\n");
0c275c30176b2e Laurent Pinchart 2020-02-26  148  			return -EINVAL;
0c275c30176b2e Laurent Pinchart 2020-02-26  149  		}
0c275c30176b2e Laurent Pinchart 2020-02-26  150  
0c275c30176b2e Laurent Pinchart 2020-02-26  151  		if (!strcmp(hdmi_type, "a") || !strcmp(hdmi_type, "c") ||
0c275c30176b2e Laurent Pinchart 2020-02-26  152  		    !strcmp(hdmi_type, "d") || !strcmp(hdmi_type, "e")) {
0c275c30176b2e Laurent Pinchart 2020-02-26  153  			conn->bridge.type = DRM_MODE_CONNECTOR_HDMIA;
0c275c30176b2e Laurent Pinchart 2020-02-26  154  		} else if (!strcmp(hdmi_type, "b")) {
0c275c30176b2e Laurent Pinchart 2020-02-26  155  			conn->bridge.type = DRM_MODE_CONNECTOR_HDMIB;
0c275c30176b2e Laurent Pinchart 2020-02-26  156  		} else {
0c275c30176b2e Laurent Pinchart 2020-02-26  157  			dev_err(&pdev->dev,
0c275c30176b2e Laurent Pinchart 2020-02-26  158  				"Unsupported HDMI connector type '%s'\n",
0c275c30176b2e Laurent Pinchart 2020-02-26  159  				hdmi_type);
0c275c30176b2e Laurent Pinchart 2020-02-26  160  			return -EINVAL;
0c275c30176b2e Laurent Pinchart 2020-02-26  161  		}
0c275c30176b2e Laurent Pinchart 2020-02-26  162  
0c275c30176b2e Laurent Pinchart 2020-02-26  163  		break;
0c275c30176b2e Laurent Pinchart 2020-02-26  164  	}
0c275c30176b2e Laurent Pinchart 2020-02-26  165  
0c275c30176b2e Laurent Pinchart 2020-02-26  166  	default:
0c275c30176b2e Laurent Pinchart 2020-02-26  167  		conn->bridge.type = type;
0c275c30176b2e Laurent Pinchart 2020-02-26  168  		break;
0c275c30176b2e Laurent Pinchart 2020-02-26  169  	}
0c275c30176b2e Laurent Pinchart 2020-02-26  170  
0c275c30176b2e Laurent Pinchart 2020-02-26  171  	/* All the supported connector types support interlaced modes. */
0c275c30176b2e Laurent Pinchart 2020-02-26  172  	conn->bridge.interlace_allowed = true;
0c275c30176b2e Laurent Pinchart 2020-02-26  173  
0c275c30176b2e Laurent Pinchart 2020-02-26  174  	/* Get the optional connector label. */
0c275c30176b2e Laurent Pinchart 2020-02-26  175  	of_property_read_string(pdev->dev.of_node, "label", &label);
0c275c30176b2e Laurent Pinchart 2020-02-26  176  
0c275c30176b2e Laurent Pinchart 2020-02-26  177  	/*
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  178  	 * Get the HPD GPIO for DVI, HDMI and DP connectors. If the GPIO can provide
0c275c30176b2e Laurent Pinchart 2020-02-26  179  	 * edge interrupts, register an interrupt handler.
0c275c30176b2e Laurent Pinchart 2020-02-26  180  	 */
0c275c30176b2e Laurent Pinchart 2020-02-26  181  	if (type == DRM_MODE_CONNECTOR_DVII ||
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  182  	    type == DRM_MODE_CONNECTOR_HDMIA ||
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  183  	    type == DRM_MODE_CONNECTOR_DisplayPort) {
0c275c30176b2e Laurent Pinchart 2020-02-26  184  		conn->hpd_gpio = devm_gpiod_get_optional(&pdev->dev, "hpd",
0c275c30176b2e Laurent Pinchart 2020-02-26  185  							 GPIOD_IN);
0c275c30176b2e Laurent Pinchart 2020-02-26  186  		if (IS_ERR(conn->hpd_gpio)) {
0c275c30176b2e Laurent Pinchart 2020-02-26  187  			if (PTR_ERR(conn->hpd_gpio) != -EPROBE_DEFER)
0c275c30176b2e Laurent Pinchart 2020-02-26  188  				dev_err(&pdev->dev,
0c275c30176b2e Laurent Pinchart 2020-02-26  189  					"Unable to retrieve HPD GPIO\n");
0c275c30176b2e Laurent Pinchart 2020-02-26  190  			return PTR_ERR(conn->hpd_gpio);
0c275c30176b2e Laurent Pinchart 2020-02-26  191  		}
0c275c30176b2e Laurent Pinchart 2020-02-26  192  
0c275c30176b2e Laurent Pinchart 2020-02-26  193  		conn->hpd_irq = gpiod_to_irq(conn->hpd_gpio);
0c275c30176b2e Laurent Pinchart 2020-02-26  194  	} else {
0c275c30176b2e Laurent Pinchart 2020-02-26  195  		conn->hpd_irq = -EINVAL;
0c275c30176b2e Laurent Pinchart 2020-02-26  196  	}
0c275c30176b2e Laurent Pinchart 2020-02-26  197  
0c275c30176b2e Laurent Pinchart 2020-02-26  198  	if (conn->hpd_irq >= 0) {
0c275c30176b2e Laurent Pinchart 2020-02-26  199  		ret = devm_request_threaded_irq(&pdev->dev, conn->hpd_irq,
0c275c30176b2e Laurent Pinchart 2020-02-26  200  						NULL, display_connector_hpd_irq,
0c275c30176b2e Laurent Pinchart 2020-02-26  201  						IRQF_TRIGGER_RISING |
0c275c30176b2e Laurent Pinchart 2020-02-26  202  						IRQF_TRIGGER_FALLING |
0c275c30176b2e Laurent Pinchart 2020-02-26  203  						IRQF_ONESHOT,
0c275c30176b2e Laurent Pinchart 2020-02-26  204  						"HPD", conn);
0c275c30176b2e Laurent Pinchart 2020-02-26  205  		if (ret) {
0c275c30176b2e Laurent Pinchart 2020-02-26  206  			dev_info(&pdev->dev,
0c275c30176b2e Laurent Pinchart 2020-02-26  207  				 "Failed to request HPD edge interrupt, falling back to polling\n");
0c275c30176b2e Laurent Pinchart 2020-02-26  208  			conn->hpd_irq = -EINVAL;
0c275c30176b2e Laurent Pinchart 2020-02-26  209  		}
0c275c30176b2e Laurent Pinchart 2020-02-26  210  	}
0c275c30176b2e Laurent Pinchart 2020-02-26  211  
0c275c30176b2e Laurent Pinchart 2020-02-26  212  	/* Retrieve the DDC I2C adapter for DVI, HDMI and VGA connectors. */
0c275c30176b2e Laurent Pinchart 2020-02-26  213  	if (type == DRM_MODE_CONNECTOR_DVII ||
0c275c30176b2e Laurent Pinchart 2020-02-26  214  	    type == DRM_MODE_CONNECTOR_HDMIA ||
0c275c30176b2e Laurent Pinchart 2020-02-26  215  	    type == DRM_MODE_CONNECTOR_VGA) {
0c275c30176b2e Laurent Pinchart 2020-02-26  216  		struct device_node *phandle;
0c275c30176b2e Laurent Pinchart 2020-02-26  217  
0c275c30176b2e Laurent Pinchart 2020-02-26  218  		phandle = of_parse_phandle(pdev->dev.of_node, "ddc-i2c-bus", 0);
0c275c30176b2e Laurent Pinchart 2020-02-26  219  		if (phandle) {
0c275c30176b2e Laurent Pinchart 2020-02-26  220  			conn->bridge.ddc = of_get_i2c_adapter_by_node(phandle);
0c275c30176b2e Laurent Pinchart 2020-02-26  221  			of_node_put(phandle);
0c275c30176b2e Laurent Pinchart 2020-02-26  222  			if (!conn->bridge.ddc)
0c275c30176b2e Laurent Pinchart 2020-02-26  223  				return -EPROBE_DEFER;
0c275c30176b2e Laurent Pinchart 2020-02-26  224  		} else {
0c275c30176b2e Laurent Pinchart 2020-02-26  225  			dev_dbg(&pdev->dev,
0c275c30176b2e Laurent Pinchart 2020-02-26  226  				"No I2C bus specified, disabling EDID readout\n");
0c275c30176b2e Laurent Pinchart 2020-02-26  227  		}
0c275c30176b2e Laurent Pinchart 2020-02-26  228  	}
0c275c30176b2e Laurent Pinchart 2020-02-26  229  
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  230  	/* Get the DP PWR for DP connector. */
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  231  	if (type == DRM_MODE_CONNECTOR_DisplayPort) {
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  232  		int ret;
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  233  
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  234  		conn->dp_pwr = devm_regulator_get_optional(&pdev->dev, "dp-pwr");
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  235  
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  236  		if (IS_ERR(conn->dp_pwr)) {
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  237  			ret = PTR_ERR(conn->dp_pwr);
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  238  
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  239  			switch (ret) {
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  240  			case -ENODEV:
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  241  				conn->dp_pwr = NULL;
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  242  				break;
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  243  
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  244  			case -EPROBE_DEFER:
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  245  				return -EPROBE_DEFER;
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  246  
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  247  			default:
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  248  				dev_err(&pdev->dev, "failed to get DP PWR regulator: %d\n", ret);
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  249  				return ret;
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  250  			}
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  251  		}
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  252  
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  253  		if (conn->dp_pwr) {
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  254  			ret = regulator_enable(conn->dp_pwr);
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  255  			if (ret) {
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  256  				dev_err(&pdev->dev, "failed to enable DP PWR regulator: %d\n", ret);
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  257  				return ret;
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  258  			}
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  259  		}
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  260  	}
2e2bf3a5584de2 Tomi Valkeinen   2020-11-30  261  
0c275c30176b2e Laurent Pinchart 2020-02-26  262  	conn->bridge.funcs = &display_connector_bridge_funcs;
0c275c30176b2e Laurent Pinchart 2020-02-26  263  	conn->bridge.of_node = pdev->dev.of_node;
0c275c30176b2e Laurent Pinchart 2020-02-26  264  
0c275c30176b2e Laurent Pinchart 2020-02-26  265  	if (conn->bridge.ddc)
0c275c30176b2e Laurent Pinchart 2020-02-26  266  		conn->bridge.ops |= DRM_BRIDGE_OP_EDID
0c275c30176b2e Laurent Pinchart 2020-02-26  267  				 |  DRM_BRIDGE_OP_DETECT;
0c275c30176b2e Laurent Pinchart 2020-02-26  268  	if (conn->hpd_gpio)
0c275c30176b2e Laurent Pinchart 2020-02-26  269  		conn->bridge.ops |= DRM_BRIDGE_OP_DETECT;
0c275c30176b2e Laurent Pinchart 2020-02-26  270  	if (conn->hpd_irq >= 0)
0c275c30176b2e Laurent Pinchart 2020-02-26  271  		conn->bridge.ops |= DRM_BRIDGE_OP_HPD;
0c275c30176b2e Laurent Pinchart 2020-02-26  272  
0c275c30176b2e Laurent Pinchart 2020-02-26  273  	dev_dbg(&pdev->dev,
0c275c30176b2e Laurent Pinchart 2020-02-26 @274  		"Found %s display connector '%s' %s DDC bus and %s HPD GPIO (ops 0x%x)\n",
0c275c30176b2e Laurent Pinchart 2020-02-26 @275  		drm_get_connector_type_name(conn->bridge.type),
0c275c30176b2e Laurent Pinchart 2020-02-26  276  		label ? label : "<unlabelled>",
0c275c30176b2e Laurent Pinchart 2020-02-26  277  		conn->bridge.ddc ? "with" : "without",
0c275c30176b2e Laurent Pinchart 2020-02-26  278  		conn->hpd_gpio ? "with" : "without",
0c275c30176b2e Laurent Pinchart 2020-02-26  279  		conn->bridge.ops);
0c275c30176b2e Laurent Pinchart 2020-02-26  280  
0c275c30176b2e Laurent Pinchart 2020-02-26  281  	drm_bridge_add(&conn->bridge);
0c275c30176b2e Laurent Pinchart 2020-02-26  282  
0c275c30176b2e Laurent Pinchart 2020-02-26  283  	return 0;
0c275c30176b2e Laurent Pinchart 2020-02-26  284  }
0c275c30176b2e Laurent Pinchart 2020-02-26  285  

:::::: The code at line 274 was first introduced by commit
:::::: 0c275c30176b2e7871c6ac5fb0ed548f81e0fa27 drm/bridge: Add bridge driver for display connectors

:::::: TO: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
:::::: CC: Tomi Valkeinen <tomi.valkeinen@ti.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35132 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-15  1:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15  1:55 [frank-w-bpi-r2-4.14:5.15-bpi-r2-pro 90/90] drivers/gpu/drm/bridge/display-connector.c:274:17: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'int' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.