public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Schlichter <thomas.schlichter@web.de>
To: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: [PATCH] fix warning about duplicate 'const'
Date: Tue, 9 Mar 2004 00:43:18 +0100	[thread overview]
Message-ID: <200403090043.21043.thomas.schlichter@web.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 804 bytes --]

Hi,

attached is a patch which fixes following wanings:

drivers/ide/ide-tape.c: In function `idetape_setup':
drivers/ide/ide-tape.c:4701: Warnung: duplicate `const'
drivers/video/matrox/matroxfb_g450.c: In function `g450_compute_bwlevel':
drivers/video/matrox/matroxfb_g450.c:129: Warnung: duplicate `const'
drivers/video/matrox/matroxfb_g450.c:130: Warnung: duplicate `const'
drivers/video/matrox/matroxfb_maven.c: In function `maven_compute_bwlevel':
drivers/video/matrox/matroxfb_maven.c:347: Warnung: duplicate `const'
drivers/video/matrox/matroxfb_maven.c:348: Warnung: duplicate `const'

This is done by removing the 'const' from the temporary variables of the min() 
and max() macros. For me it seems to have no negative impact, so please 
consider applying...

Best regards
   Thomas Schlichter

[-- Attachment #2: fix-duplicate-const-warning.diff --]
[-- Type: text/x-diff, Size: 678 bytes --]

--- linux-2.6.4-rc2/include/linux/kernel.h.orig	2004-03-04 07:16:34.000000000 +0100
+++ linux-2.6.4-rc2/include/linux/kernel.h	2004-03-09 00:34:21.980935992 +0100
@@ -168,15 +168,15 @@ extern void dump_stack(void);
  * "unnecessary" pointer comparison.
  */
 #define min(x,y) ({ \
-	const typeof(x) _x = (x);	\
-	const typeof(y) _y = (y);	\
-	(void) (&_x == &_y);		\
+	typeof(x) _x = (x);	\
+	typeof(y) _y = (y);	\
+	(void) (&_x == &_y);	\
 	_x < _y ? _x : _y; })
 
 #define max(x,y) ({ \
-	const typeof(x) _x = (x);	\
-	const typeof(y) _y = (y);	\
-	(void) (&_x == &_y);		\
+	typeof(x) _x = (x);	\
+	typeof(y) _y = (y);	\
+	(void) (&_x == &_y);	\
 	_x > _y ? _x : _y; })
 
 /*

             reply	other threads:[~2004-03-08 23:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-08 23:43 Thomas Schlichter [this message]
2004-03-09  0:14 ` [PATCH] fix warning about duplicate 'const' Andrew Morton
2004-03-09  0:32   ` Linus Torvalds
2004-03-09  1:17     ` Thomas Schlichter
2004-03-09  1:32       ` Linus Torvalds
2004-03-09  1:35         ` Linus Torvalds
2004-03-10  4:08         ` Keith Duthie
     [not found]         ` <20040310054918.GB4068@twiddle.net>
2004-03-10  8:10           ` Gabriel Dos Reis
     [not found]           ` <20040310064001.GA7584@daikokuya.co.uk>
2004-03-10 10:15             ` Joseph S. Myers
2004-03-10 15:43           ` Linus Torvalds
2004-03-10 18:22             ` Richard Henderson
2004-03-10 18:29               ` Andrew Haley
2004-03-10 18:35                 ` Paul Koning
2004-03-10 18:37                 ` Richard Henderson
2004-03-16  1:46             ` Mike Stump

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200403090043.21043.thomas.schlichter@web.de \
    --to=thomas.schlichter@web.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox