[PATCH] soc: mediatek: mtk-svs: change the function IS_ERR_OR_NULL() to IS_ERR()

Ziqin Liu posted 1 patch 1 year, 5 months ago
drivers/soc/mediatek/mtk-svs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] soc: mediatek: mtk-svs: change the function IS_ERR_OR_NULL() to IS_ERR()
Posted by Ziqin Liu 1 year, 5 months ago
nvmem_cell_get() will return an ERR_PTR() on error or a valid pointer to a
struct nvmem_cell but won't return NULL, the check function should be
IS_ERR() instead of IS_ERR_OR_NULL()

Signed-off-by: Ziqin Liu <ziqin_l@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
---
 drivers/soc/mediatek/mtk-svs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
index a7eb019b5157..8127fb6d587b 100644
--- a/drivers/soc/mediatek/mtk-svs.c
+++ b/drivers/soc/mediatek/mtk-svs.c
@@ -1726,7 +1726,7 @@ static int svs_get_efuse_data(struct svs_platform *svsp,
 	struct nvmem_cell *cell;
 
 	cell = nvmem_cell_get(svsp->dev, nvmem_cell_name);
-	if (IS_ERR_OR_NULL(cell)) {
+	if (IS_ERR(cell)) {
 		dev_err(svsp->dev, "no \"%s\"? %ld\n",
 			nvmem_cell_name, PTR_ERR(cell));
 		return PTR_ERR(cell);
-- 
2.25.1
Re: [PATCH] soc: mediatek: mtk-svs: change the function IS_ERR_OR_NULL() to IS_ERR()
Posted by 刘紫琴 1 year, 5 months ago
ping?

"Ziqin Liu" <ziqin_l@hust.edu.cn>写道:
> nvmem_cell_get() will return an ERR_PTR() on error or a valid pointer to a
> struct nvmem_cell but won't return NULL, the check function should be
> IS_ERR() instead of IS_ERR_OR_NULL()
> 
> Signed-off-by: Ziqin Liu <ziqin_l@hust.edu.cn>
> Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
> ---
>  drivers/soc/mediatek/mtk-svs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> index a7eb019b5157..8127fb6d587b 100644
> --- a/drivers/soc/mediatek/mtk-svs.c
> +++ b/drivers/soc/mediatek/mtk-svs.c
> @@ -1726,7 +1726,7 @@ static int svs_get_efuse_data(struct svs_platform *svsp,
>  	struct nvmem_cell *cell;
>  
>  	cell = nvmem_cell_get(svsp->dev, nvmem_cell_name);
> -	if (IS_ERR_OR_NULL(cell)) {
> +	if (IS_ERR(cell)) {
>  		dev_err(svsp->dev, "no \"%s\"? %ld\n",
>  			nvmem_cell_name, PTR_ERR(cell));
>  		return PTR_ERR(cell);
> -- 
> 2.25.1
Re: [PATCH] soc: mediatek: mtk-svs: change the function IS_ERR_OR_NULL() to IS_ERR()
Posted by Matthias Brugger 1 year, 5 months ago

On 13/04/2023 09:08, 刘紫琴 wrote:
> ping?
> 

Please be patient, maintainers are sometimes busy and can't cope with all the 
patches at a time.

Please don't top post :)

This was already fixed and applied to linux-next via
https://lore.kernel.org/all/20230202124104.16504-2-roger.lu@mediatek.com/

Best regards,
Matthias

> "Ziqin Liu" <ziqin_l@hust.edu.cn>写道:
>> nvmem_cell_get() will return an ERR_PTR() on error or a valid pointer to a
>> struct nvmem_cell but won't return NULL, the check function should be
>> IS_ERR() instead of IS_ERR_OR_NULL()
>>
>> Signed-off-by: Ziqin Liu <ziqin_l@hust.edu.cn>
>> Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
>> ---
>>   drivers/soc/mediatek/mtk-svs.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
>> index a7eb019b5157..8127fb6d587b 100644
>> --- a/drivers/soc/mediatek/mtk-svs.c
>> +++ b/drivers/soc/mediatek/mtk-svs.c
>> @@ -1726,7 +1726,7 @@ static int svs_get_efuse_data(struct svs_platform *svsp,
>>   	struct nvmem_cell *cell;
>>   
>>   	cell = nvmem_cell_get(svsp->dev, nvmem_cell_name);
>> -	if (IS_ERR_OR_NULL(cell)) {
>> +	if (IS_ERR(cell)) {
>>   		dev_err(svsp->dev, "no \"%s\"? %ld\n",
>>   			nvmem_cell_name, PTR_ERR(cell));
>>   		return PTR_ERR(cell);
>> -- 
>> 2.25.1