Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp204011pxb; Sat, 20 Feb 2021 00:26:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJznvPNdhC9ycG3fYjwGcjL6cNrgwzszF8CVGjY7gARLMPGAS4L0fdindpQAnam/FFzoB4wf X-Received: by 2002:a17:906:d214:: with SMTP id w20mr12432962ejz.284.1613809591333; Sat, 20 Feb 2021 00:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613809591; cv=none; d=google.com; s=arc-20160816; b=kObl5JL/jEILriP1+EXINN1tDMBrrFK/KTYv+LeyUCxW34mpa/Zy+Iu0FykMSRbgRl ch1LfagJHJ3FoaOFyXTq+qDEDPdJayExuGQoZZGnIwucUpeYRa5CbDFohRmc5wCEApIt 2Z4kqgJxZhBItoTTEKeugBFKNgb4G0PwxQKgbNv+jOdDF89MzyEOMGZ5HnSUQHpB7ZUC kb1MV6I2r1nZVjkA8D37YhMmfGh5mbMyRQ/GwGODD9NDNYSQNJKulC+7kEoa5shnSTv5 iVC/u71CDhszUbtRQT23lkOd3HkVirfP9CcFJULeMUdQMlF+dZjWCuDFM5H21UuAfnxa cy8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=3t7rR3ncf8WqJAmrDPAKSDS9qUqBluzqpX1/rVlQkQY=; b=JJXlr85n/NNmR80Wwiu9W2+3tDvVLJb7b44pJTKYDt5PQRb4hcVM+wW2HQW0i6eQo7 hrDooWTAUDwKEzIaGX6y65VLqfG0NAn6O7kvQcIbolcHaJCUbi+KkJQsntQAfUGU93rx Jp245B3uPm/TqJaWODVdQOP4JGtVJrQeGo95IJ3totmNF5mR9BElQN3IXBhf/i2IQGHz VFQX0/f0AnDGOw+SLvjxcPtzDnra67+pIa7kETDRwbiFxHyltsuNpRpxiiyJqD56Cm65 gxkNNMrJYwLesack0Gj/ns/Bzsz6PwHandUw3At9e2TiVg96RyiaU1OEfbu4EeuD5J4q xZoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p17si8255897edq.28.2021.02.20.00.26.07; Sat, 20 Feb 2021 00:26:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229614AbhBTIXY (ORCPT + 99 others); Sat, 20 Feb 2021 03:23:24 -0500 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:39975 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbhBTIXX (ORCPT ); Sat, 20 Feb 2021 03:23:23 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0UP0dKHK_1613809358; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UP0dKHK_1613809358) by smtp.aliyun-inc.com(127.0.0.1); Sat, 20 Feb 2021 16:22:38 +0800 From: Yang Li To: hca@linux.ibm.com Cc: gor@linux.ibm.com, borntraeger@de.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH] KVM: s390: use ARRAY_SIZE instead of division operation Date: Sat, 20 Feb 2021 16:22:37 +0800 Message-Id: <1613809357-89354-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This eliminates the following coccicheck warning: ./arch/s390/tools/gen_facilities.c:154:37-38: WARNING: Use ARRAY_SIZE ./arch/s390/tools/gen_opcode_table.c:141:39-40: WARNING: Use ARRAY_SIZE Reported-by: Abaci Robot Signed-off-by: Yang Li --- arch/s390/tools/gen_facilities.c | 2 +- arch/s390/tools/gen_opcode_table.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/tools/gen_facilities.c b/arch/s390/tools/gen_facilities.c index 61ce5b5..5366817 100644 --- a/arch/s390/tools/gen_facilities.c +++ b/arch/s390/tools/gen_facilities.c @@ -151,7 +151,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]); } diff --git a/arch/s390/tools/gen_opcode_table.c b/arch/s390/tools/gen_opcode_table.c index a1bc02b..468b70c 100644 --- a/arch/s390/tools/gen_opcode_table.c +++ b/arch/s390/tools/gen_opcode_table.c @@ -138,7 +138,7 @@ static struct insn_type *insn_format_to_type(char *format) strcpy(tmp, format); base_format = tmp; base_format = strsep(&base_format, "_"); - for (i = 0; i < sizeof(insn_type_table) / sizeof(insn_type_table[0]); i++) { + for (i = 0; i < ARRAY_SIZE(insn_type_table); i++) { ptr = insn_type_table[i].format; while (*ptr) { if (!strcmp(base_format, *ptr)) -- 1.8.3.1