Skip to contentSkip to conversation

Partition support: remove newline from partition name

PATCH New Wolfgang Denk 1 participant 3 messages Jul 28, 2009 – Aug 9, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Partition support: remove newline from partition name

Remove bogus newline character that got added to the .name field of the disk_partition_t structure.

---
 disk/part_dos.c |   15 ++++++++++-----
 disk/part_efi.c |    2 +-
 disk/part_iso.c |   15 ++++++++++-----
 3 files changed, 21 insertions(+), 11 deletions(-)
disk/part_dos.c +10 -5
index 93bf3dd..b915eb7 100644
@@ -198,19 +198,24 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part
 				case IF_TYPE_IDE:
 				case IF_TYPE_SATA:
 				case IF_TYPE_ATAPI:
-					sprintf ((char *)info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num);
+					sprintf ((char *)info->name, "hd%c%d",
+						'a' + dev_desc->dev, part_num);
 					break;
 				case IF_TYPE_SCSI:
-					sprintf ((char *)info->name, "sd%c%d\n", 'a' + dev_desc->dev, part_num);
+					sprintf ((char *)info->name, "sd%c%d",
+						'a' + dev_desc->dev, part_num);
 					break;
 				case IF_TYPE_USB:
-					sprintf ((char *)info->name, "usbd%c%d\n", 'a' + dev_desc->dev, part_num);
+					sprintf ((char *)info->name, "usbd%c%d",
+						'a' + dev_desc->dev, part_num);
 					break;
 				case IF_TYPE_DOC:
-					sprintf ((char *)info->name, "docd%c%d\n", 'a' + dev_desc->dev, part_num);
+					sprintf ((char *)info->name, "docd%c%d",
+						'a' + dev_desc->dev, part_num);
 					break;
 				default:
-					sprintf ((char *)info->name, "xx%c%d\n", 'a' + dev_desc->dev, part_num);
+					sprintf ((char *)info->name, "xx%c%d",
+						'a' + dev_desc->dev, part_num);
 					break;
 			}
 			/* sprintf(info->type, "%d, pt->sys_ind); */
disk/part_efi.c +1 -1
index 626f022..1b04c27 100644
@@ -169,7 +169,7 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int part,
 		     - info->start;
 	info->blksz = GPT_BLOCK_SIZE;
 
-	sprintf((char *)info->name, "%s%d\n", GPT_ENTRY_NAME, part);
+	sprintf((char *)info->name, "%s%d", GPT_ENTRY_NAME, part);
 	sprintf((char *)info->type, "U-Boot");
 
 	debug("%s: start 0x%lX, size 0x%lX, name %s", __FUNCTION__,
disk/part_iso.c +10 -5
index 8fe6148..990da95 100644
@@ -161,19 +161,24 @@ int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_
 		case IF_TYPE_IDE:
 		case IF_TYPE_SATA:
 		case IF_TYPE_ATAPI:
-			sprintf ((char *)info->name, "hd%c%d\n", 'a' + dev_desc->dev, part_num);
+			sprintf ((char *)info->name, "hd%c%d",
+				'a' + dev_desc->dev, part_num);
 			break;
 		case IF_TYPE_SCSI:
-			sprintf ((char *)info->name, "sd%c%d\n", 'a' + dev_desc->dev, part_num);
+			sprintf ((char *)info->name, "sd%c%d",
+				'a' + dev_desc->dev, part_num);
 			break;
 		case IF_TYPE_USB:
-			sprintf ((char *)info->name, "usbd%c%d\n", 'a' + dev_desc->dev, part_num);
+			sprintf ((char *)info->name, "usbd%c%d",
+				'a' + dev_desc->dev, part_num);
 			break;
 		case IF_TYPE_DOC:
-			sprintf ((char *)info->name, "docd%c%d\n", 'a' + dev_desc->dev, part_num);
+			sprintf ((char *)info->name, "docd%c%d",
+				'a' + dev_desc->dev, part_num);
 			break;
 		default:
-			sprintf ((char *)info->name, "xx%c%d\n", 'a' + dev_desc->dev, part_num);
+			sprintf ((char *)info->name, "xx%c%d",
+				'a' + dev_desc->dev, part_num);
 			break;
 	}
 	/* the bootcatalog (including validation Entry) is limited to 2048Bytes
Signature · 1 line
1.6.0.6
#1 lore raw

PATCH 1/1 Partition support: remove newline from partition name

Hi everybody,

Quoted 9 lines · In message <[email protected]> you wrote:

Remove bogus newline character that got added to the .name field of the disk_partition_t structure.

---
 disk/part_dos.c |   15 ++++++++++-----
 disk/part_efi.c |    2 +-
 disk/part_iso.c |   15 ++++++++++-----
 3 files changed, 21 insertions(+), 11 deletions(-)

I tested this patch mainly with IDE devices - I would appreciate i users with other devices (ATAPI, SCSI, SATA, USB, DoC) could test this, too.

Thanks in advance.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If you can, help others. If you can't, at least don't hurt  others."
- the Dalai Lama
author Applied
#2 lore raw

PATCH 1/1 Partition support: remove newline from partition name

In reply to Wolfgang Denk
Quoted 9 lines · In message <[email protected]> I wrote:

Remove bogus newline character that got added to the .name field of the disk_partition_t structure.

---
 disk/part_dos.c |   15 ++++++++++-----
 disk/part_efi.c |    2 +-
 disk/part_iso.c |   15 ++++++++++-----
 3 files changed, 21 insertions(+), 11 deletions(-)

Applied.

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"We don't care.  We don't have to.  We're the Phone Company."