All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej 'Agaran' Pijanka <agaran@pld-linux.org>
To: grub-devel@gnu.org
Subject: disk/ata.c changes, repost
Date: Sat, 2 Feb 2008 00:34:41 +0100	[thread overview]
Message-ID: <20080201233441.GA15547@ep09.pld-linux.org> (raw)

[-- Attachment #1: Type: message/rfc822, Size: 263 bytes --]


this patch just changes output of debug printing ata devices
found in machine.

i hope now coding style is acceptable

-- 
agaran at pld dash linux dot org :: PLD Linux Developer [#133161]
I do not fear computers. I fear the lack of them. [Isaac Asimov]

[-- Attachment #2: grub2-ata.patch --]
[-- Type: text/plain, Size: 1550 bytes --]

Index: disk/ata.c
===================================================================
RCS file: /sources/grub/grub2/disk/ata.c,v
retrieving revision 1.6
diff -u -r1.6 ata.c
--- disk/ata.c	5 Nov 2007 16:15:26 -0000	1.6
+++ disk/ata.c	1 Feb 2008 23:29:17 -0000
@@ -204,18 +204,49 @@
 grub_ata_dumpinfo (struct grub_ata_device *dev, char *info)
 {
   char text[41];
+  char *s,*p = 0;
 
   /* The device information was read, dump it for debugging.  */
+
+  /* Model */
+  grub_ata_strncpy (text, info + 54, 40);
+  /* Now strip trailing spaces */
+  s=text;
+  while(*s)
+  {  
+    if(*s != ' ')
+      p = (char *)s;
+    s++;
+  }
+  p++;
+  *p = '\0';
+  grub_printf("ata%d: Model: %s, (Addr: %d)\n", dev->port * 2 + dev->device, text, dev->addr);
+  /* serial */
   grub_ata_strncpy (text, info + 20, 20);
-  grub_printf ("Serial: %s\n", text);
+  /* Now strip trailing spaces */
+  s=text;
+  while(*s)
+  {  
+    if(*s != ' ')
+      p = (char *)s;
+    s++;
+  }
+  p++;
+  *p = '\0';
+  grub_printf("      Serial: %s, ", text);
+  /* Firmware */
   grub_ata_strncpy (text, info + 46, 8);
-  grub_printf ("Firmware: %s\n", text);
-  grub_ata_strncpy (text, info + 54, 40);
-  grub_printf ("Model: %s\n", text);
-
-  grub_printf ("Addressing: %d\n", dev->addr);
-  grub_printf ("#sectors: %d\n", dev->size);
-
+  /* Now strip trailing spaces */
+  s=text;
+  while(*s)
+  {  
+    if(*s != ' ')
+      p = (char *)s;
+    s++;
+  }
+  p++;
+  *p = '\0';
+  grub_printf ("Firmware: %s, #sectors: %d\n", text, dev->size);
 }
 
 static grub_err_t

                 reply	other threads:[~2008-02-01 23:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080201233441.GA15547@ep09.pld-linux.org \
    --to=agaran@pld-linux.org \
    --cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.