All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rbd-fuse: fix for loop in open_rbd_image()
@ 2013-02-06 11:17 Danny Al-Gaaf
  0 siblings, 0 replies; only message in thread
From: Danny Al-Gaaf @ 2013-02-06 11:17 UTC (permalink / raw)
  To: ceph-devel; +Cc: Danny Al-Gaaf, Sage Weil

Remove uninitialized usage of 'int i' as i++ from 'for' loop.
The variale 'i' is never used in this loop and initialized
before the next use with 0.

Related warning from clang++:

rbd_fuse/rbd-fuse.c:141:36: warning: variable 'i' is uninitialized
when used here [-Wuninitialized]
        for (im = rbd_images; im != NULL; i++, im = im->next) {

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
---
 src/rbd_fuse/rbd-fuse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rbd_fuse/rbd-fuse.c b/src/rbd_fuse/rbd-fuse.c
index 0b28f63..5bdaba3 100644
--- a/src/rbd_fuse/rbd-fuse.c
+++ b/src/rbd_fuse/rbd-fuse.c
@@ -138,7 +138,7 @@ open_rbd_image(const char *image_name)
 		return -1;
 
 	// relies on caller to keep rbd_images up to date
-	for (im = rbd_images; im != NULL; i++, im = im->next) {
+	for (im = rbd_images; im != NULL; im = im->next) {
 		if (strcmp(im->image_name, image_name) == 0) {
 			break;
 		}
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-02-06 11:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-06 11:17 [PATCH] rbd-fuse: fix for loop in open_rbd_image() Danny Al-Gaaf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.