From: Gianluca Gennari <gennarone@gmail.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] media_build: fix module_*_driver redefined warnings
Date: Mon, 09 Apr 2012 16:15:29 +0200 [thread overview]
Message-ID: <4F82EF01.1090403@gmail.com> (raw)
In-Reply-To: <4F82D768.5030007@redhat.com>
Il 09/04/2012 14:34, Mauro Carvalho Chehab ha scritto:
> Hi Gianluca,
>
> Em 20-03-2012 11:10, Gianluca Gennari escreveu:
>
> Please avoid adding more tests for an specific Kernel version here. There are
> two issues with checks like that:
>
> 1) this may break on some kernel-fix release that might backport the function.
> This is not very common, but there was some cases like that, in the USB subsystem;
>
> 2) this generally breaks compilation, after some time, if someone tries
> to compile it against a distribution-patched kernel, as the new code may be
> backported there.
>
> That's said, if just doing an "#ifdef module_usb_driver" doesn't work because this
> is not a macro, you can add a simple check at this script:
> v4l/scripts/make_config_compat.pl
>
> like this one:
>
> check_file_for_func("include/linux/delay.h", "usleep_range", "NEED_USLEEP_RANGE");
>
> This function will seek for "usleep_range" at the delay.h header. If not found, it will
> add a #define NEED_USLEEP_RANGE at v4l/config-compat.h, that can be checked inside compat.h:
>
> #ifdef NEED_USLEEP_RANGE
> #define usleep_range(min, max) msleep(min/1000)
> #endif
>
> You can use the same kind of logic for module_usb_driver.
>
> Regards,
> Mauro
Hi Mauro,
thanks for the explanation but Hans Verkuil already solved the issue
using the check_file_for_func method:
http://git.linuxtv.org/media_build.git/commit/2492bf186743a925db98694911649fa0e94003f5
Of course, I agree this is a much better solution.
Regards,
Gianluca
next prev parent reply other threads:[~2012-04-09 14:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-20 14:10 [PATCH] media_build: fix module_*_driver redefined warnings Gianluca Gennari
2012-04-09 12:34 ` Mauro Carvalho Chehab
2012-04-09 14:15 ` Gianluca Gennari [this message]
2012-04-09 16:31 ` Mauro Carvalho Chehab
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=4F82EF01.1090403@gmail.com \
--to=gennarone@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.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).