mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
	Yuanfang Zhang <quic_yuanfang@quicinc.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@linaro.org>,
	James Clark <james.clark@linaro.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH next] coresight: Fix a NULL vs IS_ERR() bug in probe
Date: Thu, 24 Jul 2025 14:29:44 +0100	[thread overview]
Message-ID: <20250724132944.GK3137075@e132581.arm.com> (raw)
In-Reply-To: <6fecd7d0-a5a5-4973-94ce-c63a3dff6bc7@arm.com>

On Mon, Jul 21, 2025 at 04:46:30PM +0530, Anshuman Khandual wrote:

[...]

> > diff --git a/drivers/hwtracing/coresight/coresight-tnoc.c b/drivers/hwtracing/coresight/coresight-tnoc.c
> > index 0e4164707eea..d542df46ea39 100644
> > --- a/drivers/hwtracing/coresight/coresight-tnoc.c
> > +++ b/drivers/hwtracing/coresight/coresight-tnoc.c
> > @@ -183,8 +183,8 @@ static int trace_noc_probe(struct amba_device *adev, const struct amba_id *id)
> >  	dev_set_drvdata(dev, drvdata);
> >  
> >  	drvdata->base = devm_ioremap_resource(dev, &adev->res);
> > -	if (!drvdata->base)
> > -		return -ENOMEM;
> > +	if (IS_ERR(drvdata->base))
> > +		return PTR_ERR(drvdata->base);
> >  
> >  	spin_lock_init(&drvdata->spinlock);
> >  
> 
> Do we still have more similar instances in coresight ?

It is a bit shame that I have enabled smatch for static checking but
did not verify this series.

I can confirm that the coresight driver does not have such issue in the
current code base. After merging the CoreSight clock fix series, we
should be able to dismiss all errors reported by smatch in CoreSight
drivers.

A side topic, I observed that smatch does not like the long functions
in drivers/hwtracing/coresight/coresight-etm4x-core.c. So I built a
smatch version with relaxed limits.

---8<---

diff --git a/smatch_implied.c b/smatch_implied.c                        
index 9055d676..7469f1ac 100644                                         
--- a/smatch_implied.c                                                  
+++ b/smatch_implied.c                                                  
@@ -462,13 +462,13 @@ static int going_too_slow(void)                   
                return 1;                                               
        }                                                               
                                                                        
-       if (time_parsing_function() < 60) {                             
+       if (time_parsing_function() < 300) {                            
                implications_off = false;                               
                return 0;                                               
        }                                                               
                                                                        
        if (!__inline_fn && printed != cur_func_sym) {                  
-               sm_perror("turning off implications after 60 seconds"); 
+               sm_perror("turning off implications after 300 seconds");
                printed = cur_func_sym;                                 
        }                                                               
        implications_off = true;                                        
diff --git a/smatch_slist.c b/smatch_slist.c                            
index cc3d73b7..039cdae7 100644                                         
--- a/smatch_slist.c                                                    
+++ b/smatch_slist.c                                                    
@@ -321,7 +321,7 @@ char *alloc_sname(const char *str)                  
 }                                                                      
                                                                        
 static struct symbol *oom_func;                                        
-static int oom_limit = 3000000;  /* Start with a 3GB limit */          
+static int oom_limit = 4000000;  /* Start with a 4GB limit */          
 int out_of_memory(void)                                                
 {                                                                      
        if (oom_func)                                                   
@@ -332,7 +332,7 @@ int out_of_memory(void)                             
         * It works out OK for the kernel and so it should work         
         * for most other projects as well.                             
         */                                                             
-       if (sm_state_counter * sizeof(struct sm_state) >= 100000000)    
+       if (sm_state_counter * sizeof(struct sm_state) >= 500000000)    
                return 1;                                               
                                                                        
        /*                                                              



  reply	other threads:[~2025-07-24 13:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 19:38 Dan Carpenter
2025-07-18 12:47 ` Mike Leach
2025-07-21 11:16 ` Anshuman Khandual
2025-07-24 13:29   ` Leo Yan [this message]
2025-07-21 11:23 ` Suzuki K Poulose
  -- strict thread matches above, loose matches on Subject: below --
2025-03-14 10:55 [PATCH next] Coresight: " Dan Carpenter
2025-03-17  1:07 ` Jie Gan
2025-03-17  2:13 ` Anshuman Khandual
2025-03-17 10:07 ` Suzuki K Poulose

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=20250724132944.GK3137075@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=anshuman.khandual@arm.com \
    --cc=coresight@lists.linaro.org \
    --cc=dan.carpenter@linaro.org \
    --cc=james.clark@linaro.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=quic_yuanfang@quicinc.com \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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

all inboxes | Powered by JetHome®