@@ -72,6 +72,4 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/
SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h``
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h``
CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c``
-QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c``
-QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c``
===================== ================ ======================== ==========================================
@@ -78,6 +78,4 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/
SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h``
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h``
CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c``
-QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c``
-QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c``
===================== ================ ======================== ==========================================
@@ -61,6 +61,4 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/
SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h``
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h``
CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c``
-QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c``
-QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c``
===================== ================ ======================== ==========================================
@@ -64,6 +64,4 @@ FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/
SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h``
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h``
CCB_MAGIC 0xf2691ad2 ccb ``drivers/scsi/ncr53c8xx.c``
-QUEUE_MAGIC_FREE 0xf7e1c9a3 queue_entry ``drivers/scsi/arm/queue.c``
-QUEUE_MAGIC_USED 0xf7e1cc33 queue_entry ``drivers/scsi/arm/queue.c``
===================== ================ ======================== ==========================================
@@ -26,27 +26,11 @@
#include <scsi/scsi_eh.h>
#include <scsi/scsi_tcq.h>
-#define DEBUG
-
typedef struct queue_entry {
struct list_head list;
struct scsi_cmnd *SCpnt;
-#ifdef DEBUG
- unsigned long magic;
-#endif
} QE_t;
-#ifdef DEBUG
-#define QUEUE_MAGIC_FREE 0xf7e1c9a3
-#define QUEUE_MAGIC_USED 0xf7e1cc33
-
-#define SET_MAGIC(q,m) ((q)->magic = (m))
-#define BAD_MAGIC(q,m) ((q)->magic != (m))
-#else
-#define SET_MAGIC(q,m) do { } while (0)
-#define BAD_MAGIC(q,m) (0)
-#endif
-
#include "queue.h"
#define NR_QE 32
@@ -74,7 +58,6 @@ int queue_initialise (Queue_t *queue)
queue->alloc = q = kmalloc_array(nqueues, sizeof(QE_t), GFP_KERNEL);
if (q) {
for (; nqueues; q++, nqueues--) {
- SET_MAGIC(q, QUEUE_MAGIC_FREE);
q->SCpnt = NULL;
list_add(&q->list, &queue->free);
}
@@ -119,9 +102,7 @@ int __queue_add(Queue_t *queue, struct scsi_cmnd *SCpnt, int head)
list_del(l);
q = list_entry(l, QE_t, list);
- BUG_ON(BAD_MAGIC(q, QUEUE_MAGIC_FREE));
- SET_MAGIC(q, QUEUE_MAGIC_USED);
q->SCpnt = SCpnt;
if (head)
@@ -144,9 +125,7 @@ static struct scsi_cmnd *__queue_remove(Queue_t *queue, struct list_head *ent)
*/
list_del(ent);
q = list_entry(ent, QE_t, list);
- BUG_ON(BAD_MAGIC(q, QUEUE_MAGIC_USED));
- SET_MAGIC(q, QUEUE_MAGIC_FREE);
list_add(ent, &queue->free);
return q->SCpnt;
We have largely moved away from this approach, and we have better debugging instrumentation nowadays: kill it Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@kroah.com/ Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> --- Documentation/process/magic-number.rst | 2 -- .../it_IT/process/magic-number.rst | 2 -- .../zh_CN/process/magic-number.rst | 2 -- .../zh_TW/process/magic-number.rst | 2 -- drivers/scsi/arm/queue.c | 21 ------------------- 5 files changed, 29 deletions(-)