Hi Bhumika, [auto build test WARNING on rdma/master] [also build test WARNING on v4.14-rc4 next-20171009] [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/Bhumika-Goyal/IB-cma-make-config_item_type-const/20171013-134956 base: https://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git master config: x86_64-randconfig-x018-201741 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): drivers/infiniband/core/cma_configfs.c: In function 'make_cma_ports': >> drivers/infiniband/core/cma_configfs.c:225:10: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] &cma_port_group_type); ^ In file included from drivers/infiniband/core/cma_configfs.c:34:0: include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *' extern void config_group_init_type_name(struct config_group *group, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/core/cma_configfs.c: In function 'make_cma_dev': drivers/infiniband/core/cma_configfs.c:301:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] &cma_ports_group_type); ^ In file included from drivers/infiniband/core/cma_configfs.c:34:0: include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *' extern void config_group_init_type_name(struct config_group *group, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/core/cma_configfs.c:308:9: warning: passing argument 3 of 'config_group_init_type_name' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] &cma_device_group_type); ^ In file included from drivers/infiniband/core/cma_configfs.c:34:0: include/linux/configfs.h:102:13: note: expected 'struct config_item_type *' but argument is of type 'const struct config_item_type *' extern void config_group_init_type_name(struct config_group *group, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/infiniband/core/cma_configfs.c: At top level: >> drivers/infiniband/core/cma_configfs.c:335:15: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] .ci_type = &cma_subsys_type, ^ Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64 Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64 Cyclomatic Complexity 1 include/linux/list.h:__list_add_valid Cyclomatic Complexity 2 include/linux/list.h:__list_add Cyclomatic Complexity 1 include/linux/list.h:list_add_tail Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR Cyclomatic Complexity 1 include/linux/configfs.h:configfs_add_default_group Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index Cyclomatic Complexity 68 include/linux/slab.h:kmalloc_large Cyclomatic Complexity 5 include/linux/slab.h:kmalloc Cyclomatic Complexity 5 include/linux/slab.h:kmalloc_array Cyclomatic Complexity 1 include/linux/slab.h:kcalloc Cyclomatic Complexity 1 include/linux/slab.h:kzalloc Cyclomatic Complexity 1 drivers/infiniband/core/cma_configfs.c:cma_configfs_params_put Cyclomatic Complexity 3 drivers/infiniband/core/cma_configfs.c:release_cma_dev Cyclomatic Complexity 3 drivers/infiniband/core/cma_configfs.c:release_cma_ports_group Cyclomatic Complexity 1 drivers/infiniband/core/cma_configfs.c:filter_by_name Cyclomatic Complexity 4 drivers/infiniband/core/cma_configfs.c:make_cma_ports Cyclomatic Complexity 5 drivers/infiniband/core/cma_configfs.c:make_cma_dev Cyclomatic Complexity 4 drivers/infiniband/core/cma_configfs.c:to_dev_port_group Cyclomatic Complexity 3 drivers/infiniband/core/cma_configfs.c:cma_configfs_params_get Cyclomatic Complexity 4 drivers/infiniband/core/cma_configfs.c:default_roce_tos_store Cyclomatic Complexity 2 drivers/infiniband/core/cma_configfs.c:default_roce_tos_show Cyclomatic Complexity 4 drivers/infiniband/core/cma_configfs.c:default_roce_mode_store Cyclomatic Complexity 3 drivers/infiniband/core/cma_configfs.c:default_roce_mode_show Cyclomatic Complexity 1 drivers/infiniband/core/cma_configfs.c:cma_configfs_init Cyclomatic Complexity 1 drivers/infiniband/core/cma_configfs.c:cma_configfs_exit vim +225 drivers/infiniband/core/cma_configfs.c 045959db Matan Barak 2015-12-23 193 045959db Matan Barak 2015-12-23 194 static int make_cma_ports(struct cma_dev_group *cma_dev_group, 045959db Matan Barak 2015-12-23 195 struct cma_device *cma_dev) 045959db Matan Barak 2015-12-23 196 { 045959db Matan Barak 2015-12-23 197 struct ib_device *ibdev; 045959db Matan Barak 2015-12-23 198 unsigned int i; 045959db Matan Barak 2015-12-23 199 unsigned int ports_num; 045959db Matan Barak 2015-12-23 200 struct cma_dev_port_group *ports; 045959db Matan Barak 2015-12-23 201 int err; 045959db Matan Barak 2015-12-23 202 045959db Matan Barak 2015-12-23 203 ibdev = cma_get_ib_dev(cma_dev); 045959db Matan Barak 2015-12-23 204 045959db Matan Barak 2015-12-23 205 if (!ibdev) 045959db Matan Barak 2015-12-23 206 return -ENODEV; 045959db Matan Barak 2015-12-23 207 045959db Matan Barak 2015-12-23 208 ports_num = ibdev->phys_port_cnt; 045959db Matan Barak 2015-12-23 209 ports = kcalloc(ports_num, sizeof(*cma_dev_group->ports), 045959db Matan Barak 2015-12-23 210 GFP_KERNEL); 045959db Matan Barak 2015-12-23 211 1ae1602d Christoph Hellwig 2016-02-26 212 if (!ports) { 045959db Matan Barak 2015-12-23 213 err = -ENOMEM; 045959db Matan Barak 2015-12-23 214 goto free; 045959db Matan Barak 2015-12-23 215 } 045959db Matan Barak 2015-12-23 216 045959db Matan Barak 2015-12-23 217 for (i = 0; i < ports_num; i++) { 045959db Matan Barak 2015-12-23 218 char port_str[10]; 045959db Matan Barak 2015-12-23 219 045959db Matan Barak 2015-12-23 220 ports[i].port_num = i + 1; 045959db Matan Barak 2015-12-23 221 snprintf(port_str, sizeof(port_str), "%u", i + 1); 045959db Matan Barak 2015-12-23 222 ports[i].cma_dev_group = cma_dev_group; 045959db Matan Barak 2015-12-23 223 config_group_init_type_name(&ports[i].group, 045959db Matan Barak 2015-12-23 224 port_str, 045959db Matan Barak 2015-12-23 @225 &cma_port_group_type); 1ae1602d Christoph Hellwig 2016-02-26 226 configfs_add_default_group(&ports[i].group, 1ae1602d Christoph Hellwig 2016-02-26 227 &cma_dev_group->ports_group); 1ae1602d Christoph Hellwig 2016-02-26 228 045959db Matan Barak 2015-12-23 229 } 045959db Matan Barak 2015-12-23 230 cma_dev_group->ports = ports; 045959db Matan Barak 2015-12-23 231 045959db Matan Barak 2015-12-23 232 return 0; 045959db Matan Barak 2015-12-23 233 free: 045959db Matan Barak 2015-12-23 234 kfree(ports); 045959db Matan Barak 2015-12-23 235 cma_dev_group->ports = NULL; 045959db Matan Barak 2015-12-23 236 return err; 045959db Matan Barak 2015-12-23 237 } 045959db Matan Barak 2015-12-23 238 045959db Matan Barak 2015-12-23 239 static void release_cma_dev(struct config_item *item) 045959db Matan Barak 2015-12-23 240 { 045959db Matan Barak 2015-12-23 241 struct config_group *group = container_of(item, struct config_group, 045959db Matan Barak 2015-12-23 242 cg_item); 045959db Matan Barak 2015-12-23 243 struct cma_dev_group *cma_dev_group = container_of(group, 045959db Matan Barak 2015-12-23 244 struct cma_dev_group, 045959db Matan Barak 2015-12-23 245 device_group); 045959db Matan Barak 2015-12-23 246 045959db Matan Barak 2015-12-23 247 kfree(cma_dev_group); 045959db Matan Barak 2015-12-23 248 }; 045959db Matan Barak 2015-12-23 249 045959db Matan Barak 2015-12-23 250 static void release_cma_ports_group(struct config_item *item) 045959db Matan Barak 2015-12-23 251 { 045959db Matan Barak 2015-12-23 252 struct config_group *group = container_of(item, struct config_group, 045959db Matan Barak 2015-12-23 253 cg_item); 045959db Matan Barak 2015-12-23 254 struct cma_dev_group *cma_dev_group = container_of(group, 045959db Matan Barak 2015-12-23 255 struct cma_dev_group, 045959db Matan Barak 2015-12-23 256 ports_group); 045959db Matan Barak 2015-12-23 257 045959db Matan Barak 2015-12-23 258 kfree(cma_dev_group->ports); 045959db Matan Barak 2015-12-23 259 cma_dev_group->ports = NULL; 045959db Matan Barak 2015-12-23 260 }; 045959db Matan Barak 2015-12-23 261 045959db Matan Barak 2015-12-23 262 static struct configfs_item_operations cma_ports_item_ops = { 045959db Matan Barak 2015-12-23 263 .release = release_cma_ports_group 045959db Matan Barak 2015-12-23 264 }; 045959db Matan Barak 2015-12-23 265 157120c0 Bhumika Goyal 2017-10-12 266 static const struct config_item_type cma_ports_group_type = { 045959db Matan Barak 2015-12-23 267 .ct_item_ops = &cma_ports_item_ops, 045959db Matan Barak 2015-12-23 268 .ct_owner = THIS_MODULE 045959db Matan Barak 2015-12-23 269 }; 045959db Matan Barak 2015-12-23 270 045959db Matan Barak 2015-12-23 271 static struct configfs_item_operations cma_device_item_ops = { 045959db Matan Barak 2015-12-23 272 .release = release_cma_dev 045959db Matan Barak 2015-12-23 273 }; 045959db Matan Barak 2015-12-23 274 157120c0 Bhumika Goyal 2017-10-12 275 static const struct config_item_type cma_device_group_type = { 045959db Matan Barak 2015-12-23 276 .ct_item_ops = &cma_device_item_ops, 045959db Matan Barak 2015-12-23 277 .ct_owner = THIS_MODULE 045959db Matan Barak 2015-12-23 278 }; 045959db Matan Barak 2015-12-23 279 045959db Matan Barak 2015-12-23 280 static struct config_group *make_cma_dev(struct config_group *group, 045959db Matan Barak 2015-12-23 281 const char *name) 045959db Matan Barak 2015-12-23 282 { 045959db Matan Barak 2015-12-23 283 int err = -ENODEV; 045959db Matan Barak 2015-12-23 284 struct cma_device *cma_dev = cma_enum_devices_by_ibdev(filter_by_name, 045959db Matan Barak 2015-12-23 285 (void *)name); 045959db Matan Barak 2015-12-23 286 struct cma_dev_group *cma_dev_group = NULL; 045959db Matan Barak 2015-12-23 287 045959db Matan Barak 2015-12-23 288 if (!cma_dev) 045959db Matan Barak 2015-12-23 289 goto fail; 045959db Matan Barak 2015-12-23 290 045959db Matan Barak 2015-12-23 291 cma_dev_group = kzalloc(sizeof(*cma_dev_group), GFP_KERNEL); 045959db Matan Barak 2015-12-23 292 045959db Matan Barak 2015-12-23 293 if (!cma_dev_group) { 045959db Matan Barak 2015-12-23 294 err = -ENOMEM; 045959db Matan Barak 2015-12-23 295 goto fail; 045959db Matan Barak 2015-12-23 296 } 045959db Matan Barak 2015-12-23 297 045959db Matan Barak 2015-12-23 298 strncpy(cma_dev_group->name, name, sizeof(cma_dev_group->name)); 045959db Matan Barak 2015-12-23 299 045959db Matan Barak 2015-12-23 300 config_group_init_type_name(&cma_dev_group->ports_group, "ports", 045959db Matan Barak 2015-12-23 301 &cma_ports_group_type); 045959db Matan Barak 2015-12-23 302 1ae1602d Christoph Hellwig 2016-02-26 303 err = make_cma_ports(cma_dev_group, cma_dev); 1ae1602d Christoph Hellwig 2016-02-26 304 if (err) 1ae1602d Christoph Hellwig 2016-02-26 305 goto fail; 045959db Matan Barak 2015-12-23 306 045959db Matan Barak 2015-12-23 307 config_group_init_type_name(&cma_dev_group->device_group, name, 045959db Matan Barak 2015-12-23 @308 &cma_device_group_type); 1ae1602d Christoph Hellwig 2016-02-26 309 configfs_add_default_group(&cma_dev_group->ports_group, 1ae1602d Christoph Hellwig 2016-02-26 310 &cma_dev_group->device_group); 045959db Matan Barak 2015-12-23 311 045959db Matan Barak 2015-12-23 312 cma_deref_dev(cma_dev); 045959db Matan Barak 2015-12-23 313 return &cma_dev_group->device_group; 045959db Matan Barak 2015-12-23 314 045959db Matan Barak 2015-12-23 315 fail: 045959db Matan Barak 2015-12-23 316 if (cma_dev) 045959db Matan Barak 2015-12-23 317 cma_deref_dev(cma_dev); 045959db Matan Barak 2015-12-23 318 kfree(cma_dev_group); 045959db Matan Barak 2015-12-23 319 return ERR_PTR(err); 045959db Matan Barak 2015-12-23 320 } 045959db Matan Barak 2015-12-23 321 045959db Matan Barak 2015-12-23 322 static struct configfs_group_operations cma_subsys_group_ops = { 045959db Matan Barak 2015-12-23 323 .make_group = make_cma_dev, 045959db Matan Barak 2015-12-23 324 }; 045959db Matan Barak 2015-12-23 325 157120c0 Bhumika Goyal 2017-10-12 326 static const struct config_item_type cma_subsys_type = { 045959db Matan Barak 2015-12-23 327 .ct_group_ops = &cma_subsys_group_ops, 045959db Matan Barak 2015-12-23 328 .ct_owner = THIS_MODULE, 045959db Matan Barak 2015-12-23 329 }; 045959db Matan Barak 2015-12-23 330 045959db Matan Barak 2015-12-23 331 static struct configfs_subsystem cma_subsys = { 045959db Matan Barak 2015-12-23 332 .su_group = { 045959db Matan Barak 2015-12-23 333 .cg_item = { 045959db Matan Barak 2015-12-23 334 .ci_namebuf = "rdma_cm", 045959db Matan Barak 2015-12-23 @335 .ci_type = &cma_subsys_type, 045959db Matan Barak 2015-12-23 336 }, 045959db Matan Barak 2015-12-23 337 }, 045959db Matan Barak 2015-12-23 338 }; 045959db Matan Barak 2015-12-23 339 :::::: The code at line 225 was first introduced by commit :::::: 045959db65c67d7189dc89ecddb5fa10aafa449d IB/cma: Add configfs for rdma_cm :::::: TO: Matan Barak <matanb@xxxxxxxxxxxx> :::::: CC: Doug Ledford <dledford@xxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip