Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178054383
D41310.1795860889.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
921 B
Referenced Files
None
Subscribers
None
D41310.1795860889.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
Sat, Nov 28, 10:14 AM (19 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42042970
Default Alt Text
D41310.1795860889.diff (921 B)
Attached To
Mode
D41310: nvme: Eliminate redundant code
Attached
Detach File
Event Timeline