Skip to contentSkip to conversation

mm/slab_common: Modify mismatched function name

PATCH NAK Jiapeng Chong 4 participants 4 messages Mar 28, 2024 – Apr 4, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/slab_common: Modify mismatched function name

No functional modification involved.

mm/slab_common.c:1215: warning: expecting prototype for krealloc(). Prototype was for krealloc_noprof() instead.

---
 mm/slab_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/slab_common.c +1 -1
index 8664da88e843..8af45e9bd2b2 100644
@@ -1199,7 +1199,7 @@ __do_krealloc(const void *p, size_t new_size, gfp_t flags)
 }
 
 /**
- * krealloc - reallocate memory. The contents will remain unchanged.
+ * krealloc_noprof - reallocate memory. The contents will remain unchanged.
  * @p: object to reallocate memory for.
  * @new_size: how many bytes of memory are required.
  * @flags: the type of memory to allocate.
Signature · 1 line
2.20.1.7.g153144c
#1 lore raw
Quoted 7 lines · Jiapeng Chong

No functional modification involved.

mm/slab_common.c:1215: warning: expecting prototype for krealloc(). Prototype was for krealloc_noprof() instead.

Seems like a fix-up for the alloc tagging series in mm.

Quoted 17 lines
---
 mm/slab_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/slab_common.c +1 -1
index 8664da88e843..8af45e9bd2b2 100644
@@ -1199,7 +1199,7 @@ __do_krealloc(const void *p, size_t new_size, gfp_t flags)
 }
 
 /**
- * krealloc - reallocate memory. The contents will remain unchanged.
+ * krealloc_noprof - reallocate memory. The contents will remain unchanged.
  * @p: object to reallocate memory for.
  * @new_size: how many bytes of memory are required.
  * @flags: the type of memory to allocate.
maintainer
#2 lore raw
In reply to Jiapeng Chong
Quoted 9 lines · On Thu, 28 Mar 2024 10:07:11 +0800 Jiapeng Chong…

No functional modification involved.

mm/slab_common.c:1215: warning: expecting prototype for krealloc(). Prototype was for krealloc_noprof() instead.

...

mm/slab_common.c __do_krealloc(const void *p, size_t new_size, gfp_t flags) · line 1205

Quoted 8 lines
mm/slab_common.c +1 -1
@@ -1199,7 +1199,7 @@ __do_krealloc(const void *p, size_t new_size, gfp_t flags)
 }
 
 /**
- * krealloc - reallocate memory. The contents will remain unchanged.
+ * krealloc_noprof - reallocate memory. The contents will remain unchanged.
  * @p: object to reallocate memory for.
  * @new_size: how many bytes of memory are required.
  * @flags: the type of memory to allocate.

Well ok, but krealloc_noprof() is just an internal implementation detail. I suggest this documentation be moved to the new krealloc() wrapper site. Because krealloc() remains the thing which people actually call.

Presumably the same applies to more of the new _noprof functions.

#3 lore raw
Quoted 14 lines · Andrew Morton
Quoted 11 lines · On Thu, 28 Mar 2024 10:07:11 +0800 Jiapeng Chong…

No functional modification involved.

mm/slab_common.c:1215: warning: expecting prototype for krealloc(). Prototype was for krealloc_noprof() instead.

...

mm/slab_common.c +0 -0
@@ -1199,7 +1199,7 @@ __do_krealloc(const void *p, size_t new_size, gfp_t flags)
 }
 
Quoted 6 lines

mm/slab_common.c __do_krealloc(const void *p, size_t new_size, gfp_t flags) · line 1205

Quoted 6 lines
mm/slab_common.c +1 -1
 /**
- * krealloc - reallocate memory. The contents will remain unchanged.
+ * krealloc_noprof - reallocate memory. The contents will remain unchanged.
  * @p: object to reallocate memory for.
  * @new_size: how many bytes of memory are required.
  * @flags: the type of memory to allocate.

Nack.

Quoted 7 lines

Well ok, but krealloc_noprof() is just an internal implementation detail. I suggest this documentation be moved to the new krealloc() wrapper site. Because krealloc() remains the thing which people actually call.

Presumably the same applies to more of the new _noprof functions.

We don't need this fixup. Randy Dunlap's change [1] should handle _noprof suffixes correctly. The warning was likely generated because his change was not yet picked up.

[1] https://lore.kernel.org/all/[email protected]/