Search Linux Wireless

Re: [PATCH 1/3] compat: Backport vga_switcheroo_client_ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 14, 2012 at 10:57 AM, Ozan Çağlayan <ozancag@xxxxxxxxx> wrote:
> On Thu, Jun 14, 2012 at 8:52 PM, Ozan Çağlayan <ozancag@xxxxxxxxx> wrote:
>> This backports:
>>
>>  From 26ec685ff9d9c16525d8ec4c97e52fcdb187b302 Mon Sep 17 00:00:00
>>
>>  From: Takashi Iwai <tiwai@xxxxxxx>
>>  Date: Fri, 11 May 2012 07:51:17 +0200
>>  Subject: [PATCH] vga_switcheroo: Introduce struct vga_switcheroo_client_ops
>>
>>  only for kernels >= 2.6.34 in which vga_switcheroo is available.
>
> Do you accept conditional additions like this into compat? If not,
> what is the proper way of doing this?

Sure thing, we do this in numerous places, good stuff!

> Another question, the vga_switcheroo.h which is included here for the
> enum declaration is not guarded against multiple inclusion. So when
> building compat-drm/drm/i915, I get nested declaration error. I looked
> at other headers and they are all guarded, so I sent a patch to
> dri-devel which adds ifndef guard in vga_switcheroo.h. Is this the
> correct way of fixing a second inclusion of an header file which gets
> already included through compat?

Sure thing, the upstream version should have had that check, thanks
for sending that upstream!

I should also note though for future development if you run into a
header that is *not* present on older kernels but you want to bring
forward for older kernels *but* you do not want that compat header to
replace the one on newer kernels you can do something like this (this
is include/linux/kfifo.h on compat.git):

#include <linux/version.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
#include_next <linux/kfifo.h>
#else

/* the rest of the foo kfifo.h */

#endif
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) */

In your case you do not seem to need this given that you are not
bringing forward switcheroo to older kernels, but if you could you may
be able to pull it off using a hack like the above.

  Luis
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux