From patchwork Sun May 1 01:28:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 744162 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p411TMKe021972 for ; Sun, 1 May 2011 01:29:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751222Ab1EAB3G (ORCPT ); Sat, 30 Apr 2011 21:29:06 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:32844 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023Ab1EAB3F (ORCPT ); Sat, 30 Apr 2011 21:29:05 -0400 Received: by gyd10 with SMTP id 10so1627398gyd.19 for ; Sat, 30 Apr 2011 18:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=jklYK/MRPgbE/EisQYsu+UbnTVhUBbuqtnv208dvtEI=; b=J8xzd1psyOcS7nhlpAxjTSYAbO7xaiR3Vn8Qgps5fjmSiXjBBnWPkIZRTsom2CQz4J Sc3xXltLbjUbKfghD/k+T48lGo4ZoZPBFo9JZJucHgPnaP15gybobSjNLxJvD77DC6A1 pgUcKlqNz5ncn36RVqRWYx0n6bnF/MpLpkCJ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=QL0fkjsWKMuHQJsZlXT1l7e5tTX5I3lt2k5Z3DE+saUGVI+jIvT4KUsALnbGVsAGOO As1b80dCMK6rR/J5WTXxSLFK5eurwQo4F/TZJ0GHS4FbCV/v/lzxKTU9jKi3LFXbAsnL 3M8r3iU9z80cYcHXqbvr+NO/jsv5+TzTauRaU= Received: by 10.236.147.38 with SMTP id s26mr7671716yhj.308.1304213341377; Sat, 30 Apr 2011 18:29:01 -0700 (PDT) Received: from [192.168.30.170] ([187.106.173.121]) by mx.google.com with ESMTPS id x68sm1902599yhn.57.2011.04.30.18.28.59 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 30 Apr 2011 18:29:00 -0700 (PDT) Message-ID: <4DBCB758.2000303@gmail.com> Date: Sat, 30 Apr 2011 22:28:56 -0300 From: Mauro Carvalho Chehab User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Red Hat/3.1.7-3.el6_0 Thunderbird/3.1.7 MIME-Version: 1.0 To: Colin Minihan CC: Andy Walls , linux-media@vger.kernel.org Subject: Re: Build Failure References: <1304179815.2434.10.camel@localhost> In-Reply-To: <1304179815.2434.10.camel@localhost> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 01 May 2011 01:29:23 +0000 (UTC) Em 30-04-2011 13:10, Andy Walls escreveu: > On Sat, 2011-04-30 at 10:31 -0400, Colin Minihan wrote: >> On Ubuntu 10.04 attempting to run >> >> git clone git://linuxtv.org/media_build.git >> cd media_build >> ./check_needs.pl >> make -C linux/ download >> make -C linux/ untar >> make stagingconfig >> make >> >> results in the following failure >> ... >> CC [M] /home/colm/media_build/v4l/lirc_zilog.o >> /home/colm/media_build/v4l/lirc_zilog.c: In function 'destroy_rx_kthread': >> /home/colm/media_build/v4l/lirc_zilog.c:238: error: implicit >> declaration of function 'IS_ERR_OR_NULL' > > Well, IS_ERR_OR_NULL() went into the kernel in December 2009: > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=603c4ba96be998a8dd7a6f9b23681c49acdf4b64 > > so it should be in kernel version 2.6.33 and later. This is defined at include/linux/err.h as: #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) static inline long __must_check IS_ERR_OR_NULL(const void *ptr) { return !ptr || IS_ERR_VALUE((unsigned long)ptr); } > > If you don't want to generate a patch for the media_build backward > compatability build system, you can probably just patch your kernel > header file or trivially hack the function it into > > drivers/staging/lirc/lirc_zilog.c > > to get past your current build error. But I suspect you'll run into > more errors. When I make changes to a module (like lirc_zilog.c), I > tend to use the latest kernel interfaces at the time of the changes. > > If you don't need lirc_zilog.ko built, then configure the build system > to not build the module. To make it work, it is probably as simple as adding this into v4l/compat.h: #if NEED_IS_ERR_OR_NULL #define IS_ERR_OR_NULL(ptr) (!(ptr) || IS_ERR_VALUE((unsigned long)(ptr))) #endif And: check_file_for_func("include/linux/err.h", "IS_ERR_OR_NULL", "NEED_IS_ERR_OR_NULL"); at v4l/scripts/make_config_compat.pl, as the enclosed (not tested) patch. Please test it and, if it wors, ping us for its inclusion at media_tree.git. Otherwise, feel free to fix it and submit us the fix. Thanks! Mauro --- Add backward support for IS_ERR_OR_NULL Signed-off-by: Mauro Carvalho Chehab -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/v4l/compat.h b/v4l/compat.h index bc8d71f..9dbe54f 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -796,4 +796,8 @@ static inline int snd_ctl_enum_info(struct snd_ctl_elem_info *info, unsigned int #define usleep_range(min, max) msleep(min/1000) #endif +#if NEED_IS_ERR_OR_NULL +#define IS_ERR_OR_NULL(ptr) (!(ptr) || IS_ERR_VALUE((unsigned long)(ptr))) +#endif + #endif /* _COMPAT_H */ diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index a426134..01f6c30 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -492,6 +492,7 @@ sub check_other_dependencies() check_file_for_func("include/sound/control.h", "snd_ctl_enum_info", "NEED_SND_CTL_ENUM_INFO"); check_file_for_func("include/linux/sysfs.h", "sysfs_attr_init", "NEED_SYSFS_ATTR_INIT"); check_file_for_func("include/linux/delay.h", "usleep_range", "NEED_USLEEP_RANGE"); + check_file_for_func("include/linux/err.h", "IS_ERR_OR_NULL", "NEED_IS_ERR_OR_NULL"); } # Do the basic rules