Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149058498
D41310.1789465144.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
921 B
Referenced Files
None
Subscribers
None
D41310.1789465144.diff
View Options
diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c
--- a/sys/dev/nvme/nvme_qpair.c
+++ b/sys/dev/nvme/nvme_qpair.c
@@ -99,12 +99,8 @@
};
static const char *
-get_admin_opcode_string(uint16_t opc)
+get_opcode_string(struct nvme_opcode_string *entry, uint16_t opc)
{
- struct nvme_opcode_string *entry;
-
- entry = admin_opcode;
-
while (entry->opc != 0xFFFF) {
if (entry->opc == opc)
return (entry->str);
@@ -114,18 +110,15 @@
}
static const char *
-get_io_opcode_string(uint16_t opc)
+get_admin_opcode_string(uint16_t opc)
{
- struct nvme_opcode_string *entry;
-
- entry = io_opcode;
+ return (get_opcode_string(admin_opcode, opc));
+}
- while (entry->opc != 0xFFFF) {
- if (entry->opc == opc)
- return (entry->str);
- entry++;
- }
- return (entry->str);
+static const char *
+get_io_opcode_string(uint16_t opc)
+{
+ return (get_opcode_string(io_opcode, opc));
}
static void
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 15, 9:39 AM (15 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29647816
Default Alt Text
D41310.1789465144.diff (921 B)
Attached To
Mode
D41310: nvme: Eliminate redundant code
Attached
Detach File
Event Timeline
Log In to Comment