* [U-Boot] [PATCH] disk: initialize name/part fields when returning a whole disk
@ 2012-10-10 17:57 Stephen Warren
2012-10-10 18:43 ` Benoît Thébaudeau
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stephen Warren @ 2012-10-10 17:57 UTC (permalink / raw)
To: u-boot
From: Stephen Warren <swarren@nvidia.com>
When get_device_and_partition() finds a disk without a partition table,
under some conditions, it "returns" a disk_partition_t that describes
the entire raw disk. Make sure to initialize all fields in the partition
descriptor in that case.
The value chosen for name is just some arbitrary descriptive string.
The value chosen for info matches the check at the end of
get_device_and_partition(). However, it's probably not that important;
it's not obvious that the value is really used.
Reported-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
Tom, this is technically a bug, so putting in the release might make
sense, although I doubt it has much practical impact, so deferring it
into u-boot/next would probably be just as good.
disk/part.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/disk/part.c b/disk/part.c
index a0c77dd..8ba3cde 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -561,6 +561,8 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
info->size = (*dev_desc)->lba;
info->blksz = (*dev_desc)->blksz;
info->bootable = 0;
+ strcpy((char *)info->type, BOOT_PART_TYPE);
+ strcpy((char *)info->name, "Whole Disk");
#ifdef CONFIG_PARTITION_UUIDS
info->uuid[0] = 0;
#endif
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] disk: initialize name/part fields when returning a whole disk
2012-10-10 17:57 [U-Boot] [PATCH] disk: initialize name/part fields when returning a whole disk Stephen Warren
@ 2012-10-10 18:43 ` Benoît Thébaudeau
2012-10-20 17:40 ` Tom Rini
2012-10-20 17:40 ` [U-Boot] " Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Benoît Thébaudeau @ 2012-10-10 18:43 UTC (permalink / raw)
To: u-boot
On Wednesday, October 10, 2012 7:57:51 PM, Stephen Warren wrote:
> When get_device_and_partition() finds a disk without a partition
> table,
> under some conditions, it "returns" a disk_partition_t that describes
> the entire raw disk. Make sure to initialize all fields in the
> partition
> descriptor in that case.
>
> The value chosen for name is just some arbitrary descriptive string.
>
> The value chosen for info matches the check at the end of
> get_device_and_partition(). However, it's probably not that
> important;
> it's not obvious that the value is really used.
>
> Reported-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> Tom, this is technically a bug, so putting in the release might make
> sense, although I doubt it has much practical impact, so deferring it
> into u-boot/next would probably be just as good.
>
> disk/part.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/disk/part.c b/disk/part.c
> index a0c77dd..8ba3cde 100644
> --- a/disk/part.c
> +++ b/disk/part.c
> @@ -561,6 +561,8 @@ int get_device_and_partition(const char *ifname,
> const char *dev_part_str,
> info->size = (*dev_desc)->lba;
> info->blksz = (*dev_desc)->blksz;
> info->bootable = 0;
> + strcpy((char *)info->type, BOOT_PART_TYPE);
> + strcpy((char *)info->name, "Whole Disk");
> #ifdef CONFIG_PARTITION_UUIDS
> info->uuid[0] = 0;
> #endif
Reviewed-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
Best regards,
Beno?t
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] disk: initialize name/part fields when returning a whole disk
2012-10-10 17:57 [U-Boot] [PATCH] disk: initialize name/part fields when returning a whole disk Stephen Warren
2012-10-10 18:43 ` Benoît Thébaudeau
@ 2012-10-20 17:40 ` Tom Rini
2012-10-20 17:40 ` [U-Boot] " Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2012-10-20 17:40 UTC (permalink / raw)
To: u-boot
On Wed, Oct 10, 2012 at 11:57:51AM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> When get_device_and_partition() finds a disk without a partition table,
> under some conditions, it "returns" a disk_partition_t that describes
> the entire raw disk. Make sure to initialize all fields in the partition
> descriptor in that case.
>
> The value chosen for name is just some arbitrary descriptive string.
>
> The value chosen for info matches the check at the end of
> get_device_and_partition(). However, it's probably not that important;
> it's not obvious that the value is really used.
>
> Reported-by: Beno??t Th??baudeau <benoit.thebaudeau@advansee.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121020/f5ebe269/attachment.pgp>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] disk: initialize name/part fields when returning a whole disk
2012-10-10 17:57 [U-Boot] [PATCH] disk: initialize name/part fields when returning a whole disk Stephen Warren
2012-10-10 18:43 ` Benoît Thébaudeau
2012-10-20 17:40 ` Tom Rini
@ 2012-10-20 17:40 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2012-10-20 17:40 UTC (permalink / raw)
To: u-boot
On Wed, Oct 10, 2012 at 07:57:51AM -0000, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> When get_device_and_partition() finds a disk without a partition table,
> under some conditions, it "returns" a disk_partition_t that describes
> the entire raw disk. Make sure to initialize all fields in the partition
> descriptor in that case.
>
> The value chosen for name is just some arbitrary descriptive string.
>
> The value chosen for info matches the check at the end of
> get_device_and_partition(). However, it's probably not that important;
> it's not obvious that the value is really used.
>
> Reported-by: Beno??t Th??baudeau <benoit.thebaudeau@advansee.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> Reviewed-by: Beno??t Th??baudeau <benoit.thebaudeau@advansee.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121020/5a05bfa0/attachment.pgp>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-10-20 17:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-10 17:57 [U-Boot] [PATCH] disk: initialize name/part fields when returning a whole disk Stephen Warren
2012-10-10 18:43 ` Benoît Thébaudeau
2012-10-20 17:40 ` Tom Rini
2012-10-20 17:40 ` [U-Boot] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox