From: Vitaly Bordug <vbordug@ru.mvista.com>
To: Kumar Gala <kumar.gala@freescale.com>
Cc: linuxppc-embedded list <linuxppc-embedded@ozlabs.org>
Subject: Re: [PATCH] identify_ppc_sys_by_name_and_id function implementation final
Date: Tue, 16 Aug 2005 17:36:37 +0400 [thread overview]
Message-ID: <4301EBE5.8030003@ru.mvista.com> (raw)
In-Reply-To: <725685C1-2B6B-4B19-A1E9-D68AB21AFEAF@freescale.com>
Kumar Gala wrote:
> On Aug 12, 2005, at 11:30 AM, Vitaly Bordug wrote:
>
>> Kumar Gala wrote:
>>
>>> Can you do a sizeof instead?
>>>
>>> #define num_ele sizeof(ppc_sys_specs[])/sizeof(struct ppc_sys_spec)
>>>
>>> Something like matchted[num_ele] ??
>>>
>>>
>>
>> That's what the first I tried actually :)
>> gcc is not happy with it:
>>
>> arch/ppc/syslib/ppc_sys.c: In function `find_chip_by_name_and_id':
>> arch/ppc/syslib/ppc_sys.c:54: error: parse error before ']' token
>>
>> and if I remove [] from the ppc_sys_specs, it outputs:
>>
>> arch/ppc/syslib/ppc_sys.c: In function `find_chip_by_name_and_id':
>> arch/ppc/syslib/ppc_sys.c:54: error: invalid application of `sizeof' to
>> incomplete type `({anonymous})'
>>
>> So I cannot use sizeof this case, I think...
>
>
> Realized the same thing. I'm thinking that your original method is the
> best solution to just do this on the stack. In general the number or
> processors (array size) is going to be less than 100. So at most this
> array is going to end up being 100 bytes on the stack. I dont think
> that's a big deal at the point we are calling this
>
Thus, are there any modifications needed for the original approach?
Or maybe it's simpler to add say MAX_PPC_SPECS to ppc_sys.h since this
list will be limited anyway? We could have the simple array with static
size then, and additional ppc_sys_specs sanity check (whether it has
"default" element with both 0 id and "" name) could be easily
implemented as well.
--
Sincerely,
Vitaly
prev parent reply other threads:[~2005-08-16 13:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-10 17:15 [RFC][PATCH] identify_ppc_sys_by_name_and_id function implementation Vitaly Bordug
2005-08-10 17:46 ` [PATCH] identify_ppc_sys_by_name_and_id function implementation (braces fixed) Vitaly Bordug
2005-08-10 18:01 ` [PATCH] identify_ppc_sys_by_name_and_id function implementation final Vitaly Bordug
2005-08-10 19:16 ` Kumar Gala
2005-08-11 5:30 ` Marcelo Tosatti
2005-08-11 15:25 ` Vitaly Bordug
2005-08-11 22:45 ` Marcelo Tosatti
2005-08-12 15:37 ` Vitaly Bordug
2005-08-12 16:18 ` Kumar Gala
2005-08-12 16:30 ` Vitaly Bordug
2005-08-12 19:48 ` Kumar Gala
2005-08-16 13:36 ` Vitaly Bordug [this message]
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=4301EBE5.8030003@ru.mvista.com \
--to=vbordug@ru.mvista.com \
--cc=kumar.gala@freescale.com \
--cc=linuxppc-embedded@ozlabs.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.