[PATCH 2/3] mtd: spi-nor: remove the jedec_id/ext_id

Rafał Miłecki zajec5 at gmail.com
Wed Nov 5 13:35:09 PST 2014


On 5 November 2014 12:16, Brian Norris <computersforpeace at gmail.com> wrote:
> On Tue, Aug 12, 2014 at 08:54:55AM +0800, Huang Shijie wrote:
>> The "id" array contains all the information about the JEDEC and the
>> manufacturer ID info, this patch remove the jedec_id/ext_id from the
>> flash_info.
>>
>> Signed-off-by: Huang Shijie <shijie.huang at intel.com>
>
> This patch does not apply any more. Can you rebase?

Hm, I've just noticed that my patch:
"prefer more specific entries from chips database"
http://patchwork.ozlabs.org/patch/401907/
conflicts with this one.

I think the final solution (after somehow applying both patches)
should be something like:
for (len = 6; i >= 4; len--) {
    for (tmp = 0; tmp < ARRAY_SIZE(spi_nor_ids) - 1; tmp++) {
        if (tmp->id_len == len && !strncmp(info->id, id, info->id_len)
            return &spi_nor_ids[tmp];
    }
}

Does it make sense to you?

Huang: I think it'll be the most optimal to me rebase my patch on top
on your ones.

Btw. I have two comments regarding 1/3 (can't find it to reply properly):

1) Do we need the if (info->id_len) check?
2) Shouldn't we use memcmp in the if (!strncmp(info->id, id, info->id_len))

-- 
Rafał



More information about the linux-mtd mailing list