From patchwork Wed Apr 25 11:29:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 134243 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp741267lji; Wed, 25 Apr 2018 04:33:49 -0700 (PDT) X-Google-Smtp-Source: AIpwx48432B3yDThOEZB5RERsP3dufhxYIGL2g+a3TngOGBwZCAopxernFKVkjbZBe94uvNFd1xy X-Received: by 10.98.118.130 with SMTP id r124mr27552294pfc.80.1524656029672; Wed, 25 Apr 2018 04:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524656029; cv=none; d=google.com; s=arc-20160816; b=A2j5fSF7CwC7UVW8CmsnUO7BBx4XQymoITunTqFXdP2hK6CVbcVe+yE1a/9MbwkB8H p6wp2am24P7oSCE5a7ogPEaxzS6ttBJLIpTVh60GV3Trwcy019MnGdn9+Mh0SWdu9k96 Oi3Q7/XFwFGHXF9/W7Pj/tfAiFqh6KxKtX6g1fZE9dtTbge2svUBUV5KA2immUgcLXP3 yjvSXTpQlZPRETmCf1oP8113w4gtuQUIlVBVqZBv1X2AnNVjVy0a47WMkVL/s0c1wP/R ZD1rd4EQMkjISBC4OXpApp3wX4g5863PuCFN0mtTe8NGFzI6imZ6oMPfBOH6OC4wTbhF HHvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=V94cTQjiwFKRqkQbaK0rq4rE8q5tDuDYLiYIO12Yvt4=; b=ioHUC0VL/eXENTBOG8Q2Qi7zt+eMjBh2ByqXR37vkBPo0TDVQMr7HkLpARTtWhDo3n UfXUsqYWLkBKh2sFeUl36SPfHQbsT2qaDOgg/N6MaIPNXG9/2vVvzngA++E/DUaYkz5l 5/xJ1jJG1qVksN66uCuMDgbivwJMdhM8LDVG1gtdFXxSj/s1dgHvAf1SUVCN2TElRfEg RMUPItGNXwPdy+rjP5DzUQkv9+IDC2dEXay0atE+GyK6ppnqq8VnqZ6L6ZRB7bhFebVQ Xi2QVO3deNX/PqH6YZtNrgmzRtyDALJz5wdoWZmXI5zETuLKO0Wx01N8rK6OpuaNuWKR OBBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6si3725911pfk.194.2018.04.25.04.33.49; Wed, 25 Apr 2018 04:33:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753273AbeDYLdq (ORCPT + 29 others); Wed, 25 Apr 2018 07:33:46 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:7204 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752868AbeDYLdo (ORCPT ); Wed, 25 Apr 2018 07:33:44 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A9506E410F2AE; Wed, 25 Apr 2018 19:33:29 +0800 (CST) Received: from localhost (10.177.23.164) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.361.1; Wed, 25 Apr 2018 19:33:23 +0800 From: Zhen Lei To: Mark Fasheh , Joel Becker , ocfs2-devel , linux-kernel CC: Hanjun Guo , Libin , "Kefeng Wang" , Zhen Lei Subject: [PATCH 1/1] ocfs2: eliminate a misreported warning Date: Wed, 25 Apr 2018 19:29:59 +0800 Message-ID: <1524655799-12112-1-git-send-email-thunder.leizhen@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.23.164] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Below warning can not be happened, because the parameter chunksize passed from ocfs2_info_freefrag_scan_chain-->ocfs2_info_update_ffg is guaranteed to be positive. So __ilog2_u32 is impossible return -1. fs/ocfs2/ioctl.c: In function 'ocfs2_info_update_ffg': fs/ocfs2/ioctl.c:411:17: warning: array subscript is below array bounds [-Warray-bounds] hist->fc_chunks[index]++; ^ fs/ocfs2/ioctl.c:411:17: warning: array subscript is below array bounds [-Warray-bounds] Signed-off-by: Zhen Lei --- fs/ocfs2/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.3 diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c index ab30c005..994726a 100644 --- a/fs/ocfs2/ioctl.c +++ b/fs/ocfs2/ioctl.c @@ -402,7 +402,7 @@ static int ocfs2_info_handle_freeinode(struct inode *inode, static void o2ffg_update_histogram(struct ocfs2_info_free_chunk_list *hist, unsigned int chunksize) { - int index; + u32 index; index = __ilog2_u32(chunksize); if (index >= OCFS2_INFO_MAX_HIST)