Skip to contentSkip to conversation

v850: const-qualify first parameter of find_next_zero_bit

PATCH In review Miles Bader 2 participants 2 messages Jul 20, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 v850: const-qualify first parameter of find_next_zero_bit

 include/asm-v850/bitops.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
include/asm-v850/bitops.h +3 -3
diff -ruN -X../cludes linux-2.6.12-uc0/include/asm-v850/bitops.h linux-2.6.12-uc0-v850-20050720/include/asm-v850/bitops.h
@@ -1,8 +1,8 @@
 /*
  * include/asm-v850/bitops.h -- Bit operations
  *
- *  Copyright (C) 2001,02,03,04  NEC Electronics Corporation
- *  Copyright (C) 2001,02,03,04  Miles Bader <[email protected]>
+ *  Copyright (C) 2001,02,03,04,05  NEC Electronics Corporation
+ *  Copyright (C) 2001,02,03,04,05  Miles Bader <[email protected]>
  *  Copyright (C) 1992  Linus Torvalds.
  *
  * This file is subject to the terms and conditions of the GNU General
@@ -157,7 +157,7 @@
 #define find_first_zero_bit(addr, size) \
   find_next_zero_bit ((addr), (size), 0)
 
-extern __inline__ int find_next_zero_bit (void *addr, int size, int offset)
+extern __inline__ int find_next_zero_bit(const void *addr, int size, int offset)
 {
 	unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
 	unsigned long result = offset & ~31UL;
#1 lore raw

On Wed, 2005-07-20 at 17:38 +0900, Miles Bader wrote:
[...]

include/asm-v850/bitops.h line 162

Quoted 8 lines
include/asm-v850/bitops.h +1 -1
@@ -157,7 +157,7 @@
 #define find_first_zero_bit(addr, size) \
   find_next_zero_bit ((addr), (size), 0)
 
-extern __inline__ int find_next_zero_bit (void *addr, int size, int offset)
+extern __inline__ int find_next_zero_bit(const void *addr, int size, int offset)
 {
 	unsigned long *p = ((unsigned long *) addr) + (offset >> 5);

Why not const-qualify *p and the cast also (avoiding warnings and actually making the change complete)?

Bernd

Signature · 3 lines
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services