Re: cciss CSMI via sysfs for 2.6

From: Toon van der Pas
Date: Sat Feb 19 2005 - 14:13:37 EST


On Wed, Feb 16, 2005 at 10:45:12AM -0600, mike.miller@xxxxxx wrote:
> +static ssize_t cciss_phyinfo_show(struct device *dev, char *buf)
> +{
> + ctlr_info_t *h = dev->driver_data;
> + unsigned long flags;
> + CommandList_struct *c;
> + CSMI_SAS_PHY_INFO_BUFFER iocommand;
> + CSMI_SAS_IDENTIFY p;
> + u64bit temp64;
> + DECLARE_COMPLETION(wait);
> +
> + printk(KERN_WARNING "cciss: into cciss_phyinfo_show\n");
> + memset(&iocommand, 0, sizeof(CSMI_SAS_PHY_INFO_BUFFER));
> + memset(&p, 0, sizeof(CSMI_SAS_IDENTIFY));
> +
> + /* allocate and fill in the command */
> + if ((c = cmd_alloc(h, 0)) == NULL)
> + return -ENOMEM;
> +
> + iocommand.IoctlHeader.Length = sizeof(CSMI_SAS_PHY_INFO_BUFFER);
> + c->cmd_type = CMD_IOCTL_PEND;
> + c->Header.ReplyQueue = 0;
> +
> + //Do we send the whole buffer?
> + if (iocommand.IoctlHeader.Length > 0){

This test will always be true, no?

> + c->Header.SGList = 1;
> + c->Header.SGTotal = 1;
> + } else {
> + c->Header.SGList = 0;
> + c->Header.SGTotal = 0;
> + }

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/