@@ -127,6 +127,9 @@ add no_atomic_include.patch
add v4l2-compat-timespec.patch
add v3.0_ida2bit.patch
+[2.6.39]
+add v2.6_rc_main_bsearch_h.patch
+
[2.6.38]
add v2.6.38_use_getkeycode_new_setkeycode_new.patch
add v2.6.38_config_of_for_of_node.patch
new file mode 100644
@@ -0,0 +1,10 @@
+--- a/drivers/media/rc/rc-main.c
++++ b/drivers/media/rc/rc-main.c
+@@ -16,7 +16,6 @@
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+ #include <media/rc-core.h>
+-#include <linux/bsearch.h>
+ #include <linux/spinlock.h>
+ #include <linux/delay.h>
+ #include <linux/input.h>
@@ -2170,4 +2170,29 @@ static inline unsigned long nsecs_to_jiffies_static(u64 n)
#define U32_MAX ((u32)~0U)
#endif
+#ifdef NEED_BSEARCH
+static inline void *bsearch(const void *key, const void *base, size_t num, size_t size,
+ int (*cmp)(const void *key, const void *elt))
+{
+ const char *pivot;
+ int result;
+
+ while (num > 0) {
+ pivot = base + (num >> 1) * size;
+ result = cmp(key, pivot);
+
+ if (result == 0)
+ return (void *)pivot;
+
+ if (result > 0) {
+ base = pivot + size;
+ num--;
+ }
+ num >>= 1;
+ }
+
+ return NULL;
+}
+#endif
+
#endif /* _COMPAT_H */
@@ -705,6 +705,7 @@ sub check_other_dependencies()
check_files_for_func("PCI_DEVICE_SUB", "NEED_PCI_DEVICE_SUB", "include/linux/pci.h");
check_files_for_func("annotate_reachable", "NEED_ANNOTATE_REACHABLE", "include/linux/compiler.h");
check_files_for_func("U32_MAX", "NEED_U32_MAX", "include/linux/kernel.h");
+ check_files_for_func("bsearch", "NEED_BSEARCH", "include/linux/bsearch.h");
# For tests for uapi-dependent logic
check_files_for_func_uapi("usb_endpoint_maxp", "NEED_USB_ENDPOINT_MAXP", "usb/ch9.h");