rq_data_dir() in linux/blkdev.h is redundant

Xiaogeng (Shawn) Jin xjin at redswitch.com
Thu Jan 9 21:37:45 EST 2003


When compiling linuxppc_2_4_devel (2.4.21-pre3) with the latest 
MTD/JFFS2 code, I had such error posted in a previous message.

ppc_8xx-gcc -D__KERNEL__ 
devel/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 
-fno-common -fomit-frame-pointer 
ppc_2_4_devel/arch/ppc -fsigned-char -msoft-float -pipe -ffixed-r2 
lized -mmultiple -mstring   -nostdinc -I 
2.95.4/include -DKBUILD_BASENAME=mtdblock_core  -c -o mtdblock-core.o 
In file included from 
                  from mtdblock-core.c:18:
h:147: parse error before `struct'

After traced down the problem, I found that it was caused by the 
definition of rq_data_dir() in linux/blkdev.h. The definition is as 
follows, which seems to be useless.

extern inline int rq_data_dir(struct request *rq)
	if (rq->cmd == READ)
		return READ;
	else if (rq->cmd == WRITE)
		return WRITE;
	else {
		return -1;

Actually linux/mtd/compacmatmac.h defines rq_data_dir() as
   #define rq_data_dir(x) ((x)->cmd)
if the kernel version is older than 2.5.0.

Shawn Jin
RedSwitch Inc.

More information about the linux-mtd mailing list