aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2008-07-17 04:35:42 -0700
committerLuis R. Rodriguez <lrodriguez@atheros.com>2008-07-17 04:35:42 -0700
commit3426e551938236cebbc416356c74d5715a792fc7 (patch)
tree589f68f6d850b5485fdc79a1afa2ac20b76e7178
parentd3a0e70b6648d24dbcbd4899ee99fd308081f5fb (diff)
downloadcompat-wireless-2.6-old-3426e551938236cebbc416356c74d5715a792fc7.tar.gz
Fix compilation on 2.6.22, its been a while since I test this,
sorry. This adds: * uintptr_t * __cold * device_create_release() Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
-rw-r--r--compat/compat.c7
-rw-r--r--compat/compat.h38
2 files changed, 45 insertions, 0 deletions
diff --git a/compat/compat.c b/compat/compat.c
index c4c0ed3..b1ec4d4 100644
--- a/compat/compat.c
+++ b/compat/compat.c
@@ -642,6 +642,13 @@ EXPORT_SYMBOL(pci_try_set_mwi);
/* All things not in 2.6.25 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26))
+
+static void device_create_release(struct device *dev)
+{
+ pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
+ kfree(dev);
+}
+
/**
* device_create_vargs - creates a device and registers it with sysfs
* @class: pointer to the struct class that this device should be registered to
diff --git a/compat/compat.h b/compat/compat.h
index ac1e1c0..82f60a2 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -136,6 +136,32 @@ static inline void pci_clear_mwi(struct pci_dev *dev)
/* Compat work for < 2.6.23 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23))
+/*
+ * Tell gcc if a function is cold. The compiler will assume any path
+ * directly leading to the call is unlikely.
+ */
+
+#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 3)
+/* Mark functions as cold. gcc will assume any path leading to a call
+ * to them will be unlikely. This means a lot of manual unlikely()s
+ * are unnecessary now for any paths leading to the usual suspects
+ * like BUG(), printk(), panic() etc. [but let's keep them for now for
+ * older compilers]
+ *
+ * Early snapshots of gcc 4.3 don't support this and we can't detect this
+ * in the preprocessor, but we can live with this because they're unreleased.
+ * Maketime probing would be overkill here.
+ *
+ * gcc also has a __attribute__((__hot__)) to move hot functions into
+ * a special section, but I don't see any sense in this right now in
+ * the kernel context */
+#define __cold __attribute__((__cold__))
+#endif /* gcc 4.3 check */
+
+#ifndef __cold
+#define __cold
+#endif
+
/* Added as of 2.6.23 in include/linux/netdevice.h */
#define alloc_netdev_mq(sizeof_priv, name, setup, queue) \
alloc_netdev(sizeof_priv, name, setup)
@@ -408,6 +434,18 @@ static inline void set_freezable(void) {}
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) */
+
+
+
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))
+/* Added on 2.6.24 in include/linux/types.h by Al viro on commit 142956af */
+typedef unsigned long uintptr_t;
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)) */
+
+
+
+
/* Compat work for 2.6.24 */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))