Skip to contentSkip to conversation

DRBD: Delete superfluous defn of "ARRY_SIZE".

PATCH In review Robert P. J. Day 2 participants 2 messages Mar 9, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 DRBD: Delete superfluous defn of "ARRY_SIZE".

---

given that the macro is misspelled, no one appears to use it, and
there already is an ARRAY_SIZE() macro defined in kernel.h for general use, there's really no reason for this to be here.

drivers/block/drbd/drbd_main.c +0 -2
index ab871e0..36508ea 100644
@@ -156,8 +156,6 @@ static const struct block_device_operations drbd_ops = {
 	.release = drbd_release,
 };
 
-#define ARRY_SIZE(A) (sizeof(A)/sizeof(A[0]))
-
 #ifdef __CHECKER__
 /* When checking with sparse, and this is an inline function, sparse will
    give tons of false positives. When this is a real functions sparse works.

rday
--

========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA

Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday

========================================================================

maintainer
#1 lore raw
Quoted 14 lines · Robert P. J. Day

---

given that the macro is misspelled, no one appears to use it, and
there already is an ARRAY_SIZE() macro defined in kernel.h for general use, there's really no reason for this to be here.

drivers/block/drbd/drbd_main.c +0 -0
index ab871e0..36508ea 100644

drivers/block/drbd/drbd_main.c static const struct block_device_operations drbd_ops = { · line 159

Quoted 4 lines
drivers/block/drbd/drbd_main.c +0 -1
@@ -156,8 +156,6 @@ static const struct block_device_operations drbd_ops = {
 	.release = drbd_release,
 };
 
-#define ARRY_SIZE(A) (sizeof(A)/sizeof(A[0]))

Wow.
Thats a leftover from 2001 ... linux-2.4.4 days. And even then it was unused, and the ARRAY_SIZE macro was already in linux/kernel.h

;-)

Signature · 5 lines
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.