Re: [PATCH] async_pq: Remove VLA usage

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

 



Hi Kyle,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on cryptodev/master]
[also build test ERROR on v4.17-rc3 next-20180504]
[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/Kyle-Spiers/async_pq-Remove-VLA-usage/20180505-012638
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: sparc64-allmodconfig (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
        make.cross ARCH=sparc64 

All error/warnings (new ones prefixed by >>):

   crypto/async_tx/raid6test.c: In function 'raid6_dual_recov':
>> crypto/async_tx/raid6test.c:89:13: error: implicit declaration of function 'kmalloc_array'; did you mean 'kvmalloc_array'? [-Werror=implicit-function-declaration]
       blocks = kmalloc_array(disks, sizeof(*blocks),
                ^~~~~~~~~~~~~
                kvmalloc_array
>> crypto/async_tx/raid6test.c:89:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
       blocks = kmalloc_array(disks, sizeof(*blocks),
              ^
>> crypto/async_tx/raid6test.c:109:4: error: implicit declaration of function 'kfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration]
       kfree(blocks);
       ^~~~~
       kvfree
   cc1: some warnings being treated as errors

vim +89 crypto/async_tx/raid6test.c

    66	
    67	/* Recover two failed blocks. */
    68	static void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, struct page **ptrs)
    69	{
    70		struct async_submit_ctl submit;
    71		struct completion cmp;
    72		struct dma_async_tx_descriptor *tx = NULL;
    73		enum sum_check_flags result = ~0;
    74	
    75		if (faila > failb)
    76			swap(faila, failb);
    77	
    78		if (failb == disks-1) {
    79			if (faila == disks-2) {
    80				/* P+Q failure.  Just rebuild the syndrome. */
    81				init_async_submit(&submit, 0, NULL, NULL, NULL, addr_conv);
    82				tx = async_gen_syndrome(ptrs, 0, disks, bytes, &submit);
    83			} else {
    84				struct page **blocks;
    85				struct page *dest;
    86				int count = 0;
    87				int i;
    88	
  > 89				blocks = kmalloc_array(disks, sizeof(*blocks),
    90								GFP_KERNEL);
    91				if (!blocks)
    92					return;
    93	
    94				/* data+Q failure.  Reconstruct data from P,
    95				 * then rebuild syndrome
    96				 */
    97				for (i = disks; i-- ; ) {
    98					if (i == faila || i == failb)
    99						continue;
   100					blocks[count++] = ptrs[i];
   101				}
   102				dest = ptrs[faila];
   103				init_async_submit(&submit, ASYNC_TX_XOR_ZERO_DST, NULL,
   104						  NULL, NULL, addr_conv);
   105				tx = async_xor(dest, blocks, 0, count, bytes, &submit);
   106	
   107				init_async_submit(&submit, 0, tx, NULL, NULL, addr_conv);
   108				tx = async_gen_syndrome(ptrs, 0, disks, bytes, &submit);
 > 109				kfree(blocks);
   110			}
   111		} else {
   112			if (failb == disks-2) {
   113				/* data+P failure. */
   114				init_async_submit(&submit, 0, NULL, NULL, NULL, addr_conv);
   115				tx = async_raid6_datap_recov(disks, bytes, faila, ptrs, &submit);
   116			} else {
   117				/* data+data failure. */
   118				init_async_submit(&submit, 0, NULL, NULL, NULL, addr_conv);
   119				tx = async_raid6_2data_recov(disks, bytes, faila, failb, ptrs, &submit);
   120			}
   121		}
   122		init_completion(&cmp);
   123		init_async_submit(&submit, ASYNC_TX_ACK, tx, callback, &cmp, addr_conv);
   124		tx = async_syndrome_val(ptrs, 0, disks, bytes, &result, spare, &submit);
   125		async_tx_issue_pending(tx);
   126	
   127		if (wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000)) == 0)
   128			pr("%s: timeout! (faila: %d failb: %d disks: %d)\n",
   129			   __func__, faila, failb, disks);
   130	
   131		if (result != 0)
   132			pr("%s: validation failure! faila: %d failb: %d sum_check_flags: %x\n",
   133			   __func__, faila, failb, result);
   134	}
   135	

---
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]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux