Message ID | 56879380.12c.1847049393b.Coremail.wangkailong@jari.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1613467wru; Sun, 13 Nov 2022 01:39:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf7X/ViDu66DEcpxEJ095IJRNrAPSB6kHVKSI/4SSXKIolOtJmRprhHGphvZL86IiLj0TPpB X-Received: by 2002:a50:fe88:0:b0:467:9f6b:d80 with SMTP id d8-20020a50fe88000000b004679f6b0d80mr3251154edt.18.1668332370764; Sun, 13 Nov 2022 01:39:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668332370; cv=none; d=google.com; s=arc-20160816; b=hF8XGxG/s942lh3p/mwAXNZAmTb3rzl7QsoNeJpNyhnj8GV2eBJQSPBi7flfMg7L6D IOJXOwZlA43QNtj1MgyIvFuT8jteMm2MZJmNjSi2pf49UXBpEuBCjFrRQ7C1FSXl/IBT /4WpwqbG80ChXqzAqQFpxRgl1woVra7cl58ErU6zmRuPWmHsMDk1la7mcE4jaAlXqYVD ZYeNidOQ/9iP+tduUrYIvS+DzcTmXlKJs5es9wZhoC0DJ+1em1tJzDGOM/T1aP7tCdLL TJhvTL3ZBKcgZancV5fVaPIGFVijLJDOGyutrgfiP/jSKqjucQc5Y9YOV8ZhmpHrl/KC rSKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=DJFlg7FFSGIfCTBl7qNRH0XgiuJaWQZo1Lh2StaK89Y=; b=zCvqqsGNBlTeTVZKjS5sA3Lqq8r6Ml4Y+W1ltDbqr16WSS17orW3Hx9V0XgJHHX91K 7PXU9A8al8RZ5u1iR1eI+nqwnDHXDLwv0r+iY+D/cDTB/hMLjcFMY5fkGh3tjMSwvFUP 9Wc8EjCPF74dizBl1PIFjowqn32q3B9efR7XjsE0B46TtMwx2ukigm7Kq/R70ZN3AUQt EJQ/P1HA+J86sFaPHn4bsUn+zzmWN7c4iaaboTcXiemAZTK5NXY4QuuUnVM5xNDXp+4h hZtpdAlxzcwlIiVAVZw9XicBi0uRdFbBePWE1cjoi8/NmJPuBLahk9+NUo152OASXphS orxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w19-20020a05640234d300b0046649cd87c2si8103696edc.32.2022.11.13.01.39.07; Sun, 13 Nov 2022 01:39:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235182AbiKMJYP (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Sun, 13 Nov 2022 04:24:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233029AbiKMJYN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 13 Nov 2022 04:24:13 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E20F912D01; Sun, 13 Nov 2022 01:24:12 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 13 Nov 2022 17:19:17 +0800 (GMT+08:00) X-Originating-IP: [182.148.14.167] Date: Sun, 13 Nov 2022 17:19:17 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: wangkailong@jari.cn To: hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, imbrenda@linux.ibm.com, thuth@redhat.com Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] KVM: s390: fix array_size.cocci warning X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn Content-Transfer-Encoding: base64 Content-Type: text/plain; charset=UTF-8 MIME-Version: 1.0 Message-ID: <56879380.12c.1847049393b.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwCXn+CVtnBjXxoDAA--.54W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQAEB2FEYx0DfwAQs1 X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VW7Jw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749373283924756281?= X-GMAIL-MSGID: =?utf-8?q?1749373283924756281?= |
Series |
KVM: s390: fix array_size.cocci warning
|
|
Commit Message
KaiLong Wang
Nov. 13, 2022, 9:19 a.m. UTC
Fix following coccicheck warning:
arch/s390/tools/gen_facilities.c:151:37-38: WARNING: Use ARRAY_SIZE
Signed-off-by: KaiLong Wang <wangkailong@jari.cn>
---
arch/s390/tools/gen_facilities.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi, Thank you for the patch! Yet something to improve: [auto build test ERROR on s390/features] [also build test ERROR on linus/master v6.1-rc4 next-20221111] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/wangkailong-jari-cn/KVM-s390-fix-array_size-cocci-warning/20221113-172457 base: https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features patch link: https://lore.kernel.org/r/56879380.12c.1847049393b.Coremail.wangkailong%40jari.cn patch subject: [PATCH] KVM: s390: fix array_size.cocci warning config: s390-randconfig-r044-20221113 compiler: s390-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/d0542ab32663c9e6759ed99998250b53300650c1 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review wangkailong-jari-cn/KVM-s390-fix-array_size-cocci-warning/20221113-172457 git checkout d0542ab32663c9e6759ed99998250b53300650c1 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 prepare If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All error/warnings (new ones prefixed by >>): arch/s390/tools/gen_facilities.c: In function 'print_facility_lists': >> arch/s390/tools/gen_facilities.c:151:25: warning: implicit declaration of function 'ARRAY_SIZE' [-Wimplicit-function-declaration] 151 | for (i = 0; i < ARRAY_SIZE(facility_defs); i++) | ^~~~~~~~~~ /usr/bin/ld: /tmp/cc82HgHl.o: in function `main': >> gen_facilities.c:(.text.startup+0x9a): undefined reference to `ARRAY_SIZE' collect2: error: ld returned 1 exit status make[2]: *** [scripts/Makefile.host:111: arch/s390/tools/gen_facilities] Error 1 make[2]: Target 'kapi' not remade because of errors. make[1]: *** [arch/s390/Makefile:151: archprepare] Error 2 make[1]: Target 'prepare' not remade because of errors. make: *** [Makefile:231: __sub-make] Error 2 make: Target 'prepare' not remade because of errors.
diff --git a/arch/s390/tools/gen_facilities.c b/arch/s390/tools/gen_facilities.c index cb0aff5c0187..f607e5092f8d 100644 --- a/arch/s390/tools/gen_facilities.c +++ b/arch/s390/tools/gen_facilities.c @@ -148,7 +148,7 @@ static void print_facility_lists(void) { unsigned int i; - for (i = 0; i < sizeof(facility_defs) / sizeof(facility_defs[0]); i++) + for (i = 0; i < ARRAY_SIZE(facility_defs); i++) print_facility_list(&facility_defs[i]); }