From: Andrei Warkentin <awarkentin@vmware.com>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: linux-kernel@vger.kernel.org,
adrian hunter <adrian.hunter@intel.com>,
james p freyensee <james_p_freyensee@linux.intel.com>,
cjb@laptop.org, linux-mmc@vger.kernel.org
Subject: Re: [PATCH v2] mmc : general purpose partition support.
Date: Wed, 28 Sep 2011 09:08:07 -0700 (PDT) [thread overview]
Message-ID: <1419276380.765271.1317226086965.JavaMail.root@zimbra-prod-mbox-2.vmware.com> (raw)
In-Reply-To: <1316840820-2014-1-git-send-email-linkinjeon@gmail.com>
Hi Namjae,
In general I think your approach is fine and solves the problem. See further inline
comments.
----- Original Message -----
> From: "Namjae Jeon" <linkinjeon@gmail.com>
> To: cjb@laptop.org, linux-mmc@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org, awarkentin@vmware.com, "adrian hunter" <adrian.hunter@intel.com>, "james p
> freyensee" <james_p_freyensee@linux.intel.com>, "Namjae Jeon" <linkinjeon@gmail.com>
> Sent: Saturday, September 24, 2011 1:07:00 AM
> Subject: [PATCH v2] mmc : general purpose partition support.
>
> It allows gerneral purpose partitions in MMC Device.
> And I try to simpliy make mmc_blk_alloc_parts using mmc_part
> structure suggested by Andrei Warkentin.
> After patching, we can see general purpose partitions like this.
> > cat /proc/partitions
> 179 0 847872 mmcblk0
> 179 192 4096 mmcblk0gp4
> 179 160 4096 mmcblk0gp3
> 179 128 4096 mmcblk0gp2
> 179 96 1052672 mmcblk0gp1
> 179 64 1024 mmcblk0boot1
> 179 32 1024 mmcblk0boot0
>
> Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
> + if (ext_csd[EXT_CSD_BOOT_MULT]) {
> + for (i = 0, boot_part_config = 0x1;
> + i < MMC_NUM_BOOT_PARTITION;
> + i++, boot_part_config++) {
> + card->part[i].size = ...
> + card->part[i].cookie = ...
> + sprintf(card->part[i].name, "boot%d", i);
> + card->part[i].force_ro = ...
> + }
> + }
> }
>
>
> + if (ext_csd[EXT_CSD_PARTITION_SUPPORT] & 0x1) {
> + ....
> + int i, gp_num, gp_part_config, gp_size_mult;
> + for (i = 2, gp_num = 1, gp_part_config = 0x4,
> + card->part[i].size = ...
> + card->part[i].cookie = ...
> + sprintf(card->part[i].name,
> + "gp%d", gp_num);
> + card->part[i].force_ro = ..
> + }
> + }
>
I feel that you should factor out a function that operates on the static part[] array and
adds a new entry base name, index (i.e. the %d for gp%d), cookie, size, force.
Otherwise you end up with these hidden mines like fixed indeces for
particular parts (i = 2, etc...) which becomes indecipherable for others.
Plus you're mostly doing the same thing.
Thanks,
A
next prev parent reply other threads:[~2011-09-28 16:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-24 5:07 Namjae Jeon
[not found] ` <4E80BE05.40401@linux.intel.com>
2011-09-28 1:13 ` NamJae Jeon
2011-09-28 11:21 ` Linus Walleij
2011-09-28 13:50 ` NamJae Jeon
2011-09-29 6:47 ` Linus Walleij
2011-09-29 8:35 ` NamJae Jeon
2011-09-28 16:08 ` Andrei Warkentin [this message]
2011-09-29 1:03 ` NamJae Jeon
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=1419276380.765271.1317226086965.JavaMail.root@zimbra-prod-mbox-2.vmware.com \
--to=awarkentin@vmware.com \
--cc=adrian.hunter@intel.com \
--cc=cjb@laptop.org \
--cc=james_p_freyensee@linux.intel.com \
--cc=linkinjeon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome