[U-Boot] [PATCH V2] disk: make get_partition_info() always available to disk.c
Tom Rini
trini at ti.com
Sat Sep 22 00:51:07 CEST 2012
On Fri, Sep 21, 2012 at 04:46:54PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren at nvidia.com>
>
> Now that get_device_and_partition() always calls get_partition_info()
> when disk.c is compiled, we must always compile the function, rather
> than ifdef it away.
>
> The implementation must be conditional based on CONFIG_CMD_* etc., since
> that's what e.g. part_dos.c uses to ifdef out get_partition_info_dos();
> CONFIG_DOS_PARTITION can be enabled even without those commands being
> enabled.
>
> Technically, this change is required before Rob's "disk/part: introduce
> get_device_and_partition" patch. However, at least when the compiler
> optimizer is turned on, it isn't required before then in practice,
> since get_device_and_partition() calls get_dev(), which is stubbed out
> in disk.c under exactly the same conditions that get_partition_info()
> is not compiled, and hence the compiler never generates code for the
> call to the missing function. However, in my later patch "disk:
> get_device_and_partition() "auto" partition and cleanup", the optimizer
> doesn't succeed at this, and may attempt to reference the undefined
> function.
>
> Signed-off-by: Stephen Warren <swarren at nvidia.com>
> ---
> v2: Add CONFIG_CMD_* etc. ifdefs around the implementation.
>
> Rob, I wonder if you shouldn't squash this into your series. Then, I'll
> need to rebase mine on your again since this causes a few nasty conflicts
> with my series.
I _really_ want to see incremental changes. It's one of the good
practices of the kernel folks and I'd like to see us do it as well as
much as we can.
--
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/20120921/1838f7da/attachment.pgp>
More information about the U-Boot
mailing list