lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5c5b2593-b07c-cd20-cd08-1d6542471260@loongson.cn>
Date:   Wed, 10 Mar 2021 10:26:24 +0800
From:   zhangqing <zhangqing@...ngson.cn>
To:     Marc Zyngier <maz@...nel.org>
Cc:     Huacai Chen <chenhuacai@...nel.org>,
        Jiaxun Yang <jiaxun.yang@...goat.com>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
        wangming01@...ngson.cn
Subject: Re: [PATCH v3 5/7] irqchip/loongson-liointc: irqchip add 2.0 version


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.
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ