Hi Richard,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master] [also build test WARNING on next-20171122] [cannot apply to ljones-mfd/for-mfd-next asoc/for-next v4.14] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Richard-Fitzgerald/Add-support-for-... config: blackfin-allyesconfig (attached as .config) compiler: bfin-uclinux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=blackfin
All warnings (new ones prefixed by >>):
drivers/mfd/madera-i2c.c: In function 'madera_i2c_probe':
drivers/mfd/madera-i2c.c:34:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (i2c->dev.of_node) ^~ drivers/mfd/madera-i2c.c:36:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' if (of_id) ^~
drivers/mfd/madera-i2c.c:37:31: warning: 'of_id' may be used uninitialized in this function [-Wmaybe-uninitialized]
type = (unsigned long)of_id->data; ~~~~~^~~~~~ -- drivers/mfd/madera-spi.c: In function 'madera_spi_probe':
drivers/mfd/madera-spi.c:34:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
if (spi->dev.of_node) ^~ drivers/mfd/madera-spi.c:36:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' if (of_id) ^~
drivers/mfd/madera-spi.c:37:31: warning: 'of_id' may be used uninitialized in this function [-Wmaybe-uninitialized]
type = (unsigned long)of_id->data; ~~~~~^~~~~~
vim +/if +34 drivers/mfd/madera-i2c.c
6d2961b1 Richard Fitzgerald 2017-11-20 22 6d2961b1 Richard Fitzgerald 2017-11-20 23 static int madera_i2c_probe(struct i2c_client *i2c, 6d2961b1 Richard Fitzgerald 2017-11-20 24 const struct i2c_device_id *id) 6d2961b1 Richard Fitzgerald 2017-11-20 25 { 6d2961b1 Richard Fitzgerald 2017-11-20 26 struct madera *madera; 6d2961b1 Richard Fitzgerald 2017-11-20 27 const struct regmap_config *regmap_16bit_config = NULL; 6d2961b1 Richard Fitzgerald 2017-11-20 28 const struct regmap_config *regmap_32bit_config = NULL; 6d2961b1 Richard Fitzgerald 2017-11-20 29 const struct of_device_id *of_id; 6d2961b1 Richard Fitzgerald 2017-11-20 30 unsigned long type = 0; 6d2961b1 Richard Fitzgerald 2017-11-20 31 const char *name; 6d2961b1 Richard Fitzgerald 2017-11-20 32 int ret; 6d2961b1 Richard Fitzgerald 2017-11-20 33 6d2961b1 Richard Fitzgerald 2017-11-20 @34 if (i2c->dev.of_node) 6d2961b1 Richard Fitzgerald 2017-11-20 35 of_id = of_match_device(madera_of_match, &i2c->dev); 6d2961b1 Richard Fitzgerald 2017-11-20 36 if (of_id) 6d2961b1 Richard Fitzgerald 2017-11-20 @37 type = (unsigned long)of_id->data; 6d2961b1 Richard Fitzgerald 2017-11-20 38 else 6d2961b1 Richard Fitzgerald 2017-11-20 39 type = id->driver_data; 6d2961b1 Richard Fitzgerald 2017-11-20 40 6d2961b1 Richard Fitzgerald 2017-11-20 41 switch (type) { 6d2961b1 Richard Fitzgerald 2017-11-20 42 case CS47L35: 6d2961b1 Richard Fitzgerald 2017-11-20 43 if (IS_ENABLED(CONFIG_MFD_CS47L35)) { 6d2961b1 Richard Fitzgerald 2017-11-20 44 regmap_16bit_config = &cs47l35_16bit_i2c_regmap; 6d2961b1 Richard Fitzgerald 2017-11-20 45 regmap_32bit_config = &cs47l35_32bit_i2c_regmap; 6d2961b1 Richard Fitzgerald 2017-11-20 46 } 6d2961b1 Richard Fitzgerald 2017-11-20 47 break; 6d2961b1 Richard Fitzgerald 2017-11-20 48 case CS47L85: 6d2961b1 Richard Fitzgerald 2017-11-20 49 case WM1840: 6d2961b1 Richard Fitzgerald 2017-11-20 50 if (IS_ENABLED(CONFIG_MFD_CS47L85)) { 6d2961b1 Richard Fitzgerald 2017-11-20 51 regmap_16bit_config = &cs47l85_16bit_i2c_regmap; 6d2961b1 Richard Fitzgerald 2017-11-20 52 regmap_32bit_config = &cs47l85_32bit_i2c_regmap; 6d2961b1 Richard Fitzgerald 2017-11-20 53 } 6d2961b1 Richard Fitzgerald 2017-11-20 54 break; 6d2961b1 Richard Fitzgerald 2017-11-20 55 case CS47L90: 6d2961b1 Richard Fitzgerald 2017-11-20 56 case CS47L91: 6d2961b1 Richard Fitzgerald 2017-11-20 57 if (IS_ENABLED(CONFIG_MFD_CS47L90)) { 6d2961b1 Richard Fitzgerald 2017-11-20 58 regmap_16bit_config = &cs47l90_16bit_i2c_regmap; 6d2961b1 Richard Fitzgerald 2017-11-20 59 regmap_32bit_config = &cs47l90_32bit_i2c_regmap; 6d2961b1 Richard Fitzgerald 2017-11-20 60 } 6d2961b1 Richard Fitzgerald 2017-11-20 61 break; 6d2961b1 Richard Fitzgerald 2017-11-20 62 default: 6d2961b1 Richard Fitzgerald 2017-11-20 63 dev_err(&i2c->dev, 6d2961b1 Richard Fitzgerald 2017-11-20 64 "Unknown Madera I2C device type %ld\n", type); 6d2961b1 Richard Fitzgerald 2017-11-20 65 return -EINVAL; 6d2961b1 Richard Fitzgerald 2017-11-20 66 } 6d2961b1 Richard Fitzgerald 2017-11-20 67 6d2961b1 Richard Fitzgerald 2017-11-20 68 name = madera_name_from_type(type); 6d2961b1 Richard Fitzgerald 2017-11-20 69 6d2961b1 Richard Fitzgerald 2017-11-20 70 if (!regmap_16bit_config) { 6d2961b1 Richard Fitzgerald 2017-11-20 71 dev_err(&i2c->dev, 6d2961b1 Richard Fitzgerald 2017-11-20 72 "Kernel does not include support for %s\n", name); 6d2961b1 Richard Fitzgerald 2017-11-20 73 return -EINVAL; 6d2961b1 Richard Fitzgerald 2017-11-20 74 } 6d2961b1 Richard Fitzgerald 2017-11-20 75 6d2961b1 Richard Fitzgerald 2017-11-20 76 madera = devm_kzalloc(&i2c->dev, sizeof(*madera), GFP_KERNEL); 6d2961b1 Richard Fitzgerald 2017-11-20 77 if (!madera) 6d2961b1 Richard Fitzgerald 2017-11-20 78 return -ENOMEM; 6d2961b1 Richard Fitzgerald 2017-11-20 79 6d2961b1 Richard Fitzgerald 2017-11-20 80 6d2961b1 Richard Fitzgerald 2017-11-20 81 madera->regmap = devm_regmap_init_i2c(i2c, regmap_16bit_config); 6d2961b1 Richard Fitzgerald 2017-11-20 82 if (IS_ERR(madera->regmap)) { 6d2961b1 Richard Fitzgerald 2017-11-20 83 ret = PTR_ERR(madera->regmap); 6d2961b1 Richard Fitzgerald 2017-11-20 84 dev_err(&i2c->dev, 6d2961b1 Richard Fitzgerald 2017-11-20 85 "Failed to allocate 16-bit register map: %d\n", ret); 6d2961b1 Richard Fitzgerald 2017-11-20 86 return ret; 6d2961b1 Richard Fitzgerald 2017-11-20 87 } 6d2961b1 Richard Fitzgerald 2017-11-20 88 6d2961b1 Richard Fitzgerald 2017-11-20 89 madera->regmap_32bit = devm_regmap_init_i2c(i2c, regmap_32bit_config); 6d2961b1 Richard Fitzgerald 2017-11-20 90 if (IS_ERR(madera->regmap_32bit)) { 6d2961b1 Richard Fitzgerald 2017-11-20 91 ret = PTR_ERR(madera->regmap_32bit); 6d2961b1 Richard Fitzgerald 2017-11-20 92 dev_err(&i2c->dev, 6d2961b1 Richard Fitzgerald 2017-11-20 93 "Failed to allocate 32-bit register map: %d\n", ret); 6d2961b1 Richard Fitzgerald 2017-11-20 94 return ret; 6d2961b1 Richard Fitzgerald 2017-11-20 95 } 6d2961b1 Richard Fitzgerald 2017-11-20 96 6d2961b1 Richard Fitzgerald 2017-11-20 97 madera->type = type; 6d2961b1 Richard Fitzgerald 2017-11-20 98 madera->type_name = name; 6d2961b1 Richard Fitzgerald 2017-11-20 99 madera->dev = &i2c->dev; 6d2961b1 Richard Fitzgerald 2017-11-20 100 madera->irq = i2c->irq; 6d2961b1 Richard Fitzgerald 2017-11-20 101 6d2961b1 Richard Fitzgerald 2017-11-20 102 return madera_dev_init(madera); 6d2961b1 Richard Fitzgerald 2017-11-20 103 } 6d2961b1 Richard Fitzgerald 2017-11-20 104
:::::: The code at line 34 was first introduced by commit :::::: 6d2961b15454236732cb14352de43abcda1c807f mfd: madera: Add common support for Cirrus Logic Madera codecs
:::::: TO: Richard Fitzgerald rf@opensource.wolfsonmicro.com :::::: CC: 0day robot fengguang.wu@intel.com
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation