In the header file scst.h scst_cmd::sg_cnt and tgt_sg_cnt::sg_cnt are declared

as signed integers, while some inline functions in the same header file treat
these as unsigned integers. The patch below converts all uses to signed
integer. 

The patch below has been verified by checking the output files generated by
the following command:
  scripts/run-regression-tests -k 2.6.24.7 -k 2.6.25.20 -k 2.6.26.8 -k 2.6.27.13 -k 2.6.28.2

Note: I do not expect that this patch changes the behavior of SCST in any way.
This patch is not a bug fix -- all it does is cleaning up an inconsistency.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@659 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2009-02-02 16:25:47 +00:00
parent d5322f10ad
commit b237ddf08f

View File

@@ -2098,7 +2098,7 @@ static inline struct scatterlist *scst_cmd_get_sg(struct scst_cmd *cmd)
* Usage of this function is not recommended, use scst_get_buf_*()
* family of functions instead.
*/
static inline unsigned int scst_cmd_get_sg_cnt(struct scst_cmd *cmd)
static inline int scst_cmd_get_sg_cnt(struct scst_cmd *cmd)
{
return cmd->sg_cnt;
}
@@ -2122,14 +2122,14 @@ static inline struct scatterlist *scst_cmd_get_tgt_sg(struct scst_cmd *cmd)
}
/* Returns cmd's target's sg_cnt */
static inline unsigned int scst_cmd_get_tgt_sg_cnt(struct scst_cmd *cmd)
static inline int scst_cmd_get_tgt_sg_cnt(struct scst_cmd *cmd)
{
return cmd->tgt_sg_cnt;
}
/* Sets cmd's target's SG data buffer */
static inline void scst_cmd_set_tgt_sg(struct scst_cmd *cmd,
struct scatterlist *sg, unsigned int sg_cnt)
struct scatterlist *sg, int sg_cnt)
{
cmd->tgt_sg = sg;
cmd->tgt_sg_cnt = sg_cnt;