Skip to contentSkip to conversation

lib/oid_registry.c: Remove unused sprint_OID

PATCH Applied [email protected] 1 participant 1 message May 1, 2025 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/oid_registry.c: Remove unused sprint_OID

From: "Dr. David Alan Gilbert" <[email protected]>

sprint_OID() was added as part of 2012's
commit 4f73175d0375 ("X.509: Add utility functions to render OIDs as strings")

but hasn't been used.

Remove it.

Note that there's also 'sprint_oid' (lower case) which is used in a lot of places; that's left as is except for fixing its case in a comment.

---
 include/linux/oid_registry.h |  1 -
 lib/oid_registry.c           | 25 +------------------------
 2 files changed, 1 insertion(+), 25 deletions(-)
include/linux/oid_registry.h +0 -1
index 6f9242259edc..6de479ebbe5d 100644
@@ -151,6 +151,5 @@ enum OID {
 extern enum OID look_up_OID(const void *data, size_t datasize);
 extern int parse_OID(const void *data, size_t datasize, enum OID *oid);
 extern int sprint_oid(const void *, size_t, char *, size_t);
-extern int sprint_OID(enum OID, char *, size_t);
 
 #endif /* _LINUX_OID_REGISTRY_H */
lib/oid_registry.c +1 -24
index fe6705cfd780..9b757a117f09 100644
@@ -117,7 +117,7 @@ int parse_OID(const void *data, size_t datasize, enum OID *oid)
 EXPORT_SYMBOL_GPL(parse_OID);
 
 /*
- * sprint_OID - Print an Object Identifier into a buffer
+ * sprint_oid - Print an Object Identifier into a buffer
  * @data: The encoded OID to print
  * @datasize: The size of the encoded OID
  * @buffer: The buffer to render into
@@ -173,26 +173,3 @@ int sprint_oid(const void *data, size_t datasize, char *buffer, size_t bufsize)
 	return -EBADMSG;
 }
 EXPORT_SYMBOL_GPL(sprint_oid);
-
-/**
- * sprint_OID - Print an Object Identifier into a buffer
- * @oid: The OID to print
- * @buffer: The buffer to render into
- * @bufsize: The size of the buffer
- *
- * The OID is rendered into the buffer in "a.b.c.d" format and the number of
- * bytes is returned.
- */
-int sprint_OID(enum OID oid, char *buffer, size_t bufsize)
-{
-	int ret;
-
-	BUG_ON(oid >= OID__NR);
-
-	ret = sprint_oid(oid_data + oid_index[oid],
-			 oid_index[oid + 1] - oid_index[oid],
-			 buffer, bufsize);
-	BUG_ON(ret == -EBADMSG);
-	return ret;
-}
-EXPORT_SYMBOL_GPL(sprint_OID);
Signature · 1 line
2.49.0