mtd/include/linux/mtd compatmac.h,1.55,1.56

David Woodhouse dwmw2 at infradead.org
Thu May 29 05:36:50 EDT 2003


Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv15722

Modified Files:
	compatmac.h 
Log Message:
compat for strlcpy and 2.5 request_module

Index: compatmac.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/compatmac.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- compatmac.h	21 May 2003 15:14:30 -0000	1.55
+++ compatmac.h	29 May 2003 09:36:47 -0000	1.56
@@ -100,5 +100,25 @@
 #define generic_file_readonly_mmap generic_file_mmap
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,70)
+
+#include <linux/kmod.h>
+#include <linux/string.h>
+
+static inline char *strlcpy(char *dest, const char *src, int len)
+{
+	dest[len-1] = 0;
+	return strncpy(dest, src, len-1);
+}
+
+static inline int do_old_request_module(const char *mod)
+{
+	return request_module(mod);
+}
+#undef request_module
+#define request_module(fmt, ...) \
+ ({ char modname[32]; snprintf(modname, 31, fmt ,##__VA_ARGS__); do_old_request_module(modname); })
+
+#endif /* 2.5.70 */
 
 #endif /* __LINUX_MTD_COMPATMAC_H__ */




More information about the linux-mtd-cvs mailing list