linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] compat: support RHEL6.3 as a build target
@ 2012-08-09  4:40 Andy Gospodarek
  2012-08-09  4:45 ` Luis R. Rodriguez
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Andy Gospodarek @ 2012-08-09  4:40 UTC (permalink / raw)
  To: mcgrof, lf_driver_backport, linux-wireless; +Cc: Phil Perry

This patch allows me to compile and load the latest compat modules on
RHEL6.3.  Users of compat on RHEL6 should note that you should set
CONFIG_COMPAT_KFIFO=n as those bits are not needed at all.

These changes seem to pass built-in tests on my system:

# ./bin/ckmake 
Trying kernel 3.5.0-030500-generic [OK]
Trying kernel 3.4.4-030404-generic [OK]
Trying kernel 3.3.7-030307-generic [OK]
Trying kernel 3.2.2-030202-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.18-030018-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063512-generic [OK]
Trying kernel 2.6.34-02063410-generic [OK]
Trying kernel 2.6.33-02063305-generic [OK]
Trying kernel 2.6.32-02063255-generic [OK]
Trying kernel 2.6.31-02063113-generic [OK]
Trying kernel 2.6.30-02063010-generic [OK]
Trying kernel 2.6.29-02062906-generic [OK]
Trying kernel 2.6.28-02062810-generic [OK]
Trying kernel 2.6.27-020627-generic [OK]
Trying kernel 2.6.26-020626-generic [OK]
Trying kernel 2.6.25-020625-generic [OK]
Trying kernel 2.6.24-020624-generic [OK]

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---
 compat/compat-2.6.38.c        |    8 ++++----
 compat/compat-3.1.c           |   22 +++++++++++-----------
 include/linux/compat-2.6.33.h |    6 ++++++
 include/linux/compat-2.6.34.h |    6 ++++++
 include/linux/compat-2.6.35.h |    5 +++++
 include/linux/compat-2.6.36.h |    2 ++
 include/linux/compat-2.6.38.h |    6 ++++++
 include/linux/compat-3.1.h    |   12 ++++++++++++
 include/linux/compat-3.2.h    |    9 +++++++++
 include/linux/compat-3.3.h    |    2 ++
 10 files changed, 63 insertions(+), 15 deletions(-)

diff --git a/compat/compat-2.6.38.c b/compat/compat-2.6.38.c
index 0074ac6..b546194 100644
--- a/compat/compat-2.6.38.c
+++ b/compat/compat-2.6.38.c
@@ -22,14 +22,14 @@
  *
  * Initialize the EWMA parameters for a given struct ewma @avg.
  */
-void ewma_init(struct ewma *avg, unsigned long factor, unsigned long weight)
+void compat_ewma_init(struct ewma *avg, unsigned long factor, unsigned long weight)
 {
 	WARN_ON(weight <= 1 || factor == 0);
 	avg->internal = 0;
 	avg->weight = weight;
 	avg->factor = factor;
 }
-EXPORT_SYMBOL_GPL(ewma_init);
+EXPORT_SYMBOL_GPL(compat_ewma_init);
 
 /**
  * ewma_add() - Exponentially weighted moving average (EWMA)
@@ -38,7 +38,7 @@ EXPORT_SYMBOL_GPL(ewma_init);
  *
  * Add a sample to the average.
  */
-struct ewma *ewma_add(struct ewma *avg, unsigned long val)
+struct ewma *compat_ewma_add(struct ewma *avg, unsigned long val)
 {
 	avg->internal = avg->internal  ?
 		(((avg->internal * (avg->weight - 1)) +
@@ -46,5 +46,5 @@ struct ewma *ewma_add(struct ewma *avg, unsigned long val)
 		(val * avg->factor);
 	return avg;
 }
-EXPORT_SYMBOL_GPL(ewma_add);
+EXPORT_SYMBOL_GPL(compat_ewma_add);
 
diff --git a/compat/compat-3.1.c b/compat/compat-3.1.c
index e81a3e7..03735f6 100644
--- a/compat/compat-3.1.c
+++ b/compat/compat-3.1.c
@@ -19,7 +19,7 @@
  * 	cpufreq: expose a cpufreq_quick_get_max routine
  */
 
-unsigned int cpufreq_quick_get_max(unsigned int cpu)
+unsigned int compat_cpufreq_quick_get_max(unsigned int cpu)
 {
 	struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
 	unsigned int ret_freq = 0;
@@ -31,10 +31,10 @@ unsigned int cpufreq_quick_get_max(unsigned int cpu)
 
 	return ret_freq;
 }
-EXPORT_SYMBOL(cpufreq_quick_get_max);
+EXPORT_SYMBOL(compat_cpufreq_quick_get_max);
 
 
-static DEFINE_SPINLOCK(simple_ida_lock);
+static DEFINE_SPINLOCK(compat_simple_ida_lock);
 
 /**
  * ida_simple_get - get a new id.
@@ -48,7 +48,7 @@ static DEFINE_SPINLOCK(simple_ida_lock);
  *
  * Use ida_simple_remove() to get rid of an id.
  */
-int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
+int compat_ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
 		   gfp_t gfp_mask)
 {
 	int ret, id;
@@ -69,7 +69,7 @@ again:
 	if (!ida_pre_get(ida, gfp_mask))
 		return -ENOMEM;
 
-	spin_lock_irqsave(&simple_ida_lock, flags);
+	spin_lock_irqsave(&compat_simple_ida_lock, flags);
 	ret = ida_get_new_above(ida, start, &id);
 	if (!ret) {
 		if (id > max) {
@@ -79,29 +79,29 @@ again:
 			ret = id;
 		}
 	}
-	spin_unlock_irqrestore(&simple_ida_lock, flags);
+	spin_unlock_irqrestore(&compat_simple_ida_lock, flags);
 
 	if (unlikely(ret == -EAGAIN))
 		goto again;
 
 	return ret;
 }
-EXPORT_SYMBOL(ida_simple_get);
+EXPORT_SYMBOL(compat_ida_simple_get);
 
 /**
  * ida_simple_remove - remove an allocated id.
  * @ida: the (initialized) ida.
  * @id: the id returned by ida_simple_get.
  */
-void ida_simple_remove(struct ida *ida, unsigned int id)
+void compat_ida_simple_remove(struct ida *ida, unsigned int id)
 {
 	unsigned long flags;
 
 	BUG_ON((int)id < 0);
-	spin_lock_irqsave(&simple_ida_lock, flags);
+	spin_lock_irqsave(&compat_simple_ida_lock, flags);
 	ida_remove(ida, id);
-	spin_unlock_irqrestore(&simple_ida_lock, flags);
+	spin_unlock_irqrestore(&compat_simple_ida_lock, flags);
 }
-EXPORT_SYMBOL(ida_simple_remove);
+EXPORT_SYMBOL(compat_ida_simple_remove);
 /* source lib/idr.c */
 
diff --git a/include/linux/compat-2.6.33.h b/include/linux/compat-2.6.33.h
index 0c71af9..dcdf765 100644
--- a/include/linux/compat-2.6.33.h
+++ b/include/linux/compat-2.6.33.h
@@ -55,11 +55,17 @@ static inline void compat_release_firmware(const struct firmware *fw)
 #define KEY_RFKILL		247	/* Key that controls all radios */
 #endif
 
+/* mask IFF_DONT_BRIDGE as RHEL6 backports this */
+#if !defined(IFF_DONT_BRIDGE)
 #define IFF_DONT_BRIDGE 0x800		/* disallow bridging this ether dev */
 /* source: include/linux/if.h */
+#endif
 
+/* mask NETDEV_POST_INIT as RHEL6 backports this */
 /* this will never happen on older kernels */
+#if !defined(NETDEV_POST_INIT)
 #define NETDEV_POST_INIT 0xffff
+#endif
 
 /* mask netdev_alloc_skb_ip_align as debian squeeze also backports this */
 #define netdev_alloc_skb_ip_align(a, b) compat_netdev_alloc_skb_ip_align(a, b)
diff --git a/include/linux/compat-2.6.34.h b/include/linux/compat-2.6.34.h
index b8b48c0..6597ec1 100644
--- a/include/linux/compat-2.6.34.h
+++ b/include/linux/compat-2.6.34.h
@@ -30,8 +30,11 @@ void init_compat_mmc_pm_flags(void);
 #define netdev_mc_count(dev) ((dev)->mc_count)
 #define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0)
 
+/* mask netdev_for_each_mc_addr as RHEL6 backports this */
+#if !defined(netdev_for_each_mc_addr)
 #define netdev_for_each_mc_addr(mclist, dev) \
 	for (mclist = dev->mc_list; mclist; mclist = mclist->next)
+#endif
 /* source: include/linux/netdevice.h */
 
 
@@ -235,6 +238,8 @@ do {							\
 #define sysfs_attr_init(attr) do {} while(0)
 #endif
 
+/* mask sysfs_bin_attr_init as RHEL6 backports this */
+#if !defined(sysfs_bin_attr_init)
 /**
  *	sysfs_bin_attr_init - initialize a dynamically allocated bin_attribute
  *	@attr: struct bin_attribute to initialize
@@ -246,6 +251,7 @@ do {							\
  *	added to sysfs if you don't have this.
  */
 #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr)
+#endif
 
 #define usb_alloc_coherent(dev, size, mem_flags, dma) usb_buffer_alloc(dev, size, mem_flags, dma)
 #define usb_free_coherent(dev, size, addr, dma) usb_buffer_free(dev, size, addr, dma)
diff --git a/include/linux/compat-2.6.35.h b/include/linux/compat-2.6.35.h
index 5814123..d184f00 100644
--- a/include/linux/compat-2.6.35.h
+++ b/include/linux/compat-2.6.35.h
@@ -19,6 +19,8 @@
 
 #define netdev_hw_addr dev_mc_list
 
+/* mask irq_set_affinity_hint as RHEL6 backports this */
+#define irq_set_affinity_hint(a,b) compat_irq_set_affinity_hint(a,b)
 /*
  * We cannot backport this guy as the IRQ data structure
  * was modified in the kernel itself to support this. We
@@ -46,6 +48,9 @@ extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
 
 #define pm_qos_request(_qos) pm_qos_requirement(_qos)
 
+/* mask usb_pipe_endpoint as RHEL6 backports this */
+#define usb_pipe_endpoint(a,b) compat_usb_pipe_endpoint(a,b)
+
 static inline struct usb_host_endpoint *
 usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe)
 {
diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
index 56d5961..09e4b6f 100644
--- a/include/linux/compat-2.6.36.h
+++ b/include/linux/compat-2.6.36.h
@@ -98,6 +98,8 @@ struct pm_qos_request_list {
  * Dummy printk for disabled debugging statements to use whilst maintaining
  * gcc's format and side-effect checking.
  */
+/* mask no_printk as RHEL6 backports this */
+#define no_printk(...) compat_no_printk(...)
 static inline __attribute__ ((format (printf, 1, 2)))
 int no_printk(const char *s, ...) { return 0; }
 
diff --git a/include/linux/compat-2.6.38.h b/include/linux/compat-2.6.38.h
index 0a86468..1d72523 100644
--- a/include/linux/compat-2.6.38.h
+++ b/include/linux/compat-2.6.38.h
@@ -55,9 +55,15 @@ struct ewma {
 	unsigned long weight;
 };
 
+/* mask ewma_init as RHEL6 backports this */
+#define ewma_init(a,b,c) compat_ewma_init(a,b,c)
+
 extern void ewma_init(struct ewma *avg, unsigned long factor,
 		      unsigned long weight);
 
+/* mask ewma_add as RHEL6 backports this */
+#define ewma_add(a,b) compat_ewma_add(a,b)
+
 extern struct ewma *ewma_add(struct ewma *avg, unsigned long val);
 
 /**
diff --git a/include/linux/compat-3.1.h b/include/linux/compat-3.1.h
index bf8a4ef..dfd87a3 100644
--- a/include/linux/compat-3.1.h
+++ b/include/linux/compat-3.1.h
@@ -30,6 +30,8 @@ static inline bool ip_is_fragment(const struct iphdr *iph)
 	return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
 }
 
+/* mask __netdev_alloc_skb_ip_align as RHEL6 backports this */
+#define __netdev_alloc_skb_ip_align(a,b,c) compat__netdev_alloc_skb_ip_align(a,b,c)
 static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
 							  unsigned int length, gfp_t gfp)
 {
@@ -98,10 +100,20 @@ static inline void security_sk_clone(const struct sock *sk, struct sock *newsk)
 #include <asm-generic/atomic64.h>
 #endif
 
+/* mask ida_simple_get as RHEL6 backports this */
+#define ida_simple_get(a,b,c,d) compat_ida_simple_get(a,b,c,d)
+
 int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
 		   gfp_t gfp_mask);
+
+/* mask ida_simple_remove as RHEL6 backports this */
+#define ida_simple_remove(a,b) compat_ida_simple_remove(a,b)
+
 void ida_simple_remove(struct ida *ida, unsigned int id);
 
+/* mask cpufreq_quick_get_max as RHEL6 backports this */
+#define cpufreq_quick_get_max(a) compat_cpufreq_quick_get_max(a)
+
 unsigned int cpufreq_quick_get_max(unsigned int cpu);
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) */
 
diff --git a/include/linux/compat-3.2.h b/include/linux/compat-3.2.h
index ef27566..cde86b5 100644
--- a/include/linux/compat-3.2.h
+++ b/include/linux/compat-3.2.h
@@ -14,6 +14,9 @@
 
 #define PMSG_IS_AUTO(msg)	(((msg).event & PM_EVENT_AUTO) != 0)
 
+/* mask skb_frag_page as RHEL6 backports this */
+#define skb_frag_page(a) compat_skb_frag_page(a)
+
 /**
  * skb_frag_page - retrieve the page refered to by a paged fragment
  * @frag: the paged fragment
@@ -25,6 +28,9 @@ static inline struct page *skb_frag_page(const skb_frag_t *frag)
 	return frag->page;
 }
 
+/* mask skb_frag_dma_map as RHEL6 backports this */
+#define skb_frag_dma_map(a,b,c,d,e) compat_skb_frag_dma_map(a,b,c,d,e)
+
 /**
  * skb_frag_dma_map - maps a paged fragment via the DMA API
  * @device: the device to map the fragment to
@@ -47,6 +53,9 @@ static inline dma_addr_t skb_frag_dma_map(struct device *dev,
 
 #define ETH_P_TDLS	0x890D          /* TDLS */
 
+/* mask skb_frag_size as RHEL6 backports this */
+#define skb_frag_size(a) compat_skb_frag_size(a)
+
 static inline unsigned int skb_frag_size(const skb_frag_t *frag)
 {
 	return frag->size;
diff --git a/include/linux/compat-3.3.h b/include/linux/compat-3.3.h
index 620e661..caefdf2 100644
--- a/include/linux/compat-3.3.h
+++ b/include/linux/compat-3.3.h
@@ -10,6 +10,8 @@
 #include <linux/skbuff.h>
 #include <net/sch_generic.h>
 
+/* mask qdisc_cb_private_validate as RHEL6 backports this */
+#define qdisc_cb_private_validate(a,b) compat_qdisc_cb_private_validate(a,b)
 #if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,9) && LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,23) && LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)))
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37))
 static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-09  4:40 [PATCH v2] compat: support RHEL6.3 as a build target Andy Gospodarek
@ 2012-08-09  4:45 ` Luis R. Rodriguez
  2012-08-09 13:26 ` Zefir Kurtisi
  2012-08-10 17:19 ` Hauke Mehrtens
  2 siblings, 0 replies; 15+ messages in thread
From: Luis R. Rodriguez @ 2012-08-09  4:45 UTC (permalink / raw)
  To: Andy Gospodarek; +Cc: lf_driver_backport, linux-wireless, Phil Perry

On Wed, Aug 8, 2012 at 9:40 PM, Andy Gospodarek <andy@greyhouse.net> wrote:
> This patch allows me to compile and load the latest compat modules on
> RHEL6.3.  Users of compat on RHEL6 should note that you should set
> CONFIG_COMPAT_KFIFO=n as those bits are not needed at all.
>
> These changes seem to pass built-in tests on my system:
>
> # ./bin/ckmake

No need to run as root, in fact I encourage both
bin/get-compat-kernels and bin/ckmake to be run as a regular user.

Thanks! Applied and pushed!

  Luis

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-09  4:40 [PATCH v2] compat: support RHEL6.3 as a build target Andy Gospodarek
  2012-08-09  4:45 ` Luis R. Rodriguez
@ 2012-08-09 13:26 ` Zefir Kurtisi
  2012-08-10  1:27   ` Luis R. Rodriguez
                     ` (2 more replies)
  2012-08-10 17:19 ` Hauke Mehrtens
  2 siblings, 3 replies; 15+ messages in thread
From: Zefir Kurtisi @ 2012-08-09 13:26 UTC (permalink / raw)
  To: Andy Gospodarek; +Cc: Phil Perry, mcgrof, lf driver backport, linux-wireless

On 08/09/2012 06:40 AM, Andy Gospodarek wrote:
> This patch allows me to compile and load the latest compat modules on
> RHEL6.3.  Users of compat on RHEL6 should note that you should set
> CONFIG_COMPAT_KFIFO=n as those bits are not needed at all.
> 
> [...]
> 
> diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
> index 56d5961..09e4b6f 100644
> --- a/include/linux/compat-2.6.36.h
> +++ b/include/linux/compat-2.6.36.h
> @@ -98,6 +98,8 @@ struct pm_qos_request_list {
>   * Dummy printk for disabled debugging statements to use whilst maintaining
>   * gcc's format and side-effect checking.
>   */
> +/* mask no_printk as RHEL6 backports this */
> +#define no_printk(...) compat_no_printk(...)
>  static inline __attribute__ ((format (printf, 1, 2)))
>  int no_printk(const char *s, ...) { return 0; }
>  
> [...]

This at least breaks compilation on 2.6.35-22 with gcc throwing a
compat-2.6.36.h:104: error: ISO C requires a named argument before ‘...’

It looks like no_printk() needs to be renamed to compat_no_printk()
to make it work as intended.

This is a systematic mistake at several sections of this patch, where
the original function needs to be prefixed by 'compat_' to match the 
related macro.


---
diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
index 8b02260..b6757c3 100644
--- a/include/linux/compat-2.6.36.h
+++ b/include/linux/compat-2.6.36.h
@@ -101,7 +101,7 @@ struct pm_qos_request_list {
 /* mask no_printk as RHEL6 backports this */
 #define no_printk(...) compat_no_printk(...)
 static inline __attribute__ ((format (printf, 1, 2)))
-int no_printk(const char *s, ...) { return 0; }
+int compat_no_printk(const char *s, ...) { return 0; }
 
 #ifndef alloc_workqueue
 #define alloc_workqueue(name, flags, max_active) __create_workqueue(name, flags, max_active, 0)

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
       [not found]   ` <CAHashqCmcgXXDyyqwEYefTMXFDVFKm9GKydfbS14UCY_L443Vg@mail.gmail.com>
@ 2012-08-09 22:14     ` Phil Perry
  2012-08-10  8:50     ` Zefir Kurtisi
  1 sibling, 0 replies; 15+ messages in thread
From: Phil Perry @ 2012-08-09 22:14 UTC (permalink / raw)
  To: Andy Gospodarek; +Cc: Zefir Kurtisi, mcgrof, linux-wireless, lf driver backport

On 09/08/12 22:59, Andy Gospodarek wrote:
> On Aug 9, 2012 9:26 AM, "Zefir Kurtisi"<zefir.kurtisi@neratec.com>  wrote:
>>
>> On 08/09/2012 06:40 AM, Andy Gospodarek wrote:
>>> This patch allows me to compile and load the latest compat modules on
>>> RHEL6.3.  Users of compat on RHEL6 should note that you should set
>>> CONFIG_COMPAT_KFIFO=n as those bits are not needed at all.
>>>
>>> [...]
>>>
>>> diff --git a/include/linux/compat-2.6.36.h
> b/include/linux/compat-2.6.36.h
>>> index 56d5961..09e4b6f 100644
>>> --- a/include/linux/compat-2.6.36.h
>>> +++ b/include/linux/compat-2.6.36.h
>>> @@ -98,6 +98,8 @@ struct pm_qos_request_list {
>>>    * Dummy printk for disabled debugging statements to use whilst
> maintaining
>>>    * gcc's format and side-effect checking.
>>>    */
>>> +/* mask no_printk as RHEL6 backports this */
>>> +#define no_printk(...) compat_no_printk(...)
>>>   static inline __attribute__ ((format (printf, 1, 2)))
>>>   int no_printk(const char *s, ...) { return 0; }
>>>
>>> [...]
>>
>> This at least breaks compilation on 2.6.35-22 with gcc throwing a
>> compat-2.6.36.h:104: error: ISO C requires a named argument before ‘...’
>>
>
> Actually that might be due to the fact that I chose to use no_printk(...)
> rather than no_printk(a,...).
>
> What version of gcc are you using?
>
>> It looks like no_printk() needs to be renamed to compat_no_printk()
>> to make it work as intended.
>>
>> This is a systematic mistake at several sections of this patch, where
>> the original function needs to be prefixed by 'compat_' to match the
>> related macro.
>>
>>
>> ---
>> diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
>> index 8b02260..b6757c3 100644
>> --- a/include/linux/compat-2.6.36.h
>> +++ b/include/linux/compat-2.6.36.h
>> @@ -101,7 +101,7 @@ struct pm_qos_request_list {
>>   /* mask no_printk as RHEL6 backports this */
>>   #define no_printk(...) compat_no_printk(...)
>>   static inline __attribute__ ((format (printf, 1, 2)))
>> -int no_printk(const char *s, ...) { return 0; }
>> +int compat_no_printk(const char *s, ...) { return 0; }
>>
>>   #ifndef alloc_workqueue
>>   #define alloc_workqueue(name, flags, max_active)
> __create_workqueue(name, flags, max_active, 0)
>

Hi Andy, Zefir,

Thanks for these patches, this certainly moves us forward (the compat 
components do now compile on RHEL6.3); my build then errors out on 
drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc (I should apologise and 
state I'm trying to build the 3.5-3 stable tarball on RHEL6.3).

Here are the errors, which I believe are related to the above 
no_printk() issue:


   CC [M] 
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.o
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c: 
In function 'brcmf_proto_cdc_msg':
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:114: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c: 
In function 'brcmf_proto_cdc_cmplt':
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:134: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c: 
In function 'brcmf_proto_cdc_query_dcmd':
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:157: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:158: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:186: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:203: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c: 
In function 'brcmf_proto_cdc_set_dcmd':
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:238: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:239: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:265: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c: 
In function 'brcmf_proto_dcmd':
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:290: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:295: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:301: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:306: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c: 
In function 'brcmf_proto_hdrpush':
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:367: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c: 
In function 'brcmf_proto_hdrpull':
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:392: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:397: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:406: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:412: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:418: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:390: 
warning: unused variable 'drvr'
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c: 
In function 'brcmf_proto_attach':
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:441: 
error: expected expression before '...' token
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c: 
In function 'brcmf_proto_init':
/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c:468: 
error: expected expression before '...' token
make[5]: *** 
[/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.o] 
Error 1
make[4]: *** 
[/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211/brcmfmac] 
Error 2
make[3]: *** 
[/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless/brcm80211] 
Error 2
make[2]: *** 
[/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3/drivers/net/wireless] 
Error 2
make[1]: *** [_module_/home/phil/rpmbuild/BUILD/compat-wireless-3.5-3] 
Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.32-279.el6.x86_64'
make: *** [modules] Error 2

The only way I have found to work around this at the moment is to block 
out the offending no_printk() for RHEL6.3:

/*
  * Dummy printk for disabled debugging statements to use whilst maintaining
  * gcc's format and side-effect checking.
  */
/* mask no_printk as RHEL6.3 backports this */
#if (RHEL_MINOR < 3)
static inline __attribute__ ((format (printf, 1, 2)))
int no_printk(const char *s, ...) { return 0; }
#endif /* (RHEL_MINOR < 3) */

Not a very elegant solution but at least the code does now compile for 
me on RHEL6.3, so it's progress of sorts.

Regards,

Phil


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-09 13:26 ` Zefir Kurtisi
@ 2012-08-10  1:27   ` Luis R. Rodriguez
  2012-08-10  2:27     ` Andy Gospodarek
  2012-08-10  3:13     ` [Lf_driver_backport] " Andy Gospodarek
       [not found]   ` <CAHashqCmcgXXDyyqwEYefTMXFDVFKm9GKydfbS14UCY_L443Vg@mail.gmail.com>
  2012-08-10 17:18   ` Hauke Mehrtens
  2 siblings, 2 replies; 15+ messages in thread
From: Luis R. Rodriguez @ 2012-08-10  1:27 UTC (permalink / raw)
  To: Zefir Kurtisi
  Cc: Andy Gospodarek, Phil Perry, lf driver backport, linux-wireless

On Thu, Aug 9, 2012 at 6:26 AM, Zefir Kurtisi <zefir.kurtisi@neratec.com> wrote:
> @@ -101,7 +101,7 @@ struct pm_qos_request_list {
>  /* mask no_printk as RHEL6 backports this */
>  #define no_printk(...) compat_no_printk(...)
>  static inline __attribute__ ((format (printf, 1, 2)))
> -int no_printk(const char *s, ...) { return 0; }
> +int compat_no_printk(const char *s, ...) { return 0; }

I merged this in. Andy can you review your other changes as Zefir points out?

mcgrof@frijol ~/compat (git::master)$ gcc --version
gcc (Debian 4.7.1-2) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I suppose we should get ckmake to spit out the version of gcc onto the report.

  Luis

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-10  1:27   ` Luis R. Rodriguez
@ 2012-08-10  2:27     ` Andy Gospodarek
  2012-08-10  3:13     ` [Lf_driver_backport] " Andy Gospodarek
  1 sibling, 0 replies; 15+ messages in thread
From: Andy Gospodarek @ 2012-08-10  2:27 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Zefir Kurtisi, Phil Perry, lf driver backport, linux-wireless

On Thu, Aug 9, 2012 at 9:27 PM, Luis R. Rodriguez <mcgrof@frijolero.org> wrote:
> On Thu, Aug 9, 2012 at 6:26 AM, Zefir Kurtisi <zefir.kurtisi@neratec.com> wrote:
>> @@ -101,7 +101,7 @@ struct pm_qos_request_list {
>>  /* mask no_printk as RHEL6 backports this */
>>  #define no_printk(...) compat_no_printk(...)
>>  static inline __attribute__ ((format (printf, 1, 2)))
>> -int no_printk(const char *s, ...) { return 0; }
>> +int compat_no_printk(const char *s, ...) { return 0; }
>
> I merged this in. Andy can you review your other changes as Zefir points out?

Yes, I will check it out tomorrow.

> mcgrof@frijol ~/compat (git::master)$ gcc --version
> gcc (Debian 4.7.1-2) 4.7.1
> Copyright (C) 2012 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> I suppose we should get ckmake to spit out the version of gcc onto the report.
>
>   Luis

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Lf_driver_backport] [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-10  1:27   ` Luis R. Rodriguez
  2012-08-10  2:27     ` Andy Gospodarek
@ 2012-08-10  3:13     ` Andy Gospodarek
  2012-08-10  6:05       ` Luis R. Rodriguez
  1 sibling, 1 reply; 15+ messages in thread
From: Andy Gospodarek @ 2012-08-10  3:13 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Zefir Kurtisi, linux-wireless, lf driver backport,
	Andy Gospodarek

On Thu, Aug 09, 2012 at 06:27:25PM -0700, Luis R. Rodriguez wrote:
> On Thu, Aug 9, 2012 at 6:26 AM, Zefir Kurtisi <zefir.kurtisi@neratec.com> wrote:
> > @@ -101,7 +101,7 @@ struct pm_qos_request_list {
> >  /* mask no_printk as RHEL6 backports this */
> >  #define no_printk(...) compat_no_printk(...)
> >  static inline __attribute__ ((format (printf, 1, 2)))
> > -int no_printk(const char *s, ...) { return 0; }
> > +int compat_no_printk(const char *s, ...) { return 0; }
> 
> I merged this in. Andy can you review your other changes as Zefir points out?
> 
> mcgrof@frijol ~/compat (git::master)$ gcc --version
> gcc (Debian 4.7.1-2) 4.7.1
> Copyright (C) 2012 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> I suppose we should get ckmake to spit out the version of gcc onto the report.
> 
>   Luis

I did some more testing and I'm not sure I agree that the patch above is
the proper way to do this.  My impression was that what I did was
correct as the only function definitions that need to be renamed with
the 'compat_' string in front were those that were exported.  This is
what was done in both John Linville's initial patch for RHEL support and
the patch from Hauke Mehrtens for Debian Squeeze support.  I feel like
this is the proper patch to fixup my original error:

Subject: [PATCH] compat: fixup error in no_printk definition

What initially looked like a valid definition for the #define for
no_printk was not.  This corrects the problem.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---
 include/linux/compat-2.6.36.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
index 09e4b6f..cd5e37c 100644
--- a/include/linux/compat-2.6.36.h
+++ b/include/linux/compat-2.6.36.h
@@ -99,7 +99,7 @@ struct pm_qos_request_list {
  * gcc's format and side-effect checking.
  */
 /* mask no_printk as RHEL6 backports this */
-#define no_printk(...) compat_no_printk(...)
+#define no_printk(a, ...) compat_no_printk(a, ##__VA_ARGS__)
 static inline __attribute__ ((format (printf, 1, 2)))
 int no_printk(const char *s, ...) { return 0; }
 


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [Lf_driver_backport] [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-10  3:13     ` [Lf_driver_backport] " Andy Gospodarek
@ 2012-08-10  6:05       ` Luis R. Rodriguez
  0 siblings, 0 replies; 15+ messages in thread
From: Luis R. Rodriguez @ 2012-08-10  6:05 UTC (permalink / raw)
  To: Andy Gospodarek
  Cc: Zefir Kurtisi, linux-wireless, lf driver backport,
	Andy Gospodarek

On Thu, Aug 9, 2012 at 8:13 PM, Andy Gospodarek <gospo@redhat.com> wrote:
> On Thu, Aug 09, 2012 at 06:27:25PM -0700, Luis R. Rodriguez wrote:
>> On Thu, Aug 9, 2012 at 6:26 AM, Zefir Kurtisi <zefir.kurtisi@neratec.com> wrote:
>> > @@ -101,7 +101,7 @@ struct pm_qos_request_list {
>> >  /* mask no_printk as RHEL6 backports this */
>> >  #define no_printk(...) compat_no_printk(...)
>> >  static inline __attribute__ ((format (printf, 1, 2)))
>> > -int no_printk(const char *s, ...) { return 0; }
>> > +int compat_no_printk(const char *s, ...) { return 0; }
>>
>> I merged this in. Andy can you review your other changes as Zefir points out?
>>
>> mcgrof@frijol ~/compat (git::master)$ gcc --version
>> gcc (Debian 4.7.1-2) 4.7.1
>> Copyright (C) 2012 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
>> I suppose we should get ckmake to spit out the version of gcc onto the report.
>>
>>   Luis
>
> I did some more testing and I'm not sure I agree that the patch above is
> the proper way to do this.  My impression was that what I did was
> correct as the only function definitions that need to be renamed with
> the 'compat_' string in front were those that were exported.  This is
> what was done in both John Linville's initial patch for RHEL support and
> the patch from Hauke Mehrtens for Debian Squeeze support.  I feel like
> this is the proper patch to fixup my original error:
>
> Subject: [PATCH] compat: fixup error in no_printk definition
>
> What initially looked like a valid definition for the #define for
> no_printk was not.  This corrects the problem.
>
> Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
> ---
>  include/linux/compat-2.6.36.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
> index 09e4b6f..cd5e37c 100644
> --- a/include/linux/compat-2.6.36.h
> +++ b/include/linux/compat-2.6.36.h
> @@ -99,7 +99,7 @@ struct pm_qos_request_list {
>   * gcc's format and side-effect checking.
>   */
>  /* mask no_printk as RHEL6 backports this */
> -#define no_printk(...) compat_no_printk(...)
> +#define no_printk(a, ...) compat_no_printk(a, ##__VA_ARGS__)
>  static inline __attribute__ ((format (printf, 1, 2)))
>  int no_printk(const char *s, ...) { return 0; }

Thanks, can you git fetch ; git rebase and send a new patch?

  Luis

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
       [not found]   ` <CAHashqCmcgXXDyyqwEYefTMXFDVFKm9GKydfbS14UCY_L443Vg@mail.gmail.com>
  2012-08-09 22:14     ` Phil Perry
@ 2012-08-10  8:50     ` Zefir Kurtisi
  1 sibling, 0 replies; 15+ messages in thread
From: Zefir Kurtisi @ 2012-08-10  8:50 UTC (permalink / raw)
  To: Andy Gospodarek; +Cc: mcgrof, Phil Perry, linux-wireless, lf driver backport

On 08/09/2012 11:59 PM, Andy Gospodarek wrote:
> On Aug 9, 2012 9:26 AM, "Zefir Kurtisi" <zefir.kurtisi@neratec.com
>> [...]
>> This at least breaks compilation on 2.6.35-22 with gcc throwing a
>> compat-2.6.36.h:104: error: ISO C requires a named argument before ‘...’
>>
> 
> Actually that might be due to the fact that I chose to use
> no_printk(...) rather than no_printk(a,...).
> 
> What version of gcc are you using?
> 
Since you already resolved the issue, just FYI: I'm using
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5.1) 4.4.5





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-09 13:26 ` Zefir Kurtisi
  2012-08-10  1:27   ` Luis R. Rodriguez
       [not found]   ` <CAHashqCmcgXXDyyqwEYefTMXFDVFKm9GKydfbS14UCY_L443Vg@mail.gmail.com>
@ 2012-08-10 17:18   ` Hauke Mehrtens
  2012-08-10 18:28     ` Andy Gospodarek
  2 siblings, 1 reply; 15+ messages in thread
From: Hauke Mehrtens @ 2012-08-10 17:18 UTC (permalink / raw)
  To: Zefir Kurtisi
  Cc: Andy Gospodarek, Phil Perry, mcgrof, lf driver backport,
	linux-wireless

On 08/09/2012 03:26 PM, Zefir Kurtisi wrote:
> On 08/09/2012 06:40 AM, Andy Gospodarek wrote:
>> This patch allows me to compile and load the latest compat modules on
>> RHEL6.3.  Users of compat on RHEL6 should note that you should set
>> CONFIG_COMPAT_KFIFO=n as those bits are not needed at all.
>>
>> [...]
>>
>> diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
>> index 56d5961..09e4b6f 100644
>> --- a/include/linux/compat-2.6.36.h
>> +++ b/include/linux/compat-2.6.36.h
>> @@ -98,6 +98,8 @@ struct pm_qos_request_list {
>>   * Dummy printk for disabled debugging statements to use whilst maintaining
>>   * gcc's format and side-effect checking.
>>   */
>> +/* mask no_printk as RHEL6 backports this */
>> +#define no_printk(...) compat_no_printk(...)
>>  static inline __attribute__ ((format (printf, 1, 2)))
>>  int no_printk(const char *s, ...) { return 0; }
>>  
>> [...]
> 
> This at least breaks compilation on 2.6.35-22 with gcc throwing a
> compat-2.6.36.h:104: error: ISO C requires a named argument before ‘...’
> 
> It looks like no_printk() needs to be renamed to compat_no_printk()
> to make it work as intended.
> 
> This is a systematic mistake at several sections of this patch, where
> the original function needs to be prefixed by 'compat_' to match the 
> related macro.
> 
> 
> ---
> diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
> index 8b02260..b6757c3 100644
> --- a/include/linux/compat-2.6.36.h
> +++ b/include/linux/compat-2.6.36.h
> @@ -101,7 +101,7 @@ struct pm_qos_request_list {
>  /* mask no_printk as RHEL6 backports this */
>  #define no_printk(...) compat_no_printk(...)
>  static inline __attribute__ ((format (printf, 1, 2)))
> -int no_printk(const char *s, ...) { return 0; }
> +int compat_no_printk(const char *s, ...) { return 0; }
>  
>  #ifndef alloc_workqueue
>  #define alloc_workqueue(name, flags, max_active) __create_workqueue(name, flags, max_active, 0)

With this patch applied it works better, but I still get this error in
drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c.

brcmfmac has this line:

#define brcmf_dbg(level, fmt, ...) no_printk(fmt, ##__VA_ARGS__)

so brcmf_dbg gets no_printk and not compat_no_printk.

Why isn't "ifndef CONFIG_COMPAT_RHEL_6_3" put around the declaration of
no_printk()?

Hauke

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-09  4:40 [PATCH v2] compat: support RHEL6.3 as a build target Andy Gospodarek
  2012-08-09  4:45 ` Luis R. Rodriguez
  2012-08-09 13:26 ` Zefir Kurtisi
@ 2012-08-10 17:19 ` Hauke Mehrtens
  2 siblings, 0 replies; 15+ messages in thread
From: Hauke Mehrtens @ 2012-08-10 17:19 UTC (permalink / raw)
  To: Andy Gospodarek; +Cc: mcgrof, lf_driver_backport, linux-wireless, Phil Perry

On 08/09/2012 06:40 AM, Andy Gospodarek wrote:
> This patch allows me to compile and load the latest compat modules on
> RHEL6.3.  Users of compat on RHEL6 should note that you should set
> CONFIG_COMPAT_KFIFO=n as those bits are not needed at all.
> 
To disable CONFIG_COMPAT_KFIFO you should prepare a patch for
compat-wireless and make use of CONFIG_COMPAT_RHEL_6_3.

Hauke


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-10 17:18   ` Hauke Mehrtens
@ 2012-08-10 18:28     ` Andy Gospodarek
  2012-08-10 19:50       ` Luis R. Rodriguez
  0 siblings, 1 reply; 15+ messages in thread
From: Andy Gospodarek @ 2012-08-10 18:28 UTC (permalink / raw)
  To: Hauke Mehrtens
  Cc: Zefir Kurtisi, Phil Perry, mcgrof, lf driver backport,
	linux-wireless

On Fri, Aug 10, 2012 at 1:18 PM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> On 08/09/2012 03:26 PM, Zefir Kurtisi wrote:
>> On 08/09/2012 06:40 AM, Andy Gospodarek wrote:
>>> This patch allows me to compile and load the latest compat modules on
>>> RHEL6.3.  Users of compat on RHEL6 should note that you should set
>>> CONFIG_COMPAT_KFIFO=n as those bits are not needed at all.
>>>
>>> [...]
>>>
>>> diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
>>> index 56d5961..09e4b6f 100644
>>> --- a/include/linux/compat-2.6.36.h
>>> +++ b/include/linux/compat-2.6.36.h
>>> @@ -98,6 +98,8 @@ struct pm_qos_request_list {
>>>   * Dummy printk for disabled debugging statements to use whilst maintaining
>>>   * gcc's format and side-effect checking.
>>>   */
>>> +/* mask no_printk as RHEL6 backports this */
>>> +#define no_printk(...) compat_no_printk(...)
>>>  static inline __attribute__ ((format (printf, 1, 2)))
>>>  int no_printk(const char *s, ...) { return 0; }
>>>
>>> [...]
>>
>> This at least breaks compilation on 2.6.35-22 with gcc throwing a
>> compat-2.6.36.h:104: error: ISO C requires a named argument before ‘...’
>>
>> It looks like no_printk() needs to be renamed to compat_no_printk()
>> to make it work as intended.
>>
>> This is a systematic mistake at several sections of this patch, where
>> the original function needs to be prefixed by 'compat_' to match the
>> related macro.
>>
>>
>> ---
>> diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
>> index 8b02260..b6757c3 100644
>> --- a/include/linux/compat-2.6.36.h
>> +++ b/include/linux/compat-2.6.36.h
>> @@ -101,7 +101,7 @@ struct pm_qos_request_list {
>>  /* mask no_printk as RHEL6 backports this */
>>  #define no_printk(...) compat_no_printk(...)
>>  static inline __attribute__ ((format (printf, 1, 2)))
>> -int no_printk(const char *s, ...) { return 0; }
>> +int compat_no_printk(const char *s, ...) { return 0; }
>>
>>  #ifndef alloc_workqueue
>>  #define alloc_workqueue(name, flags, max_active) __create_workqueue(name, flags, max_active, 0)
>
> With this patch applied it works better, but I still get this error in
> drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c.
>
> brcmfmac has this line:
>
> #define brcmf_dbg(level, fmt, ...) no_printk(fmt, ##__VA_ARGS__)
>
> so brcmf_dbg gets no_printk and not compat_no_printk.
>
> Why isn't "ifndef CONFIG_COMPAT_RHEL_6_3" put around the declaration of
> no_printk()?
>
> Hauke

Did you try the patch I posted last night that has the updated define
for no_printk()?  I saw the same error until I applied that patch.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-10 18:28     ` Andy Gospodarek
@ 2012-08-10 19:50       ` Luis R. Rodriguez
  2012-08-10 19:51         ` Andy Gospodarek
  0 siblings, 1 reply; 15+ messages in thread
From: Luis R. Rodriguez @ 2012-08-10 19:50 UTC (permalink / raw)
  To: Andy Gospodarek
  Cc: Hauke Mehrtens, Zefir Kurtisi, Phil Perry, lf driver backport,
	linux-wireless

On Fri, Aug 10, 2012 at 11:28 AM, Andy Gospodarek <andy@greyhouse.net> wrote:
> Did you try the patch I posted last night that has the updated define
> for no_printk()?  I saw the same error until I applied that patch.

Andy, can you post a new patch on a new thread that is rebased on top
of the latest compat.git master and without putting stuff above the
patch ?

  Luis

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-10 19:50       ` Luis R. Rodriguez
@ 2012-08-10 19:51         ` Andy Gospodarek
  2012-08-10 23:48           ` Hauke Mehrtens
  0 siblings, 1 reply; 15+ messages in thread
From: Andy Gospodarek @ 2012-08-10 19:51 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Hauke Mehrtens, Zefir Kurtisi, Phil Perry, lf driver backport,
	linux-wireless

On Fri, Aug 10, 2012 at 3:50 PM, Luis R. Rodriguez <mcgrof@frijolero.org> wrote:
> On Fri, Aug 10, 2012 at 11:28 AM, Andy Gospodarek <andy@greyhouse.net> wrote:
>> Did you try the patch I posted last night that has the updated define
>> for no_printk()?  I saw the same error until I applied that patch.
>
> Andy, can you post a new patch on a new thread that is rebased on top
> of the latest compat.git master and without putting stuff above the
> patch ?
>
>   Luis

Yes I can.  You caught me at just the right time as my test build of
compat-wireless-3.5-3 just finished.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v2] compat: support RHEL6.3 as a build target
  2012-08-10 19:51         ` Andy Gospodarek
@ 2012-08-10 23:48           ` Hauke Mehrtens
  0 siblings, 0 replies; 15+ messages in thread
From: Hauke Mehrtens @ 2012-08-10 23:48 UTC (permalink / raw)
  To: Andy Gospodarek
  Cc: Luis R. Rodriguez, Zefir Kurtisi, Phil Perry, lf driver backport,
	linux-wireless

On 08/10/2012 09:51 PM, Andy Gospodarek wrote:
> On Fri, Aug 10, 2012 at 3:50 PM, Luis R. Rodriguez <mcgrof@frijolero.org> wrote:
>> On Fri, Aug 10, 2012 at 11:28 AM, Andy Gospodarek <andy@greyhouse.net> wrote:
>>> Did you try the patch I posted last night that has the updated define
>>> for no_printk()?  I saw the same error until I applied that patch.
>>
>> Andy, can you post a new patch on a new thread that is rebased on top
>> of the latest compat.git master and without putting stuff above the
>> patch ?
>>
>>   Luis
> 
> Yes I can.  You caught me at just the right time as my test build of
> compat-wireless-3.5-3 just finished.

I just tried "[PATCH] compat: fixup error in no_printk definition" and
now this error does not occur in my tests any more.

Thanks for the patch.

Hauke

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-08-10 23:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-09  4:40 [PATCH v2] compat: support RHEL6.3 as a build target Andy Gospodarek
2012-08-09  4:45 ` Luis R. Rodriguez
2012-08-09 13:26 ` Zefir Kurtisi
2012-08-10  1:27   ` Luis R. Rodriguez
2012-08-10  2:27     ` Andy Gospodarek
2012-08-10  3:13     ` [Lf_driver_backport] " Andy Gospodarek
2012-08-10  6:05       ` Luis R. Rodriguez
     [not found]   ` <CAHashqCmcgXXDyyqwEYefTMXFDVFKm9GKydfbS14UCY_L443Vg@mail.gmail.com>
2012-08-09 22:14     ` Phil Perry
2012-08-10  8:50     ` Zefir Kurtisi
2012-08-10 17:18   ` Hauke Mehrtens
2012-08-10 18:28     ` Andy Gospodarek
2012-08-10 19:50       ` Luis R. Rodriguez
2012-08-10 19:51         ` Andy Gospodarek
2012-08-10 23:48           ` Hauke Mehrtens
2012-08-10 17:19 ` Hauke Mehrtens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).