mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Justin Cormack <justin@street-vision.com>
To: Kernel mailing list <linux-kernel@vger.kernel.org>
Subject: [PATCH] [libata] quick fix for vendor and model names
Date: Tue, 06 Apr 2004 18:54:16 +0100	[thread overview]
Message-ID: <1081274055.18070.29.camel@lotte.street-vision.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

ok, so transport attributes arent happening for libata. Howabout this
little patch to fix up the vendor and model names in the common case
when they are 3 chars + 16 chars (like almost all hard drives) so the
model names arent truncated in this case. Otherwise leaves things as
they are.

Justin



[-- Attachment #2: libata-hackpatch --]
[-- Type: text/x-patch, Size: 934 bytes --]

diff -urN linux-2.6.5-orig/drivers/scsi/libata-scsi.c linux-2.6.5/drivers/scsi/libata-scsi.c
--- linux-2.6.5-orig/drivers/scsi/libata-scsi.c	2004-04-04 03:36:57.000000000 +0000
+++ linux-2.6.5/drivers/scsi/libata-scsi.c	2004-04-06 17:10:57.000000000 +0000
@@ -464,11 +464,17 @@
 	memcpy(rbuf, hdr, sizeof(hdr));
 
 	if (buflen > 36) {
-		memcpy(&rbuf[8], args->dev->vendor, 8);
-		memcpy(&rbuf[16], args->dev->product, 16);
+	        /* hack for common ata vendor/product strings */
+	        if (args->dev->product[3] == ' ') {
+		        memcpy(&rbuf[8], args->dev->product, 4);
+			memset(&rbuf[12], ' ', 4);
+		        memcpy(&rbuf[16], &args->dev->product[4], 16);
+	        } else {
+		        memcpy(&rbuf[8], args->dev->vendor, 8);
+		        memcpy(&rbuf[16], args->dev->product, 16);
+		}
 		memcpy(&rbuf[32], DRV_VERSION, 4);
 	}
-
 	if (buflen > 63) {
 		const u8 versions[] = {
 			0x60,	/* SAM-3 (no version claimed) */

             reply	other threads:[~2004-04-06 17:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-06 17:54 Justin Cormack [this message]
2004-06-19 20:17 ` Jeff Garzik

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=1081274055.18070.29.camel@lotte.street-vision.com \
    --to=justin@street-vision.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®