From: Vladislav B. <vs...@vl...> - 2008-12-29 14:40:10
|
Erez Zilber, on 12/28/2008 11:05 AM wrote: >> Actually, I would do even more radical. All three those _BIT constants used >> in only one place and in a very specific manner, see description of READ >> POSITION command. So, I would suggest to make them local to >> scst_tape_generic_parse(), their the only user, and delete from >> scst_const.h. >> > > How about this one: > > [PATCH] Move READ POSITION constants to scst_lib.c > > LONG_BIT is already defined in /usr/include/bits/xopen_lim.h. > It is redefined in scst/include/scst_const.h. When including > socket.h & scst_const.h, a compilation error occurs: > > /home1/erez.zilber/work/scst/scst/include/scst_const.h:259:1: error: > "LONG_BIT" redefined > In file included from /usr/include/limits.h:153, > from > /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:122, > from > /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/syslimits.h:7, > from > /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include/limits.h:11, > from /usr/include/bits/socket.h:31, > from /usr/include/sys/socket.h:35, > from main.c:19: > /usr/include/bits/xopen_lim.h:133:1: error: this is the location of > the previous definition > > Since TCLP_BIT, LONG_BIT & BT_BIT are used only by the READ POSITION > command, they should be moved to scst_lib.c. > > Signed-off-by: Erez Zilber <ere...@gm...> > --- > scst/include/scst_const.h | 7 ------- > scst/src/scst_lib.c | 7 +++++++ > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/scst/include/scst_const.h b/scst/include/scst_const.h > index 43fb604..c1d1bd8 100644 > --- a/scst/include/scst_const.h > +++ b/scst/include/scst_const.h > @@ -253,13 +253,6 @@ static inline int scst_is_ua_sense(const uint8_t *sense) > #define SCST_RES_LONGID 0x02 > > /************************************************************* > - ** Bits in the READ POSITION command > - *************************************************************/ > -#define TCLP_BIT 4 > -#define LONG_BIT 2 > -#define BT_BIT 1 > - > -/************************************************************* > ** Values for the control mode page TST field > *************************************************************/ > #define SCST_CONTR_MODE_ONE_TASK_SET 0 > diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c > index a1da67a..b7c12a6 100644 > --- a/scst/src/scst_lib.c > +++ b/scst/src/scst_lib.c > @@ -2200,6 +2200,13 @@ set_timeout: > } > EXPORT_SYMBOL(scst_modisk_generic_parse); > > +/************************************************************** > + ** Bits in the READ POSITION command > + **************************************************************/ > +#define TCLP_BIT 4 > +#define LONG_BIT 2 > +#define BT_BIT 1 > + > int scst_tape_generic_parse(struct scst_cmd *cmd, > int (*get_block_size)(struct scst_cmd *cmd)) > { Thanks, I already did that, although I should sorry since I forgot to write to you about it. Vlad |