From patchwork Mon Feb 4 20:22:49 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Udo Richter X-Patchwork-Id: 12596 Received: from mail.gmx.net ([213.165.64.20]) by www.linuxtv.org with smtp (Exim 4.63) (envelope-from ) id 1JM7sQ-0008Gy-GK for vdr@linuxtv.org; Mon, 04 Feb 2008 21:25:14 +0100 Received: (qmail invoked by alias); 04 Feb 2008 20:24:41 -0000 Received: from Wbac7.w.pppool.de (EHLO localhost) [89.58.186.199] by mail.gmx.net (mp037) with SMTP; 04 Feb 2008 21:24:41 +0100 X-Authenticated: #1417946 X-Provags-ID: V01U2FsdGVkX1/jXEEsvCjjsDCRZNgjvKxRdCm6Sre3e/svXqbOPP K86VALi/56MWiT Message-ID: <47A77419.8020404@gmx.de> Date: Mon, 04 Feb 2008 21:22:49 +0100 From: Udo Richter User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: VDR Mailing List References: <47A5AFC5.2010709@gmx.de> In-Reply-To: <47A5AFC5.2010709@gmx.de> X-Y-GMX-Trusted: 0 Subject: Re: [vdr] [PATCH] DVB API wrapper patch v0.2 for VDR-1.5.14 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2008 20:25:14 -0000 Status: O X-Status: X-Keywords: X-UID: 15538 For people who encounter this bug on recent kernels: dvb_api_wrapper.c:189: error: '__invalid_size_argument_for_IOC' cannot appear in a constant-expression This is caused by an obscure kernel compile check that is supposed to do macro parameter checking for ioctl constants, but also prevents using these constants in switch statements. (Basically, it complains that an expression like this is not allowed: case (true ? 1234 : some_var): The glory details are in /usr/include/asm-generic/ioctl.h) The attached (additional, because I'm lazy) patch works around this. Cheers, Udo --- dvb_api_wrapper.c.orig 2008-02-04 21:12:33.000000000 +0100 +++ dvb_api_wrapper.c 2008-02-04 21:10:30.000000000 +0100 @@ -185,18 +185,16 @@ } int DVBFE_ioctl(int d, int request, void *data) { - switch (request) { - case DVBFE_SET_PARAMS: - return ioctl_DVBFE_SET_PARAMS(d, (dvbfe_params*)data); - case DVBFE_GET_DELSYS: - return ioctl_DVBFE_GET_DELSYS(d, (dvbfe_delsys*)data); - case DVBFE_GET_INFO: - return ioctl_DVBFE_GET_INFO(d, (dvbfe_info*)data); - case DVBFE_GET_PARAMS: - case DVBFE_GET_EVENT: - errno = EINVAL; - return -1; - } + if (request == (int)DVBFE_SET_PARAMS) + return ioctl_DVBFE_SET_PARAMS(d, (dvbfe_params*)data); + if (request == (int)DVBFE_GET_DELSYS) + return ioctl_DVBFE_GET_DELSYS(d, (dvbfe_delsys*)data); + if (request == (int)DVBFE_GET_INFO) + return ioctl_DVBFE_GET_INFO(d, (dvbfe_info*)data); + if (request == (int)DVBFE_GET_PARAMS || request == (int)DVBFE_GET_EVENT) { + errno = EINVAL; + return -1; + } return ioctl(d, request, data); }