public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: linux-ia64@vger.kernel.org
Subject: Re: Fix simscsi for new SCSI midlayer
Date: Fri, 16 Sep 2005 17:08:21 +0000	[thread overview]
Message-ID: <20050916170821.GA9382@agluck-lia64.sc.intel.com> (raw)
In-Reply-To: <17193.2055.852485.3865@berry.gelato.unsw.EDU.AU>

On Thu, Sep 15, 2005 at 03:35:03PM +1000, Peter Chubb wrote:
> +	char localbuf[60];

What is the magic number "60"? Shouldn't this be some kind of structure?

> -			buf = sc->request_buffer;
> +			buf = localbuf;

Ahh, I see, you inherited this avoidance of real structure ... but the
60 only needs to be 36, yes?

>  			buf[0] = 0;	/* magnetic disk */
>  			buf[1] = 0;	/* not a removable medium */
>  			buf[2] = 2;	/* SCSI-2 compliant device */
>  			buf[3] = 2;	/* SCSI-2 response data format */
>  			buf[4] = 31;	/* additional length (bytes) */
>  			buf[5] = 0;	/* reserved */
>  			buf[6] = 0;	/* reserved */
>  			buf[7] = 0;	/* various flags */
>  			memcpy(buf + 8, "HP      SIMULATED DISK  0.00",  28);
> +			simscsi_fillresult(sc, buf, 34);

28 + 8 = 36 ... so you lose the "00" by only copying 34 bytes.

-Tony

      reply	other threads:[~2005-09-16 17:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-15  5:35 Fix simscsi for new SCSI midlayer Peter Chubb
2005-09-16 17:08 ` Luck, Tony [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050916170821.GA9382@agluck-lia64.sc.intel.com \
    --to=tony.luck@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox