Skip to contentSkip to conversation

kmemcheck: correctly remove kmemcheck call from dma_map_sg_attrs

PATCH In review Levin, Alexander (Sasha Levin) 2 participants 3 messages Oct 12, 2017 – Oct 13, 2017 DMA mapping helpers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kmemcheck: correctly remove kmemcheck call from dma_map_sg_attrs

We have missed removing some code as part of removing the kmemcheck hooks.

Unfourtenatly this got missed during my review, and the code was still building.

---
 include/linux/dma-mapping.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
include/linux/dma-mapping.h +1 -3
index 83f3ab31efc4..2911389bc147 100644
@@ -260,10 +260,8 @@ static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
 				   unsigned long attrs)
 {
 	const struct dma_map_ops *ops = get_dma_ops(dev);
-	int i, ents;
-	struct scatterlist *s;
+	int ents;
 
-	for_each_sg(sg, s, nents, i)
 	BUG_ON(!valid_dma_direction(dir));
 	ents = ops->map_sg(dev, sg, nents, dir, attrs);
 	BUG_ON(ents < 0);
Signature · 1 line
2.11.0
#1 lore raw
Quoted 8 lines · Sasha Levin

We have missed removing some code as part of removing the kmemcheck hooks.

Unfourtenatly this got missed during my review, and the code was still building.

Yes this would be the proper fix for the specific issue I have noticed. There might be others I haven't even checked. Really the only way to make this chage is to post a reproducible steps to regenerate your diff and review that the used scripts are correct. Follow up fixes are not a way to go

Quoted 22 lines
---
 include/linux/dma-mapping.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
include/linux/dma-mapping.h +1 -3
index 83f3ab31efc4..2911389bc147 100644
@@ -260,10 +260,8 @@ static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg,
 				   unsigned long attrs)
 {
 	const struct dma_map_ops *ops = get_dma_ops(dev);
-	int i, ents;
-	struct scatterlist *s;
+	int ents;
 
-	for_each_sg(sg, s, nents, i)
 	BUG_ON(!valid_dma_direction(dir));
 	ents = ops->map_sg(dev, sg, nents, dir, attrs);
 	BUG_ON(ents < 0);
Signature · 1 line
2.11.0
Signature · 2 lines
Michal Hocko
SUSE Labs
#2 lore raw
Quoted 7 lines · Michal Hocko
Quoted 6 lines · Sasha Levin

We have missed removing some code as part of removing the kmemcheck hooks.

Unfourtenatly this got missed during my review, and the code was still building.

Quoted 8 lines
Quoted 2 lines

Yes this would be the proper fix for the specific issue I have noticed. There might be others I haven't even checked. Really the only way to make this chage is to post a reproducible steps to regenerate your diff and review that the used scripts are correct. Follow up fixes are not a way to go

So the only part of this series that was scripted to some extend was this commit we're looking at. The 3 other commits are done manually (although their large size is mostly attributed to 'git rm').

Even for this commit, I don't see a way to have it completely scripted given that we're not simply removing calls.

I've looked at the ~50 deletions of kmemcheck calls in this commit to make sure they make sense.

Signature · 2 lines
Thanks,
Sasha