public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jiang, Dave" <dave.jiang@intel.com>
To: Paul Bolle <pebolle@tiscali.nl>
Cc: Dan Williams <djbw@fb.com>, "Koul, Vinod" <vinod.koul@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] ioatdma: silence GCC warnings
Date: Mon, 22 Jul 2013 15:46:36 +0000	[thread overview]
Message-ID: <1374507997.43171.7.camel@djiang5-linux2.ch.intel.com> (raw)
In-Reply-To: <1374343505.15242.12.camel@x61.thuisdomein>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1604 bytes --]

On Sat, 2013-07-20 at 20:05 +0200, Paul Bolle wrote:
> Building dma_v3.o triggers a GCC warning:
>     drivers/dma/ioat/dma_v3.c: In function ‘__ioat3_prep_pq16_lock’:
>     drivers/dma/ioat/dma_v3.c:264:11: warning: array subscript is below array bounds [-Warray-bounds]
>     drivers/dma/ioat/dma_v3.c:264:11: warning: array subscript is below array bounds [-Warray-bounds]
> 
> This warning is caused by pq16_set_src(). It uses "int idx" as an index
> to an eight element array. Changing "idx" to "unsigned" silences this
> warning. Apparently GCC can then determine that "idx" will never be
> negative.
> 
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>

Acked-by: Dave Jiang <dave.jiang@intel.com>

> ---
> 0) v2: cut back to a one hunk change, as Dan suggested.
> 
> 1) Still just compile tested.
> 
>  drivers/dma/ioat/dma_v3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
> index b642e03..2bb4601 100644
> --- a/drivers/dma/ioat/dma_v3.c
> +++ b/drivers/dma/ioat/dma_v3.c
> @@ -251,7 +251,7 @@ static bool is_bwd_noraid(struct pci_dev *pdev)
>  }
>  
>  static void pq16_set_src(struct ioat_raw_descriptor *desc[3],
> -			dma_addr_t addr, u32 offset, u8 coef, int idx)
> +			dma_addr_t addr, u32 offset, u8 coef, unsigned idx)
>  {
>  	struct ioat_pq_descriptor *pq = (struct ioat_pq_descriptor *)desc[0];
>  	struct ioat_pq16a_descriptor *pq16 =

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

      reply	other threads:[~2013-07-22 15:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-17 10:35 [PATCH] ioatdma: silence GCC warnings Paul Bolle
2013-07-15  9:50 ` Paul Bolle
2013-07-15  9:40   ` Vinod Koul
2013-07-17 22:39 ` Dan Williams
2013-07-18 11:42   ` Paul Bolle
2013-07-20 18:05     ` [PATCH v2] " Paul Bolle
2013-07-22 15:46       ` Jiang, Dave [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374507997.43171.7.camel@djiang5-linux2.ch.intel.com \
    --to=dave.jiang@intel.com \
    --cc=djbw@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pebolle@tiscali.nl \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox