From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Simon Glass <sjg@chromium.org>
Cc: Igor Opaniuk <igor.opaniuk@gmail.com>,
u-boot@lists.u-boot-project.org,
Jan Kehren <jan.kehren@emteria.com>,
Guillaume La Roque <glaroque@baylibre.com>,
Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Subject: Re: [PATCH v2 05/10] test/py: android: Add create_gpt_image() for image creation
Date: Thu, 22 Oct 2026 15:24:05 +0200 [thread overview]
Message-ID: <xhkdb7bj9q362.fsf@mkorpers-koolstof.csb> (raw)
In-Reply-To: <CAFLszTjD+8B0Mq6ktOrKx94m51n-=R3L0icxuL6qV2SUkvMorA@mail.gmail.com>
Hi Simon,
Thank you for the review.
On Thu, Oct 22, 2026 at 01:26, Simon Glass <sjg@chromium.org> wrote:
> Hi Mattijs,
>
> On 2026-10-20T09:25:49, Mattijs Korpershoek <mkorpershoek@kernel.org> wrote:
>> test/py: android: Add create_gpt_image() for image creation
>>
>> There is quite some code duplication between the image creation for
>> mmc7.img and mmc8.img. If we want to add more images, this will be even
>> more duplication.
>>
>> Add a common function, create_gpt_image() which removes all the code
>> duplication.
>>
>> Reviewed-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
>> Tested-by: Guillaume La Roque <glaroque@baylibre.com>
>> Tested-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
>> Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
>> Reviewed-by: Guillaume La Roque <glaroque@baylibre.com>
>>
>> test/py/tests/test_android/android_image.py | 78 +++++++----------------------
>> 1 file changed, 19 insertions(+), 59 deletions(-)
>
>> diff --git a/test/py/tests/test_android/android_image.py b/test/py/tests/test_android/android_image.py
>> @@ -7,13 +7,12 @@ import os
>> -def setup_android_image(ubman):
>> +Partition = collections.namedtuple('part', 'start,size,name')
>> +
>> +def create_gpt_image(ubman, mmc_dev, required_parts, images):
>> """Create a 20MB disk image with Android partitions"""
>> - Partition = collections.namedtuple('part', 'start,size,name')
>> parts = {}
>> disk_data = None
>
> This is now a general helper that callers have to fill in, but the
> format of 'required_parts' (a list of dicts with 'num', 'label' and
> 'size', where size is either a sector count or 'NM') and 'images'
> (tuples of partition number, file name and hex data) is only visible
> from reading the body. Please can you add an Args: section to the
> docstring describing each parameter, as set_part_data() has earlier in
> the series? Since the name now says GPT, the docstring could also say
> which mmc image it writes rather than 'Android partitions'.
Ok, will do for v3.
>
> Also, 'disk_data = None' is now redundant since the variable is only
> assigned once, further down. Moving Partition to module level seems
> unnecessary too, since only this function uses it.
Ok, dropped disk_data = None for v3.
Ok, put Partition back into the function for v3.
>
>> diff --git a/test/py/tests/test_android/android_image.py b/test/py/tests/test_android/android_image.py
>> @@ -69,55 +56,28 @@ def setup_android_image(ubman):
>> +def setup_android_image(ubman):
>> + mmc_dev = 7
>
> This drops the docstring from setup_android_image(), so pylint
> complains at this patch. The next patch adds it back, but it would be
> better to keep it here so that each patch is clean on its own.
Ok, will put the docstring back in in v3.
>
> Regards,
> Simon
next prev parent reply other threads:[~2026-10-22 13:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 9:25 [PATCH v2 00/10] Fix AVB pytest suite for sandbox Mattijs Korpershoek
2026-10-20 9:25 ` [PATCH v2 01/10] avb: Use map_to_sysmem() for flush_cache() address Mattijs Korpershoek
2026-10-22 8:25 ` Simon Glass
2026-10-20 9:25 ` [PATCH v2 02/10] test/py: android: Move android image creation to a dedicated file Mattijs Korpershoek
2026-10-22 8:25 ` Simon Glass
2026-10-20 9:25 ` [PATCH v2 03/10] test/py: android: Drop verbose printing and unused return Mattijs Korpershoek
2026-10-22 8:25 ` Simon Glass
2026-10-20 9:25 ` [PATCH v2 04/10] test/py: android: Use for loop to create the images / update disks Mattijs Korpershoek
2026-10-22 8:25 ` Simon Glass
2026-10-20 9:25 ` [PATCH v2 05/10] test/py: android: Add create_gpt_image() for image creation Mattijs Korpershoek
2026-10-20 15:07 ` Guillaume La Roque
2026-10-22 8:26 ` Simon Glass
2026-10-22 13:24 ` Mattijs Korpershoek [this message]
2026-10-20 9:25 ` [PATCH v2 06/10] test/py: android: Add setup_android_v{4,2}_image subfunctions Mattijs Korpershoek
2026-10-22 8:26 ` [PATCH v2 06/10] test/py: android: Add setup_android_v{4, 2}_image subfunctions Simon Glass
2026-10-20 9:25 ` [PATCH v2 07/10] test/py: avb: Use format specifiers instead of str() for mmc_dev Mattijs Korpershoek
2026-10-22 8:59 ` Simon Glass
2026-10-20 9:25 ` [PATCH v2 08/10] test/py: avb: Move mmc device number to a pytest fixture Mattijs Korpershoek
2026-10-22 8:26 ` Simon Glass
2026-10-20 9:25 ` [PATCH v2 09/10] test/py: avb: Add sandbox AVB testing with dedicated mmc12 device Mattijs Korpershoek
2026-10-22 8:26 ` Simon Glass
2026-10-22 12:53 ` Mattijs Korpershoek
2026-10-20 9:25 ` [PATCH v2 10/10] test/py: avb: Fix find() logic when matching response strings Mattijs Korpershoek
2026-10-20 15:07 ` Guillaume La Roque
2026-10-22 8:26 ` Simon Glass
2026-10-22 12:22 ` Mattijs Korpershoek
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=xhkdb7bj9q362.fsf@mkorpers-koolstof.csb \
--to=mkorpershoek@kernel.org \
--cc=glaroque@baylibre.com \
--cc=igor.opaniuk@gmail.com \
--cc=igor.opaniuk@oss.qualcomm.com \
--cc=jan.kehren@emteria.com \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.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.