* [PATCH v1] net: ipa: make use of dev_err_cast_probe()
@ 2024-08-28 8:41 ` Yuesong Li
2024-08-28 16:07 ` Simon Horman
2024-08-29 1:24 ` Alex Elder
0 siblings, 2 replies; 7+ messages in thread
From: Yuesong Li @ 2024-08-28 8:41 UTC (permalink / raw)
To: elder, davem, edumazet, kuba, pabeni
Cc: netdev, linux-kernel, opensource.kernel, Yuesong Li
Using dev_err_cast_probe() to simplify the code.
Signed-off-by: Yuesong Li <liyuesong@vivo.com>
---
drivers/net/ipa/ipa_power.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
index 65fd14da0f86..248bcc0b661e 100644
--- a/drivers/net/ipa/ipa_power.c
+++ b/drivers/net/ipa/ipa_power.c
@@ -243,9 +243,8 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data)
clk = clk_get(dev, "core");
if (IS_ERR(clk)) {
- dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n");
-
- return ERR_CAST(clk);
+ return dev_err_cast_probe(dev, clk,
+ "error getting core clock\n");
}
ret = clk_set_rate(clk, data->core_clock_rate);
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next] net: ipa: make use of dev_err_cast_probe()
@ 2024-08-28 12:15 Hongbo Li
2024-08-28 8:41 ` [PATCH v1] " Yuesong Li
2024-08-29 19:00 ` [PATCH net-next] " patchwork-bot+netdevbpf
0 siblings, 2 replies; 7+ messages in thread
From: Hongbo Li @ 2024-08-28 12:15 UTC (permalink / raw)
To: elder, davem, edumazet, kuba, pabeni; +Cc: netdev, lihongbo22
Using dev_err_cast_probe() to simplify the code.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
---
drivers/net/ipa/ipa_power.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
index 65fd14da0f86..c572da9e9bc4 100644
--- a/drivers/net/ipa/ipa_power.c
+++ b/drivers/net/ipa/ipa_power.c
@@ -242,11 +242,8 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data)
int ret;
clk = clk_get(dev, "core");
- if (IS_ERR(clk)) {
- dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n");
-
- return ERR_CAST(clk);
- }
+ if (IS_ERR(clk))
+ return dev_err_cast_probe(dev, clk, "error getting core clock\n");
ret = clk_set_rate(clk, data->core_clock_rate);
if (ret) {
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v1] net: ipa: make use of dev_err_cast_probe()
2024-08-28 8:41 ` [PATCH v1] " Yuesong Li
@ 2024-08-28 16:07 ` Simon Horman
2024-08-29 1:27 ` Alex Elder
2024-08-29 1:24 ` Alex Elder
1 sibling, 1 reply; 7+ messages in thread
From: Simon Horman @ 2024-08-28 16:07 UTC (permalink / raw)
To: Yuesong Li, Hongbo Li
Cc: elder, davem, edumazet, kuba, pabeni, netdev, linux-kernel,
opensource.kernel
On Wed, Aug 28, 2024 at 04:41:15PM +0800, Yuesong Li wrote:
> Using dev_err_cast_probe() to simplify the code.
>
> Signed-off-by: Yuesong Li <liyuesong@vivo.com>
> ---
> drivers/net/ipa/ipa_power.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
> index 65fd14da0f86..248bcc0b661e 100644
> --- a/drivers/net/ipa/ipa_power.c
> +++ b/drivers/net/ipa/ipa_power.c
> @@ -243,9 +243,8 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data)
>
> clk = clk_get(dev, "core");
> if (IS_ERR(clk)) {
> - dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n");
> -
> - return ERR_CAST(clk);
> + return dev_err_cast_probe(dev, clk,
> + "error getting core clock\n");
> }
>
> ret = clk_set_rate(clk, data->core_clock_rate);
Hi,
There are lot of clean-up patches floating around at this time.
And I'm unsure if you are both on the same team or not, but in
any case it would be nice if there was some co-ordination.
Because here we have two different versions of the same patch.
Which, from a maintainer and reviewer pov is awkward.
In principle the change(s) look(s) fine to me. But there are some minor
problems.
1. For the patch above, it should be explicitly targeted at net-next.
(Or net if it was a bug fix, which it is not.)
Not a huge problem, as this is the default. But please keep this in mind
for future posts.
Subject: [PATCH vX net-next]: ...
2. For the patch above, the {} should be dropped, as in the patch below.
3. For both patches. The dev_err_cast_probe should be line wrapped,
and the indentation should align with the opening (.
return dev_err_cast_probe(dev, clk,
"error getting core clock\n");
I'd like to ask you to please negotiate amongst yourselves and
post _just one_ v2 which addresses the minor problems highlighted above.
Thanks!
On Wed, Aug 28, 2024 at 08:15:51PM +0800, Hongbo Li wrote:
> Using dev_err_cast_probe() to simplify the code.
>
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
> ---
> drivers/net/ipa/ipa_power.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
> index 65fd14da0f86..c572da9e9bc4 100644
> --- a/drivers/net/ipa/ipa_power.c
> +++ b/drivers/net/ipa/ipa_power.c
> @@ -242,11 +242,8 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data)
> int ret;
>
> clk = clk_get(dev, "core");
> - if (IS_ERR(clk)) {
> - dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n");
> -
> - return ERR_CAST(clk);
> - }
> + if (IS_ERR(clk))
> + return dev_err_cast_probe(dev, clk, "error getting core clock\n");
>
> ret = clk_set_rate(clk, data->core_clock_rate);
> if (ret) {
--
pw-bot: cr
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] net: ipa: make use of dev_err_cast_probe()
2024-08-28 8:41 ` [PATCH v1] " Yuesong Li
2024-08-28 16:07 ` Simon Horman
@ 2024-08-29 1:24 ` Alex Elder
1 sibling, 0 replies; 7+ messages in thread
From: Alex Elder @ 2024-08-29 1:24 UTC (permalink / raw)
To: Yuesong Li, elder, davem, edumazet, kuba, pabeni
Cc: netdev, linux-kernel, opensource.kernel
On 8/28/24 3:41 AM, Yuesong Li wrote:
> Using dev_err_cast_probe() to simplify the code.
>
> Signed-off-by: Yuesong Li <liyuesong@vivo.com>
> ---
> drivers/net/ipa/ipa_power.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
> index 65fd14da0f86..248bcc0b661e 100644
> --- a/drivers/net/ipa/ipa_power.c
> +++ b/drivers/net/ipa/ipa_power.c
> @@ -243,9 +243,8 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data)
>
> clk = clk_get(dev, "core");
> if (IS_ERR(clk)) {
> - dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n");
> -
> - return ERR_CAST(clk);
> + return dev_err_cast_probe(dev, clk,
> + "error getting core clock\n");
This looks to me like a simple replacement with equivalent code.
Reviewed-by: Alex Elder <elder@kernel.org>
> }
>
> ret = clk_set_rate(clk, data->core_clock_rate);
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] net: ipa: make use of dev_err_cast_probe()
2024-08-28 16:07 ` Simon Horman
@ 2024-08-29 1:27 ` Alex Elder
2024-08-29 1:47 ` Hongbo Li
0 siblings, 1 reply; 7+ messages in thread
From: Alex Elder @ 2024-08-29 1:27 UTC (permalink / raw)
To: Simon Horman, Yuesong Li, Hongbo Li
Cc: elder, davem, edumazet, kuba, pabeni, netdev, linux-kernel,
opensource.kernel
On 8/28/24 11:07 AM, Simon Horman wrote:
> On Wed, Aug 28, 2024 at 04:41:15PM +0800, Yuesong Li wrote:
>> Using dev_err_cast_probe() to simplify the code.
>>
>> Signed-off-by: Yuesong Li <liyuesong@vivo.com>
>> ---
>> drivers/net/ipa/ipa_power.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
>> index 65fd14da0f86..248bcc0b661e 100644
>> --- a/drivers/net/ipa/ipa_power.c
>> +++ b/drivers/net/ipa/ipa_power.c
>> @@ -243,9 +243,8 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data)
>>
>> clk = clk_get(dev, "core");
>> if (IS_ERR(clk)) {
>> - dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n");
>> -
>> - return ERR_CAST(clk);
>> + return dev_err_cast_probe(dev, clk,
>> + "error getting core clock\n");
>> }
>>
>> ret = clk_set_rate(clk, data->core_clock_rate);
>
> Hi,
>
> There are lot of clean-up patches floating around at this time.
> And I'm unsure if you are both on the same team or not, but in
> any case it would be nice if there was some co-ordination.
> Because here we have two different versions of the same patch.
> Which, from a maintainer and reviewer pov is awkward.
I just noticed this (looking at the patch from Hongbo Li).
> In principle the change(s) look(s) fine to me. But there are some minor
> problems.
>
> 1. For the patch above, it should be explicitly targeted at net-next.
> (Or net if it was a bug fix, which it is not.)
>
> Not a huge problem, as this is the default. But please keep this in mind
> for future posts.
>
> Subject: [PATCH vX net-next]: ...
>
> 2. For the patch above, the {} should be dropped, as in the patch below.
Agreed.
> 3. For both patches. The dev_err_cast_probe should be line wrapped,
> and the indentation should align with the opening (.
>
> return dev_err_cast_probe(dev, clk,
> "error getting core clock\n");
>
> I'd like to ask you to please negotiate amongst yourselves and
> post _just one_ v2 which addresses the minor problems highlighted above.
Thank you Simon, you are correct and I appreciate your proposed
solution. I'll await a followup patch (perhaps jointly signed
off?)
-Alex
> Thanks!
>
> On Wed, Aug 28, 2024 at 08:15:51PM +0800, Hongbo Li wrote:
>> Using dev_err_cast_probe() to simplify the code.
>>
>> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
>> ---
>> drivers/net/ipa/ipa_power.c | 7 ++-----
>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
>> index 65fd14da0f86..c572da9e9bc4 100644
>> --- a/drivers/net/ipa/ipa_power.c
>> +++ b/drivers/net/ipa/ipa_power.c
>> @@ -242,11 +242,8 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data)
>> int ret;
>>
>> clk = clk_get(dev, "core");
>> - if (IS_ERR(clk)) {
>> - dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n");
>> -
>> - return ERR_CAST(clk);
>> - }
>> + if (IS_ERR(clk))
>> + return dev_err_cast_probe(dev, clk, "error getting core clock\n");
>>
>> ret = clk_set_rate(clk, data->core_clock_rate);
>> if (ret) {
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] net: ipa: make use of dev_err_cast_probe()
2024-08-29 1:27 ` Alex Elder
@ 2024-08-29 1:47 ` Hongbo Li
0 siblings, 0 replies; 7+ messages in thread
From: Hongbo Li @ 2024-08-29 1:47 UTC (permalink / raw)
To: Alex Elder, Simon Horman, Yuesong Li
Cc: elder, davem, edumazet, kuba, pabeni, netdev, linux-kernel,
opensource.kernel
On 2024/8/29 9:27, Alex Elder wrote:
> On 8/28/24 11:07 AM, Simon Horman wrote:
>> On Wed, Aug 28, 2024 at 04:41:15PM +0800, Yuesong Li wrote:
>>> Using dev_err_cast_probe() to simplify the code.
>>>
>>> Signed-off-by: Yuesong Li <liyuesong@vivo.com>
>>> ---
>>> drivers/net/ipa/ipa_power.c | 5 ++---
>>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
>>> index 65fd14da0f86..248bcc0b661e 100644
>>> --- a/drivers/net/ipa/ipa_power.c
>>> +++ b/drivers/net/ipa/ipa_power.c
>>> @@ -243,9 +243,8 @@ ipa_power_init(struct device *dev, const struct
>>> ipa_power_data *data)
>>> clk = clk_get(dev, "core");
>>> if (IS_ERR(clk)) {
>>> - dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n");
>>> -
>>> - return ERR_CAST(clk);
>>> + return dev_err_cast_probe(dev, clk,
>>> + "error getting core clock\n");
>>> }
>>> ret = clk_set_rate(clk, data->core_clock_rate);
>>
>> Hi,
>>
>> There are lot of clean-up patches floating around at this time.
>> And I'm unsure if you are both on the same team or not, but in
>> any case it would be nice if there was some co-ordination.
>> Because here we have two different versions of the same patch.
>> Which, from a maintainer and reviewer pov is awkward.
I apologize for causing confusion, and I will strive to submit patches
that are truly valuable in the future.
Thanks,
Hongbo
>
> I just noticed this (looking at the patch from Hongbo Li).
>
>> In principle the change(s) look(s) fine to me. But there are some minor
>> problems.
>>
>> 1. For the patch above, it should be explicitly targeted at net-next.
>> (Or net if it was a bug fix, which it is not.)
>>
>> Not a huge problem, as this is the default. But please keep this
>> in mind
>> for future posts.
>>
>> Subject: [PATCH vX net-next]: ...
>>
>> 2. For the patch above, the {} should be dropped, as in the patch below.
>
> Agreed.
>
>> 3. For both patches. The dev_err_cast_probe should be line wrapped,
>> and the indentation should align with the opening (.
>>
>> return dev_err_cast_probe(dev, clk,
>> "error getting core clock\n");
>>
>> I'd like to ask you to please negotiate amongst yourselves and
>> post _just one_ v2 which addresses the minor problems highlighted above.
>
> Thank you Simon, you are correct and I appreciate your proposed
> solution. I'll await a followup patch (perhaps jointly signed
> off?)
>
> -Alex
>
>> Thanks!
>>
>> On Wed, Aug 28, 2024 at 08:15:51PM +0800, Hongbo Li wrote:
>>> Using dev_err_cast_probe() to simplify the code.
>>>
>>> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
>>> ---
>>> drivers/net/ipa/ipa_power.c | 7 ++-----
>>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c
>>> index 65fd14da0f86..c572da9e9bc4 100644
>>> --- a/drivers/net/ipa/ipa_power.c
>>> +++ b/drivers/net/ipa/ipa_power.c
>>> @@ -242,11 +242,8 @@ ipa_power_init(struct device *dev, const struct
>>> ipa_power_data *data)
>>> int ret;
>>> clk = clk_get(dev, "core");
>>> - if (IS_ERR(clk)) {
>>> - dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n");
>>> -
>>> - return ERR_CAST(clk);
>>> - }
>>> + if (IS_ERR(clk))
>>> + return dev_err_cast_probe(dev, clk, "error getting core
>>> clock\n");
>>> ret = clk_set_rate(clk, data->core_clock_rate);
>>> if (ret) {
>>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next] net: ipa: make use of dev_err_cast_probe()
2024-08-28 12:15 [PATCH net-next] net: ipa: make use of dev_err_cast_probe() Hongbo Li
2024-08-28 8:41 ` [PATCH v1] " Yuesong Li
@ 2024-08-29 19:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-08-29 19:00 UTC (permalink / raw)
To: Hongbo Li; +Cc: elder, davem, edumazet, kuba, pabeni, netdev
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 28 Aug 2024 20:15:51 +0800 you wrote:
> Using dev_err_cast_probe() to simplify the code.
>
> Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
> ---
> drivers/net/ipa/ipa_power.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
Here is the summary with links:
- [net-next] net: ipa: make use of dev_err_cast_probe()
https://git.kernel.org/netdev/net-next/c/a41de3b12ec1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-08-29 19:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 12:15 [PATCH net-next] net: ipa: make use of dev_err_cast_probe() Hongbo Li
2024-08-28 8:41 ` [PATCH v1] " Yuesong Li
2024-08-28 16:07 ` Simon Horman
2024-08-29 1:27 ` Alex Elder
2024-08-29 1:47 ` Hongbo Li
2024-08-29 1:24 ` Alex Elder
2024-08-29 19:00 ` [PATCH net-next] " patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).