Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 83308 - phoebe 2.4.20-2.21 and rawhide 2.4.20-2.30 duplicate cpu_online definition
Summary: phoebe 2.4.20-2.21 and rawhide 2.4.20-2.30 duplicate cpu_online definition
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: kernel
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Dave Jones
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-02-02 03:34 UTC by Charles R. Anderson
Modified: 2015-01-04 22:02 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-26 04:01:15 UTC


Attachments (Terms of Use)
2.4.20-2.30 patch to move sched.h cpu_online definition inside #ifdef CONFIG_SMP (deleted)
2003-02-02 03:35 UTC, Charles R. Anderson
no flags Details | Diff

Description Charles R. Anderson 2003-02-02 03:34:07 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030115

Description of problem:
While compiling alsa-0.9.0rc7 I encountered some warnings about duplicate
definitions of the cpu_online macro.  The phoebe and rawhide kernels 2.4.20-2.21
and 2.4.20-2.30 include two patches which  both define the cpu_online macro in
conflicting ways:

linux-2.4.20-selected-ac-bits.patch (cpu_online defined in smp.h)
linux-2.4.20-o1-sched+threading-backport.patch (cpu_online defined in sched.h)

>grep "#define cpu_online" linux-2.4.20-selected-ac-bits.patch
linux-2.4.20-o1-sched+threading-backport.patch
linux-2.4.20-selected-ac-bits.patch:+#define cpu_online(cpu)                   
        ({ BUG_ON((cpu) != 0); 1; })
linux-2.4.20-selected-ac-bits.patch: #define cpu_online_map                    
        1
linux-2.4.20-o1-sched+threading-backport.patch:+#define cpu_online(cpu) ((cpu) <
smp_num_cpus)
linux-2.4.20-o1-sched+threading-backport.patch: #define cpu_online_map
cpu_present_mask

Upon further investigation, it seems that the definition in the ac-bits patch is
only for non-SMP use (and in fact it is only defined if CONFIG_SMP is NOT
defined) and the definition of cpu_online in the o1-sched patch is only for use
in SMP systems.  

However, the define in the o1-sched patch isn't protected by a #ifdef
CONFIG_SMP.  I have attached a patch which moves this definition inside the
#ifdef CONFIG_SMP a couple lines later in sched.h.  I'm not entirely sure if
this is a correct fix, but it seems sane to me, and it fixes the aforementioned
alsa compile warnings.


Version-Release number of selected component (if applicable):
2.4.20-2.30


How reproducible:
Always

Steps to Reproduce:
1.  install and boot the phoebe kernel or rawhide 2.4.20-2.30, including
kernel-source
2.  download alsa-driver-0.9.0rc7.tar.bz2 from www.alsa-project.org
3.  compile alsa-driver following the instructions in INSTALL


Actual Results:  Every file that is compiled generates the following warning:

gcc -M -D__KERNEL__ -DMODULE=1
-I/home/cra/src/redhat/BUILD/alsa-driver-0.9.0rc7/include 
-I/lib/modules/2.4.20-2.21/build/include -O2 -mpreferred-stack-boundary=2 -
march=i686 -DLINUX -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe
-DALSA_BUILD  hwdep32.c ioctl32.c pcm32.c rawmidi32.c seq32.c timer32.c > .depend
In file included from /lib/modules/2.4.20-2.21/build/include/linux/mm.h:22,
                 from /lib/modules/2.4.20-2.21/build/include/linux/slab.h:14,
                 from /lib/modules/2.4.20-2.21/build/include/asm/pci.h:32,
                 from /lib/modules/2.4.20-2.21/build/include/linux/pci.h:657,
                 from
/home/cra/src/redhat/BUILD/alsa-driver-0.9.0rc7/include/adriver.h:52,
                 from
/home/cra/src/redhat/BUILD/alsa-driver-0.9.0rc7/include/sound/driver.h:43,
                 from ../../alsa-kernel/core/ioctl32/hwdep32.c:21,
                 from hwdep32.c:2:
/lib/modules/2.4.20-2.21/build/include/linux/sched.h:548:1: warning:
"cpu_online" redefined
In file included from /lib/modules/2.4.20-2.21/build/include/linux/sched.h:25,
                 from /lib/modules/2.4.20-2.21/build/include/linux/mm.h:22,
                 from /lib/modules/2.4.20-2.21/build/include/linux/slab.h:14,
                 from /lib/modules/2.4.20-2.21/build/include/asm/pci.h:32,
                 from /lib/modules/2.4.20-2.21/build/include/linux/pci.h:657,
                 from
/home/cra/src/redhat/BUILD/alsa-driver-0.9.0rc7/include/adriver.h:52,
                 from
/home/cra/src/redhat/BUILD/alsa-driver-0.9.0rc7/include/sound/driver.h:43,
                 from ../../alsa-kernel/core/ioctl32/hwdep32.c:21,
                 from hwdep32.c:2:
/lib/modules/2.4.20-2.21/build/include/linux/smp.h:87:1: warning: this is the
location of the previous definition

Here is the same on 2.4.20-2.30:

gcc -M -D__KERNEL__ -DMODULE=1
-I/home/cra/src/redhat/BUILD/alsa-driver-0.9.0rc7/include 
-I/lib/modules/2.4.20-2.30/build/include -O2 -mpreferred-stack-boundary=2 -
march=i686 -DLINUX -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe
-DALSA_BUILD  hwdep32.c ioctl32.c pcm32.c rawmidi32.c seq32.c timer32.c > .depend
In file included from /lib/modules/2.4.20-2.30/build/include/linux/mm.h:22,
                 from /lib/modules/2.4.20-2.30/build/include/linux/slab.h:14,
                 from /lib/modules/2.4.20-2.30/build/include/asm/pci.h:32,
                 from /lib/modules/2.4.20-2.30/build/include/linux/pci.h:657,
                 from
/home/cra/src/redhat/BUILD/alsa-driver-0.9.0rc7/include/adriver.h:52,
                 from
/home/cra/src/redhat/BUILD/alsa-driver-0.9.0rc7/include/sound/driver.h:43,
                 from ../../alsa-kernel/core/ioctl32/hwdep32.c:21,
                 from hwdep32.c:2:
/lib/modules/2.4.20-2.30/build/include/linux/sched.h:563:1: warning:
"cpu_online" redefined
In file included from /lib/modules/2.4.20-2.30/build/include/linux/sched.h:25,
                 from /lib/modules/2.4.20-2.30/build/include/linux/mm.h:22,
                 from /lib/modules/2.4.20-2.30/build/include/linux/slab.h:14,
                 from /lib/modules/2.4.20-2.30/build/include/asm/pci.h:32,
                 from /lib/modules/2.4.20-2.30/build/include/linux/pci.h:657,
                 from
/home/cra/src/redhat/BUILD/alsa-driver-0.9.0rc7/include/adriver.h:52,
                 from
/home/cra/src/redhat/BUILD/alsa-driver-0.9.0rc7/include/sound/driver.h:43,
                 from ../../alsa-kernel/core/ioctl32/hwdep32.c:21,
                 from hwdep32.c:2:
/lib/modules/2.4.20-2.30/build/include/linux/smp.h:87:1: warning: this is the
location of the previous definition


Expected Results:  After applying the attached patch to
/usr/src/linux-2.4.20/include/linux/sched.h, the warnings disappear.


Additional info:

Comment 1 Charles R. Anderson 2003-02-02 03:35:41 UTC
Created attachment 89777 [details]
2.4.20-2.30 patch to move sched.h cpu_online definition inside #ifdef CONFIG_SMP


Note You need to log in before you can comment on or make changes to this bug.