From f25c20b0e3c7f256102aa3c7b8d555aeffe41315 Mon Sep 17 00:00:00 2001
From: Alessandro Rubini <rubini@gnudd.com>
Date: Tue, 31 Jan 2012 18:04:11 +0100
Subject: [PATCH] general: remove or reword FIXME comments

Some of them don't apply any more (we made our choices, or the problem
has been addressed and fixed elsewhere). Some do but I reworded them.
Some still apply unchanged, and are not touched by this patch.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
---
 buffers/zio-buf-kmalloc.c   |  1 -
 include/linux/zio-buffer.h  |  3 ---
 include/linux/zio-sysfs.h   |  2 --
 include/linux/zio-trigger.h |  4 ----
 triggers/zio-trig-timer.c   |  1 -
 zio-cdev.c                  | 15 +++------------
 zio-sys.c                   |  6 ++----
 7 files changed, 5 insertions(+), 27 deletions(-)

diff --git a/buffers/zio-buf-kmalloc.c b/buffers/zio-buf-kmalloc.c
index 848c0f4..4cdc724 100644
--- a/buffers/zio-buf-kmalloc.c
+++ b/buffers/zio-buf-kmalloc.c
@@ -271,7 +271,6 @@ static int __init zbk_init(void)
 static void __exit zbk_exit(void)
 {
 	zio_unregister_buf(&zbk_buffer);
-	/* FIXME REMOVE all instances left */
 }
 
 /* This is the default buffer, and is part of zio-core: no module init/exit */
diff --git a/include/linux/zio-buffer.h b/include/linux/zio-buffer.h
index 28acf06..98b24e4 100644
--- a/include/linux/zio-buffer.h
+++ b/include/linux/zio-buffer.h
@@ -35,9 +35,6 @@ struct zio_buffer_type {
 
 	/* default attributes for instance */
 	struct zio_attribute_set		zattr_set;
-	/* FIXME: how "own" devices are listed (here or elsewhere?) */
-	struct zio_device	*zdev_owner;
-	unsigned int		n_zdev_owner;
 };
 #define to_zio_buf(ptr) container_of(ptr, struct zio_buffer_type, head.kobj)
 
diff --git a/include/linux/zio-sysfs.h b/include/linux/zio-sysfs.h
index 04bd60e..be021bb 100644
--- a/include/linux/zio-sysfs.h
+++ b/include/linux/zio-sysfs.h
@@ -91,8 +91,6 @@ extern const char zio_zdev_attr_names[ZATTR_STD_NUM_ZDEV][ZIO_NAME_LEN];
 extern const char zio_trig_attr_names[ZATTR_STD_NUM_TRIG][ZIO_NAME_LEN];
 extern const char zio_zbuf_attr_names[ZATTR_STD_NUM_ZBUF][ZIO_NAME_LEN];
 
-
-/* FIXME: check this DECLARE stuff */
 #define DEFINE_ZATTR_STD(_type, _name) struct zio_attribute \
 	_name[ZATTR_STD_NUM_##_type]
 
diff --git a/include/linux/zio-trigger.h b/include/linux/zio-trigger.h
index 0f48a8d..1ba07af 100644
--- a/include/linux/zio-trigger.h
+++ b/include/linux/zio-trigger.h
@@ -21,10 +21,6 @@ struct zio_trigger_type {
 
 	/* default attributes for instance */
 	struct zio_attribute_set		zattr_set;
-
-	/* FIXME: how "own" devices are listed (here or elsewhere?) */
-	struct zio_device	*zdev_owner;
-	unsigned int		n_zdev_owner;
 };
 #define to_zio_trig(ptr) container_of(ptr, struct zio_trigger_type, head.kobj)
 
diff --git a/triggers/zio-trig-timer.c b/triggers/zio-trig-timer.c
index 7cd386c..b5fefdb 100644
--- a/triggers/zio-trig-timer.c
+++ b/triggers/zio-trig-timer.c
@@ -77,7 +77,6 @@ static void ztt_fn(unsigned long arg)
 
 	/* When a trigger fires, we must prepare our control and timestamp */
 	getnstimeofday(&ti->tstamp);
-	/* FIXME: where is the jiffi count placed? */
 
 	ztt_instance = to_ztt_instance(ti);
 	zio_fire_trigger(ti);
diff --git a/zio-cdev.c b/zio-cdev.c
index fae5749..b6295ef 100644
--- a/zio-cdev.c
+++ b/zio-cdev.c
@@ -90,12 +90,8 @@ static inline void zio_device_put(dev_t devt)
 {
 	struct zio_channel *chan;
 
-	/*
-	 * FIXME there is a little concurrency; to resolve this, get the owner
-	 * from device list by searching by minor
-	 */
 	chan = __zio_minor_to_chan(devt);
-	/* it is impossbile chan = NULL because __zio_device_get() found it */
+	/* chan can't be NULL because __zio_device_get() found it */
 	module_put(chan->cset->zdev->owner);
 }
 
@@ -138,7 +134,6 @@ static int zio_f_open(struct inode *ino, struct file *f)
 		priv->type = ZIO_CDEV_CTRL;
 	f->private_data = priv;
 
-	/* replace zio fops with buffer fops (FIXME: make it a lib function */
 	mutex_lock(&zmutex);
 	old_fops = f->f_op;
 	new_fops = fops_get(zbuf->f_op);
@@ -378,10 +373,8 @@ ssize_t zio_generic_read(struct file *f, char __user *ubuf,
 	if (priv->type == ZIO_CDEV_CTRL && count < ZIO_CONTROL_SIZE)
 		return -EINVAL;
 
-	if ((bi->flags & ZIO_DIR) == ZIO_DIR_OUTPUT) {
-		/* FIXME: read_control for output channels is missing */
+	if ((bi->flags & ZIO_DIR) == ZIO_DIR_OUTPUT)
 		return -EINVAL;
-	}
 
 	if (!__zio_read_allowed(priv)) {
 		if (f->f_flags & O_NONBLOCK)
@@ -428,10 +421,8 @@ ssize_t zio_generic_write(struct file *f, const char __user *ubuf,
 	pr_debug("%s:%d type %s\n", __func__, __LINE__,
 		priv->type == ZIO_CDEV_CTRL ? "ctrl" : "data");
 
-	if ((bi->flags & ZIO_DIR) == ZIO_DIR_INPUT) {
-		/* FIXME: write_control for input channels is missing */
+	if ((bi->flags & ZIO_DIR) == ZIO_DIR_INPUT)
 		return -EINVAL;
-	}
 
 	if (!__zio_write_allowed(priv)) {
 		if (f->f_flags & O_NONBLOCK)
diff --git a/zio-sys.c b/zio-sys.c
index df08163..bd0d9ea 100644
--- a/zio-sys.c
+++ b/zio-sys.c
@@ -479,7 +479,6 @@ static int zio_change_current_trigger(struct zio_cset *cset, char *name)
 	struct zio_ti *ti, *ti_old = cset->ti;
 	int err;
 
-	/* FIXME I can change the trigger? check it! */
 	/* FIXME get all necessary spinlock */
 	pr_debug("%s\n", __func__);
 	if (strlen(name) > ZIO_OBJ_NAME_LEN)
@@ -529,7 +528,6 @@ static int zio_change_current_buffer(struct zio_cset *cset, char *name)
 	struct zio_bi **bi_vector;
 	int i, j, err;
 
-	/* FIXME I can change the buffer? check it! */
 	pr_debug("%s\n", __func__);
 	if (strlen(name) > ZIO_OBJ_NAME_LEN)
 		return -EINVAL; /* name too long */
@@ -1057,7 +1055,7 @@ static int __bi_register(struct zio_buffer_type *zbuf,
 	spin_unlock(&zbuf->lock);
 	bi->cset = chan->cset;
 	chan->bi = bi;
-	/* Done. This cset->bi marks everything is running (FIXME?) */
+	/* Done. This chan->bi marks everything is running (FIXME: audit) */
 	mb();
 	bi->chan = chan;
 
@@ -1154,7 +1152,7 @@ static int __ti_register(struct zio_trigger_type *trig, struct zio_cset *cset,
 	list_add(&ti->list, &trig->list);
 	spin_unlock(&trig->lock);
 	cset->ti = ti;
-	/* Done. This cset->ti marks everything is running (FIXME?) */
+	/* Done. This cset->ti marks everything is running (FIXME: audit) */
 	mb();
 	ti->cset = cset;
 
-- 
GitLab