From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751062AbdCNEpS (ORCPT ); Tue, 14 Mar 2017 00:45:18 -0400 Received: from mga14.intel.com ([192.55.52.115]:4069 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbdCNEpR (ORCPT ); Tue, 14 Mar 2017 00:45:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,162,1486454400"; d="scan'208";a="235721655" Date: Tue, 14 Mar 2017 10:13:20 +0530 From: Vinod Koul To: Matthias Kaehlcke Cc: Dan Williams , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Grant Grundler Subject: Re: [PATCH] dma-engine: Fix array index out of bounds warning in __get_unmap_pool() Message-ID: <20170314044320.GF2843@localhost> References: <20170313213029.98374-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170313213029.98374-1-mka@chromium.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 13, 2017 at 02:30:29PM -0700, Matthias Kaehlcke wrote: > This fixes the following warning when building with clang and > CONFIG_DMA_ENGINE_RAID=n : > > drivers/dma/dmaengine.c:1102:11: error: array index 2 is past the end of the array (which contains 1 element) [-Werror,-Warray-bounds] > return &unmap_pool[2]; > ^ ~ > drivers/dma/dmaengine.c:1083:1: note: array 'unmap_pool' declared here > static struct dmaengine_unmap_pool unmap_pool[] = { > ^ > drivers/dma/dmaengine.c:1104:11: error: array index 3 is past the end of the array (which contains 1 element) [-Werror,-Warray-bounds] > return &unmap_pool[3]; > ^ ~ > drivers/dma/dmaengine.c:1083:1: note: array 'unmap_pool' declared here > static struct dmaengine_unmap_pool unmap_pool[] = { Applied, thanks -- ~Vinod