public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Giuseppe CAVALLARO <peppe.cavallaro@st•com>
To: Wei Yongjun <weiyj.lk@gmail•com>
Cc: yongjun_wei@trendmicro•com.cn, netdev@vger•kernel.org
Subject: Re: [PATCH] stmmac: fix return value check in stmmac_open_ext_timer()
Date: Fri, 21 Sep 2012 10:21:30 +0200	[thread overview]
Message-ID: <505C238A.5050301@st.com> (raw)
In-Reply-To: <CAPgLHd87SqVa40-SGrgEfRAPWj1dr9aGPDD7b3aALCqka2ssuA@mail.gmail.com>

On 9/21/2012 9:06 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro•com.cn>
>
> In case of error, the function clk_get() returns ERR_PTR()
> and never returns NULL pointer. The NULL test in the error
> handling should be replaced with IS_ERR().
>
> dpatch engine is used to auto generated this patch.
> (https://github.com/weiyj/dpatch)

FYI I have recently sent some patches (still under reviewing) to 
completely remove this dead code from the driver.

http://marc.info/?l=linux-netdev&m=134734656020277&w=2

Peppe

> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro•com.cn>
> ---
>   drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c
> index 2a0e1ab..197fb8c 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c
> @@ -109,7 +109,7 @@ int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm)
>   {
>   	timer_clock = clk_get(NULL, TMU_CHANNEL);
>
> -	if (timer_clock == NULL)
> +	if (IS_ERR(timer_clock))
>   		return -1;
>
>   	if (tmu2_register_user(stmmac_timer_handler, (void *)dev) < 0) {
>
>
>

  reply	other threads:[~2012-09-21  8:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21  7:06 [PATCH] stmmac: fix return value check in stmmac_open_ext_timer() Wei Yongjun
2012-09-21  8:21 ` Giuseppe CAVALLARO [this message]
2012-09-21 17:47 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505C238A.5050301@st.com \
    --to=peppe.cavallaro@st$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=weiyj.lk@gmail$(echo .)com \
    --cc=yongjun_wei@trendmicro$(echo .)com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox