Skip to contentSkip to conversation

Staging: comedi: Remove wrapper function definition

PATCH In review Evan Chime 2 participants 2 messages Oct 23, 2019 – Oct 24, 2019 Staging

lore
Share & tools
lore

Evan Chime

author
#0 lore raw

PATCH 2/7 Staging: comedi: Remove wrapper function definition

Remove wrapper function "comedi_buf_map_get" definition as part of remove all wrappers in drivers/staging/comedi/TODO, and replace reference of the wrapper function in the file with the wrapped code

---
 drivers/staging/comedi/comedi_buf.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/staging/comedi/comedi_buf.c +1 -7
index 3ef3ddabf139..b6a9b5840afb 100644
@@ -187,12 +187,6 @@ static void __comedi_buf_alloc(struct comedi_device *dev,
 	}
 }
 
-void comedi_buf_map_get(struct comedi_buf_map *bm)
-{
-	if (bm)
-		kref_get(&bm->refcount);
-}
-
 int comedi_buf_map_put(struct comedi_buf_map *bm)
 {
 	if (bm)
@@ -239,7 +233,7 @@ comedi_buf_map_from_subdev_get(struct comedi_subdevice *s)
 	bm = async->buf_map;
 	/* only want it if buffer pages allocated */
 	if (bm && bm->n_pages)
-		comedi_buf_map_get(bm);
+		kref_get(&bm->refcount);
 	else
 		bm = NULL;
 	spin_unlock_irqrestore(&s->spin_lock, flags);
Signature · 1 line
2.17.1
#1 lore raw
Quoted 14 lines · Evan Chime

Remove wrapper function "comedi_buf_map_get" definition as part of remove all wrappers in drivers/staging/comedi/TODO, and replace reference of the wrapper function in the file with the wrapped code

---
 drivers/staging/comedi/comedi_buf.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/staging/comedi/comedi_buf.c +0 -0
index 3ef3ddabf139..b6a9b5840afb 100644

drivers/staging/comedi/comedi_buf.c static void __comedi_buf_alloc(struct comedi_device *dev, · line 195

Quoted 9 lines
drivers/staging/comedi/comedi_buf.c +0 -6
@@ -187,12 +187,6 @@ static void __comedi_buf_alloc(struct comedi_device *dev,
 	}
 }
 
-void comedi_buf_map_get(struct comedi_buf_map *bm)
-{
-	if (bm)
-		kref_get(&bm->refcount);
-}
-

Again, removing the definition in patch 2 and a use in patch 3 doesn't look like the right thing to do.

julia

Quoted 20 lines
drivers/staging/comedi/comedi_buf.c +1 -2
 int comedi_buf_map_put(struct comedi_buf_map *bm)
 {
 	if (bm)
@@ -239,7 +233,7 @@ comedi_buf_map_from_subdev_get(struct comedi_subdevice *s)
 	bm = async->buf_map;
 	/* only want it if buffer pages allocated */
 	if (bm && bm->n_pages)
-		comedi_buf_map_get(bm);
+		kref_get(&bm->refcount);
 	else
 		bm = NULL;
 	spin_unlock_irqrestore(&s->spin_lock, flags);
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191023234335.GA4557%40ik-ubuntu.