From: Julia Lawall <julia@diku.dk>
To: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>,
alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 5/6] sound/core/pcm_compat.c: adjust array index
Date: Thu, 28 Jul 2011 12:46:05 +0000 [thread overview]
Message-ID: <1311857165-14780-6-git-send-email-julia@diku.dk> (raw)
In-Reply-To: <1311857165-14780-1-git-send-email-julia@diku.dk>
From: Julia Lawall <julia@diku.dk>
Convert array index from the loop bound to the loop index.
A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e1,e2,ar;
@@
for(e1 = 0; e1 < e2; e1++) { <...
ar[
- e2
+ e1
]
...> }
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
Not tested.
sound/core/pcm_compat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff -u -p a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -342,7 +342,7 @@ static int snd_pcm_ioctl_xfern_compat(st
kfree(bufs);
return -EFAULT;
}
- bufs[ch] = compat_ptr(ptr);
+ bufs[i] = compat_ptr(ptr);
bufptr++;
}
if (dir = SNDRV_PCM_STREAM_PLAYBACK)
next prev parent reply other threads:[~2011-07-28 12:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 12:46 [PATCH 0/6] adjust array index Julia Lawall
2011-07-28 12:46 ` [PATCH 1/6] net: " Julia Lawall
2011-08-01 9:27 ` David Miller
2011-07-28 12:46 ` [PATCH 2/6] drivers/media/dvb/dvb-usb/usb-urb.c: " Julia Lawall
2011-07-28 12:46 ` [PATCH 3/6] drivers/net/niu.c: " Julia Lawall
[not found] ` <1311857165-14780-4-git-send-email-julia-dAYI7NvHqcQ@public.gmane.org>
2011-08-01 9:27 ` David Miller
2011-07-28 12:46 ` [PATCH 4/6] drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c: " Julia Lawall
2011-07-28 12:46 ` Julia Lawall [this message]
2011-07-28 13:13 ` [PATCH 5/6] sound/core/pcm_compat.c: " Takashi Iwai
2011-07-28 17:03 ` [PATCH 0/6] " Joe Perches
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=1311857165-14780-6-git-send-email-julia@diku.dk \
--to=julia@diku.dk \
--cc=alsa-devel@alsa-project.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.de \
/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