Skip to contentSkip to conversation

xen: Add generic implementation of binary search

PATCH In review Shanker Donthineni 2 participants 2 messages Jul 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v4 9/11 xen: Add generic implementation of binary search

This patch adds the generic implementation of binary search algorithm whcih is copied from Linux kernel. Only coding style changes to match the general XEN coding style. No functional changes.

---
 xen/common/Makefile       |  1 +
 xen/common/bsearch.c      | 52 +++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/xen/bsearch.h |  9 ++++++++
 3 files changed, 62 insertions(+)
 create mode 100644 xen/common/bsearch.c
 create mode 100644 xen/include/xen/bsearch.h
xen/common/Makefile +1 -0
index 2a83261..2fa36a4 100644
@@ -41,6 +41,7 @@ obj-y += schedule.o
 obj-y += shutdown.o
 obj-y += softirq.o
 obj-y += sort.o
+obj-y += bsearch.o
 obj-y += smp.o
 obj-y += spinlock.o
 obj-y += stop_machine.o
xen/common/bsearch.c new file +52 -0

52 lines not on this page · raw message

xen/include/xen/bsearch.h new file +9 -0
new file mode 100644
index 0000000..07cf604
@@ -0,0 +1,9 @@
+#ifndef __XEN_BSEARCH_H__
+#define __XEN_BSEARCH_H__
+
+#include <xen/types.h>
+
+void *bsearch(const void *key, const void *base, size_t num, size_t size,
+	      int (*cmp)(const void *key, const void *elt));
+
+#endif /* __XEN_BSEARCH_H__ */
Signature · 9 lines
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc. 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
a Linux Foundation Collaborative Project


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

Hi Shanker,

Can you please try to thread properly your series, and re-number it with the correct amount of patch if some have been applied.

It will avoid people to wondering if they missed some e-mails.

Quoted 3 lines · Shanker Donthineni

This patch adds the generic implementation of binary search algorithm whcih is copied from Linux kernel. Only coding style changes to match the general XEN coding style. No functional changes.

Usually, the coding style is not changed in verbatim copy of Linux source code in order to make easier the sync.

Also, I would appreciate if you can mention the version Linux at the time of the sync for similar reason.

Regards,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel