lkml.org 
[lkml]   [2019]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v5 PATCH] RISC-V: Fix unsupported isa string info.
> +	for (e = mandatory_ext; *e != '\0'; ++e) {
> + if (isa[0] != e[0]) {
> +#if defined(CONFIG_FP)
> + if ((isa[0] == 'f') || (isa[0] == 'd'))
> + continue;
> +#endif
> + unsupported_isa[index] = e[0];
> + index++;
> + }

I'd just use if (IS_ENABLED()) here to get full compiler coverage.
Also no need for the inner braces.

> + if (isa[0] != '\0') {
> + /* Add remainging isa strings */
> + for (e = isa; *e != '\0'; ++e) {
> +#if !defined(CONFIG_VIRTUALIZATION)
> + if (e[0] != 'h')
> +#endif
> + seq_write(f, e, 1);
> + }
> + }

This one I don't get. Why do we want to check CONFIG_VIRTUALIZATION?

> seq_puts(f, "\n");
>
> /*
> * If we were given an unsupported ISA in the device tree then print
> * a bit of info describing what went wrong.
> */
> - if (isa[0] != '\0')
> - pr_info("unsupported ISA \"%s\" in device tree\n", orig_isa);
> + if (unsupported_isa[0])
> + pr_info("unsupported ISA extensions \"%s\" in device tree for cpu [%ld]\n",
> + unsupported_isa, cpuid);

And I'm not even sure why we care about unsupported extensions. Sooner
or late a few will op up and they should be harmless.

\
 
 \ /
  Last update: 2019-08-12 17:03    [W:0.110 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site