Bug 152634 - Compiler warning from error in include/linux/delay.h
Summary: Compiler warning from error in include/linux/delay.h
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
(Show other bugs)
Version: 4.0
Hardware: All Linux
Target Milestone: ---
: ---
Assignee: Dave Jones
QA Contact: Brian Brock
Depends On:
TreeView+ depends on / blocked
Reported: 2005-03-30 21:59 UTC by John A. Tamplin
Modified: 2015-01-04 22:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-06-27 20:07:02 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description John A. Tamplin 2005-03-30 21:59:08 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20041020 Firefox/0.10.1

Description of problem:
The definition of mdelay() in include/linux/delay.h includes a definition of the variable warned, but the following use of that variable is commented out.  This results in every module that uses the mdelay macro giving a warning about the unused variable warned.

Assuming the reason for commenting out the use of the variable is valid, the definition of the variable should also be commented out.  Here is the definition:

#define mdelay(n) (                                     \
        {                                               \
                static int warned=0;                    \
                unsigned long __ms=(n);                 \
                /*WARN_ON(in_irq() && !(warned++));*/   \
                while (__ms--) udelay(1000);            \

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

How reproducible:

Steps to Reproduce:
1.install kernel source rpm
2.rpmbuild -bb /usr/src/redhat/SPECS/kernel-2.6.spec
3.notice warnings

Actual Results:  Compilation warnings such as:

drivers/video/cirrusfb.c: In function `init_vgachip':
drivers/video/cirrusfb.c:1801: warning: unused variable `warned'

Expected Results:  None of those warnings 

Additional info:

This obviously does not cause any real harm, but the fix is trivial and would help reduce the clutter of meaningless warnings making it easier to see real warnings that might cause real problems.

Comment 1 Dave Jones 2005-03-30 22:08:35 UTC
already fixed in CVS, will be in U1.

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