Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752643AbdIAVaO (ORCPT ); Fri, 1 Sep 2017 17:30:14 -0400 Received: from www17.your-server.de ([213.133.104.17]:36295 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752503AbdIAVaK (ORCPT ); Fri, 1 Sep 2017 17:30:10 -0400 From: Thomas Meyer To: linux-kernel@vger.kernel.org Cc: Thomas Meyer Subject: [PATCH 4/6] skd: Use ARRAY_SIZE macro Date: Fri, 1 Sep 2017 23:29:05 +0200 Message-Id: <20170901212907.5662-4-thomas@m3y3r.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170901212907.5662-1-thomas@m3y3r.de> References: <20170901212907.5662-1-thomas@m3y3r.de> X-Authenticated-Sender: thomas@m3y3r.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 778 Lines: 23 Found by a coccinelle run with: make coccicheck MODE=patch COCCI=scripts/coccinelle/misc/array_size.cocci Signed-off-by: Thomas Meyer --- drivers/block/skd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index d0368682bd43..623bc92bde5c 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -2275,7 +2275,7 @@ skd_check_status(struct skd_device *skdev, skerr->key, skerr->code, skerr->qual, skerr->fruc); /* Does the info match an entry in the good category? */ - n = sizeof(skd_chkstat_table) / sizeof(skd_chkstat_table[0]); + n = ARRAY_SIZE(skd_chkstat_table); for (i = 0; i < n; i++) { struct sns_info *sns = &skd_chkstat_table[i]; -- 2.11.0