Hi Tom, Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master] url: https://github.com/0day-ci/linux/commits/Tom-Herbert/exthdrs-Create-exthdrs_options-c/20190412-024542 config: sparc64-allyesconfig (attached as .config) compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 7.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 GCC_VERSION=7.2.0 make.cross ARCH=sparc64 All error/warnings (new ones prefixed by >>): net//ipv6/exthdrs_core.c: In function 'tlv_param_table_release': >> net//ipv6/exthdrs_core.c:429:2: error: implicit declaration of function >> 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration] vfree(tpt); ^~~~~ kvfree net//ipv6/exthdrs_core.c: In function '__tlv_set_proc': >> net//ipv6/exthdrs_core.c:471:8: error: implicit declaration of function >> 'vmalloc'; did you mean 'kvmalloc'? [-Werror=implicit-function-declaration] tpt = vmalloc(tlv_param_table_size(count)); ^~~~~~~ kvmalloc >> net//ipv6/exthdrs_core.c:471:6: warning: assignment makes pointer from >> integer without a cast [-Wint-conversion] tpt = vmalloc(tlv_param_table_size(count)); ^ net//ipv6/exthdrs_core.c: In function '__tlv_unset_proc': net//ipv6/exthdrs_core.c:507:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion] tpt = vmalloc(tlv_param_table_size(old->count - 1)); ^ net//ipv6/exthdrs_core.c: In function 'exthdrs_init': net//ipv6/exthdrs_core.c:659:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion] tpt = vmalloc(tsize); ^ cc1: some warnings being treated as errors vim +429 net//ipv6/exthdrs_core.c 423 424 static void tlv_param_table_release(struct rcu_head *rcu) 425 { 426 struct tlv_param_table_data *tpt = 427 container_of(rcu, struct tlv_param_table_data, rcu); 428 > 429 vfree(tpt); 430 } 431 432 /* Default (unset) values for TLV parameters */ 433 static const struct tlv_proc tlv_default_proc = { 434 .params.rx_class = 0, 435 }; 436 437 static size_t tlv_param_table_size(unsigned char count) 438 { 439 return sizeof(struct tlv_param_table_data) + 440 (count * sizeof(struct tlv_proc)); 441 } 442 443 static DEFINE_MUTEX(tlv_mutex); 444 445 /* mutex held */ 446 static int __tlv_set_proc(struct tlv_param_table *tlv_param_table, 447 unsigned char type, const struct tlv_ops *ops, 448 const struct tlv_params *params) 449 { 450 struct tlv_param_table_data *tpt, *old; 451 struct tlv_proc *tproc; 452 unsigned char count, pos; 453 454 old = rcu_dereference_protected(tlv_param_table->data, 455 lockdep_is_held(&tlv_mutex)); 456 457 if (old->entries[type]) { 458 /* Type is already set, modifying entry */ 459 pos = old->entries[type]; 460 count = old->count; 461 462 /* If ops is not provided, take them from existing proc */ 463 if (!ops) 464 ops = &old->procs[pos].ops; 465 } else { 466 /* Type entry unset, need to create new entry */ 467 pos = old->count; 468 count = pos + 1; 469 } 470 > 471 tpt = vmalloc(tlv_param_table_size(count)); 472 if (!tpt) 473 return -ENOMEM; 474 475 memcpy(tpt, old, tlv_param_table_size(old->count)); 476 477 tproc = &tpt->procs[pos]; 478 tproc->params = *params; 479 tproc->ops = ops ? *ops : tlv_default_proc.ops; 480 481 tpt->entries[type] = pos; 482 tpt->count = count; 483 484 rcu_assign_pointer(tlv_param_table->data, tpt); 485 486 call_rcu(&old->rcu, tlv_param_table_release); 487 488 return 0; 489 } 490 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
.config.gz
Description: application/gzip