lkml.org 
[lkml]   [2021]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 5/7] irqchip/loongson-liointc: irqchip add 2.0 version
From
Date

On 03/09/2021 05:10 PM, Marc Zyngier wrote:
>
>> +
>> +static void __iomem *liointc_get_reg_byname(struct device_node *node,
>> + const char *name)
>> +{
>> + int index = of_property_match_string(node, "reg-names", name);
>> +
>> + return of_iomap(node, index);
> So if of_property_match_string() returns an error, you feed that error
> to of_iomap()? Somehow, I don't think that's a good idea.

Hi, Marc

Thank you for your suggestion, error handling is missing here,

+ if (index <0)
+ return NULL;

return of_iomap(node, index);

It has been fixed in the fourth version, and I will send V4 soon.

> + if (of_device_is_compatible(node, "loongson,liointc-2.0")) {
> + base = liointc_get_reg_byname(node, "main");
> + if (!base) {
> + err = -ENODEV;
> + goto out_free_priv;
> + }
> + for (i = 0; i < LIOINTC_NUM_CORES; i++) {
> + priv->core_isr[i] =
> + liointc_get_reg_byname(node, core_reg_names[i]);
> Please write assignments on a single line.

In addition, write assignments on a single line

for (i = 0; i <LIOINTC_NUM_CORES; i++)
priv->core_isr[i] =
liointc_get_reg_byname(node, core_reg_names[i]);

It is 92 characters, more than 80 characters...


Thanks

-Qing

>
> Thanks,
>
> M.
>

\
 
 \ /
  Last update: 2021-03-10 03:28    [W:0.117 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site