Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F165184603
D41310.id125677.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
921 B
Referenced Files
None
Subscribers
None
D41310.id125677.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
Fri, Aug 7, 2:45 PM (6 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36184237
Default Alt Text
D41310.id125677.diff (921 B)
Attached To
Mode
D41310: nvme: Eliminate redundant code
Attached
Detach File
Event Timeline
Log In to Comment