<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Richard,</div></div><div class="gmail_quote"><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> +const struct tst_arch tst_arch = {<br>
> +#if defined(__x86_64__)<br>
> + .name = "x86_64",<br>
<br>
Writing out these string constants multiple times is error<br>
prone. Perhaps arch_type_list can be indexed with enum tst_arch_type and<br>
then name can be ".name = arch_type_list[TST_X86]"?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Right, that will more flexible but you know, all arches we have are just</div><div class="gmail_default" style="font-size:small">those, and we write them only once in the LTP test library.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I slightly wanted to keep string constants to make it more simple/readable.</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> +static const char *const arch_type_list[] = {<br>
> + "i386",<br>
> + "i586",<br>
> + "i686",<br>
<br>
These are not valid arch names AFAICT. There is no mapping from these to<br>
x86 in the tst_arch table above.<br>
<br>
Perhaps we could replace them all with x86?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Yes, that is also the unsure part I was concerned about in patch v4. </div><div class="gmail_default" style="font-size:small">Because x86 is also an invalid arch (it is just a conventional name),</div><div class="gmail_default" style="font-size:small">if we use it in the arch_type_list we have to recognize it as a valid arch</div><div class="gmail_default" style="font-size:small">name in test case as well. I'm not sure that will be accepted by other</div></div><div class="gmail_default" style="font-size:small">people.</div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>