Bug 83308 - phoebe 2.4.20-2.21 and rawhide 2.4.20-2.30 duplicate cpu_online definition
phoebe 2.4.20-2.21 and rawhide 2.4.20-2.30 duplicate cpu_online definition
Status: CLOSED WONTFIX
Product: Red Hat Raw Hide
Classification: Retired
Component: kernel (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Dave Jones
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-02-01 22:34 EST by Charles R. Anderson
Modified: 2015-01-04 17:02 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-26 00:01:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Charles R. Anderson 2003-02-01 22:34:07 EST
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-01 22:35:41 EST
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.