linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phil Perry <phil@elrepo.org>
To: Andy Gospodarek <andy@greyhouse.net>
Cc: Zefir Kurtisi <zefir.kurtisi@neratec.com>,
	mcgrof@frijolero.org, linux-wireless@vger.kernel.org,
	lf driver backport
	<lf_driver_backport@lists.linux-foundation.org>
Subject: Re: [PATCH v2] compat: support RHEL6.3 as a build target
Date: Thu, 09 Aug 2012 23:14:38 +0100	[thread overview]
Message-ID: <5024364E.6030502@elrepo.org> (raw)
In-Reply-To: <CAHashqCmcgXXDyyqwEYefTMXFDVFKm9GKydfbS14UCY_L443Vg@mail.gmail.com>

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


  parent reply	other threads:[~2012-08-09 22:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
     [not found]   ` <CAHashqCmcgXXDyyqwEYefTMXFDVFKm9GKydfbS14UCY_L443Vg@mail.gmail.com>
2012-08-09 22:14     ` Phil Perry [this message]
2012-08-10  8:50     ` 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
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5024364E.6030502@elrepo.org \
    --to=phil@elrepo.org \
    --cc=andy@greyhouse.net \
    --cc=lf_driver_backport@lists.linux-foundation.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@frijolero.org \
    --cc=zefir.kurtisi@neratec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).