Re: [PATCH] Promise 'stex' driver

Alexey Dobriyan
2006-06-10T17:47:58Z

On Sat, Jun 10, 2006 at 12:08:52PM -0400, Jeff Garzik wrote:
> --- /dev/null
> +++ b/drivers/scsi/stex.c

> +static inline void stex_gettime(u32 *time)

__le32 *time

> +{
> + struct timeval tv;
> + do_gettimeofday(&tv);
> +
> + *time = cpu_to_le32(tv.tv_sec & 0xffffffff);
> + *(time + 1) = cpu_to_le32((tv.tv_sec >> 16) >> 16);
> +}

> +static void
> +stex_send_cmd(struct st_hba *hba, struct req_msg *req, u16 tag)
> +{
> + req->tag = cpu_to_le16(tag);
> + req->task_attr = TASK_ATTRIBUTE_SIMPLE;
> + req->task_manage = 0; /* not supported yet */
> + req->payload_sz = (u8)(sizeof(struct req_msg)/sizeof(u32));

sparse warns here. Is this OK?

drivers/scsi/stex.c:442:47: warning: cast truncates bits from constant value (106 becomes 6)