Linux CXL
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fabio.maria.de.francesco@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Dan Williams <dan.j.williams@intel.com>
Cc: linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>,
	oe-kbuild-all@lists.linux.dev, linux-cxl@vger.kernel.org,
	Dave Jiang <dave.jiang@intel.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Ingo Molnar <mingo@kernel.org>, Ira Weiny <ira.weiny@intel.com>
Subject: Re: [PATCH 2/2 v3] cxl/region: Use cond_guard() in show_targetN()
Date: Wed, 07 Feb 2024 16:22:13 +0100	[thread overview]
Message-ID: <4546212.LvFx2qVVIh@fdefranc-mobl3> (raw)
In-Reply-To: <202402070919.0zuYCxMS-lkp@intel.com>

On Wednesday, 7 February 2024 02:54:34 CET kernel test robot wrote:
> Hi Fabio,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on linus/master]
> [also build test WARNING on v6.8-rc3 next-20240206]
> [cannot apply to cxl/next cxl/pending]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 
> url:   
> https://github.com/intel-lab-lkp/linux/commits/Fabio-M-De-Francesco/cleanup
> -Add-cond_guard-to-conditional-guards/20240206-203110 base:   linus/master
> patch link:   
> https://lore.kernel.org/r/20240206121301.7225-3-fabio.maria.de.francesco%40
> linux.intel.com patch subject: [PATCH 2/2 v3] cxl/region: Use cond_guard()
> in show_targetN() config: s390-allyesconfig
> (https://download.01.org/0day-ci/archive/20240207/202402070919.0zuYCxMS-lkp
> @intel.com/config) compiler: s390-linux-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build):
> (https://download.01.org/0day-ci/archive/20240207/202402070919.0zuYCxMS-lkp
> @intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version
> of the same patch/commit), kindly add following tags
> 
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes:
> | https://lore.kernel.org/oe-kbuild-all/202402070919.0zuYCxMS-lkp@intel.com
> | /
> All warnings (new ones prefixed by >>):
> 
>    drivers/cxl/core/region.c: In function 'show_targetN':
> >> drivers/cxl/core/region.c:670:70: warning: suggest braces around empty
> >> body in an 'else' statement [-Wempty-body]
>      670 |         cond_guard(rwsem_read_intr, return -EINTR,
> &cxl_region_rwsem);
>          |                                                                      
^

I think that this warning deserves attention and braces should be added around 
the 'else' empty body. I'm going to send v4:

#define cond_guard(_name, _ret, args...) \
        CLASS(_name, scope)(args); \
        if (!__guard_ptr(_name)(&scope)) _ret; \
        else { }

Any comments?

Fabio

> 
> vim +/else +670 drivers/cxl/core/region.c
> 
>    664
>    665	static size_t show_targetN(struct cxl_region *cxlr, char *buf, int
> pos) 666	{
>    667		struct cxl_region_params *p = &cxlr->params;
>    668		struct cxl_endpoint_decoder *cxled;
>    669
> 
>  > 670		cond_guard(rwsem_read_intr, return -EINTR, 
&cxl_region_rwsem);
> 
>    671
>    672		if (pos >= p->interleave_ways) {
>    673			dev_dbg(&cxlr->dev, "position %d out of range 
%d\n", pos,
>    674				p->interleave_ways);
>    675			return -ENXIO;
>    676		}
>    677
>    678		cxled = p->targets[pos];
>    679		if (!cxled)
>    680			return sysfs_emit(buf, "\n");
>    681
>    682		return sysfs_emit(buf, "%s\n", dev_name(&cxled-
>cxld.dev));
>    683	}
>    684





  reply	other threads:[~2024-02-07 15:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06 12:12 [PATCH 0/2 v3] Add cond_guard() to conditional guards Fabio M. De Francesco
2024-02-06 12:13 ` [PATCH 1/2 v3] cleanup: " Fabio M. De Francesco
2024-02-06 15:12   ` Ira Weiny
2024-02-06 17:23   ` Dave Jiang
2024-02-06 12:13 ` [PATCH 2/2 v3] cxl/region: Use cond_guard() in show_targetN() Fabio M. De Francesco
2024-02-06 17:24   ` Dave Jiang
2024-02-07  1:54   ` kernel test robot
2024-02-07 15:22     ` Fabio M. De Francesco [this message]
2024-02-07 15:45       ` Ira Weiny

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=4546212.LvFx2qVVIh@fdefranc-mobl3 \
    --to=fabio.maria.de.francesco@linux.intel.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mingo@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peterz@infradead.org \
    /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