[gpio:devel 48/49] drivers/gpio/gpiolib-of.c:132:7: note: in expansion of macro 'pr_info'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git devel
head:   4bc495008340e37a164a3e9345ba8c3ffc84f958
commit: 41f287e945adacbd68f3a1614b58c117da113741 [48/49] gpio: of: Handle SPI chipselect legacy bindings
config: x86_64-randconfig-x019-201836 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        git checkout 41f287e945adacbd68f3a1614b58c117da113741
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/list.h:9,
                    from include/linux/kobject.h:19,
                    from include/linux/device.h:16,
                    from drivers/gpio/gpiolib-of.c:14:
   drivers/gpio/gpiolib-of.c: In function 'of_gpio_flags_quirks':
>> include/linux/kern_levels.h:5:18: warning: format '%s' expects a matching 'char *' argument [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
>> drivers/gpio/gpiolib-of.c:132:7: note: in expansion of macro 'pr_info'
          pr_info("%s enforce active low on chipselect handle\n");
          ^~~~~~~
   drivers/gpio/gpiolib-of.c:132:17: note: format string is defined here
          pr_info("%s enforce active low on chipselect handle\n");
                   ~^
--
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/list.h:9,
                    from include/linux/kobject.h:19,
                    from include/linux/device.h:16,
                    from drivers//gpio/gpiolib-of.c:14:
   drivers//gpio/gpiolib-of.c: In function 'of_gpio_flags_quirks':
>> include/linux/kern_levels.h:5:18: warning: format '%s' expects a matching 'char *' argument [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:14:19: note: in expansion of macro 'KERN_SOH'
    #define KERN_INFO KERN_SOH "6" /* informational */
                      ^~~~~~~~
   include/linux/printk.h:315:9: note: in expansion of macro 'KERN_INFO'
     printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~~
   drivers//gpio/gpiolib-of.c:132:7: note: in expansion of macro 'pr_info'
          pr_info("%s enforce active low on chipselect handle\n");
          ^~~~~~~
   drivers//gpio/gpiolib-of.c:132:17: note: format string is defined here
          pr_info("%s enforce active low on chipselect handle\n");
                   ~^

vim +/pr_info +132 drivers/gpio/gpiolib-of.c

    58	
    59	static void of_gpio_flags_quirks(struct device_node *np,
    60					 enum of_gpio_flags *flags,
    61					 int index)
    62	{
    63		/*
    64		 * Some GPIO fixed regulator quirks.
    65		 * Note that active low is the default.
    66		 */
    67		if (IS_ENABLED(CONFIG_REGULATOR) &&
    68		    (of_device_is_compatible(np, "regulator-fixed") ||
    69		     of_device_is_compatible(np, "reg-fixed-voltage") ||
    70		     of_device_is_compatible(np, "regulator-gpio"))) {
    71			/*
    72			 * The regulator GPIO handles are specified such that the
    73			 * presence or absence of "enable-active-high" solely controls
    74			 * the polarity of the GPIO line. Any phandle flags must
    75			 * be actively ignored.
    76			 */
    77			if (*flags & OF_GPIO_ACTIVE_LOW) {
    78				pr_warn("%s GPIO handle specifies active low - ignored\n",
    79					of_node_full_name(np));
    80				*flags &= ~OF_GPIO_ACTIVE_LOW;
    81			}
    82			if (!of_property_read_bool(np, "enable-active-high"))
    83				*flags |= OF_GPIO_ACTIVE_LOW;
    84		}
    85		/*
    86		 * Legacy open drain handling for fixed voltage regulators.
    87		 */
    88		if (IS_ENABLED(CONFIG_REGULATOR) &&
    89		    of_device_is_compatible(np, "reg-fixed-voltage") &&
    90		    of_property_read_bool(np, "gpio-open-drain")) {
    91			*flags |= (OF_GPIO_SINGLE_ENDED | OF_GPIO_OPEN_DRAIN);
    92			pr_info("%s uses legacy open drain flag - update the DTS if you can\n",
    93				of_node_full_name(np));
    94		}
    95	
    96		/*
    97		 * Legacy handling of SPI active high chip select. If we have a
    98		 * property named "cs-gpios" we need to inspect the child node
    99		 * to determine if the flags should have inverted semantics.
   100		 */
   101		if (IS_ENABLED(CONFIG_SPI_MASTER) &&
   102		    of_property_read_bool(np, "cs-gpios")) {
   103			struct device_node *child;
   104			u32 cs;
   105			int ret;
   106	
   107			for_each_child_of_node(np, child) {
   108				ret = of_property_read_u32(child, "reg", &cs);
   109				if (!ret)
   110					continue;
   111				if (cs == index) {
   112					/*
   113					 * SPI children have active low chip selects
   114					 * by default. This can be specified negatively
   115					 * by just omitting "spi-cs-high" in the
   116					 * device node, or actively by tagging on
   117					 * GPIO_ACTIVE_LOW as flag in the device
   118					 * tree. If the line is simultaneously
   119					 * tagged as active low in the device tree
   120					 * and has the "spi-cs-high" set, we get a
   121					 * conflict and the "spi-cs-high" flag will
   122					 * take precedence.
   123					 */
   124					if (of_property_read_bool(np, "spi-cs-high")) {
   125						if (*flags & OF_GPIO_ACTIVE_LOW) {
   126							pr_warn("%s GPIO handle specifies active low - ignored\n",
   127								of_node_full_name(np));
   128							*flags &= ~OF_GPIO_ACTIVE_LOW;
   129						}
   130					} else {
   131						if (!(*flags & OF_GPIO_ACTIVE_LOW))
 > 132							pr_info("%s enforce active low on chipselect handle\n");
   133						*flags |= OF_GPIO_ACTIVE_LOW;
   134					}
   135					break;
   136				}
   137			}
   138		}
   139	}
   140	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux