disk/ata.c changes, repost
Hello,
this patch just changes output of debug printing ata devices found in machine.
i hope now coding style is acceptable
Signature · 2 lines
agaran at pld dash linux dot org :: PLD Linux Developer [#133161] I do not fear computers. I fear the lack of them. [Isaac Asimov]
Index: disk/ata.c
===================================================================
RCS file: /sources/grub/grub2/disk/ata.c,v
retrieving revision 1.6
ata.c +39 -8
@@ -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