Received: by 2002:a05:7412:2a8a:b0:fc:a2b0:25d7 with SMTP id u10csp377629rdh; Wed, 7 Feb 2024 07:22:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWfLfp4kHzy3DnXZRr9+kKnUxEiy113rlwUtH3iPw0nMwREgVxhXlxtBx1VySEZdr4hkBUrc6YsABAPbjdtTbB0kXTUBfW0ifItZsaGnA== X-Google-Smtp-Source: AGHT+IG+JlztzBRqK9wU4r6+KDO1TJ9UMYtueqaCpdV5Q2F7PZMhbp3llboU+jO/jgBcTB6XOF/Q X-Received: by 2002:a05:6a21:187:b0:19c:58fa:5a71 with SMTP id le7-20020a056a21018700b0019c58fa5a71mr5160976pzb.54.1707319351331; Wed, 07 Feb 2024 07:22:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707319351; cv=pass; d=google.com; s=arc-20160816; b=jLe5Ugc1Hzy++GQ12YtPN+p7Uj3QweINxacMnXotkKMwAtummVICGTRiul16HKt7vB F3pHOPaeM5IjhFMhQHd5feBdcDNooFUIZh2J7WRf26G8zBueANrEu3kPD7ScHS6lTokA PeN8IaqVftOEd162E9TxtAbC6oTgqY/+jyBMbJ82l54EywKDL6zIlzsi9ABWYmmTFUoo SHsj+G2lnwpW7Uy/hSWR9IiRSGDaqihCoR7rQXRjNrF5x7qFaFCq0CEAFojLOJayaG6v 6SkgSknnw+5YxQ49Iy2bAhcNMWRB4ZriGDMhESUQWKhXQwDZ82VLiSz0pFgLXE5C+oUA L4tQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to :organization:message-id:date:subject:cc:to:from:dkim-signature; bh=q2LUP1gFR1EI3N5HWDrpsekQBvbfDsJ1Ft2UwrzGavY=; fh=2LnLcqbEHGa71vOWu4ceBH9+LoJXqMaRuL9Ouw40kWU=; b=pIn50IAXLeWW5i17Kn/9mq/LASM7YqEXxg8k8YcGUcq9gFRii4L137+MRxZ4RsAr1F JAy4YRy9lgKo/L83wo5ecBtavpulnDEkm9N7Ho9G4XT4cKhIhhYfQStv4U5HpL8XTaTr M7izanB6dGNpcbZEL6MKSHXaO0mXYNIfjvR4jNEKPDSHL4Zt6YPYs43Qwic9tYEDQbgP 8Gj8nsKssqrZFrxWDKr3Pq+WBldPOfJ3O1X1Eh/JzOqPT90zLJuRlkYk0EXeVUqSl9+S P2UxnJS/Ie6xuvfB/B29eXcS8W+r7Bjsi3rw5vFb4ePvNJHNRCkyTaaQ62jkyn/3lri7 MHOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="jF3oZI/C"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-56707-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCUkcql57rYpjdIwUbSSoY5xKLDfes5TU1xtalb1i9EwRdBLrbcTX5ZttUjpAfg2TnwdHrUo4Gt44wr/Dmv1rA/39fK5mQbGc4CQ5hfXNQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o4-20020a17090a3d4400b002964f6f750fsi1738058pjf.153.2024.02.07.07.22.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 07:22:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-56707-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="jF3oZI/C"; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-56707-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-56707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 06B8D283253 for ; Wed, 7 Feb 2024 15:22:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E19B57F7C6; Wed, 7 Feb 2024 15:22:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jF3oZI/C" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0A9259B78; Wed, 7 Feb 2024 15:22:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707319342; cv=none; b=lrUCSqxna0Z4NqFNPcdKk0tgrU1NOCzEPdIawlabTnsv7SNePgVryT1nrogmRoSZQBTQwnqjVQcXLBjIvHBCPLlt9z2+6xaPwfT/SF9ulYszNC+Te2Vs8RqnkOaroidR3e+Whava+rtrhw5dXc0uKHHtNm0BBDNOvrJCLkEBILM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707319342; c=relaxed/simple; bh=0ZqVkE4MQT6le5S4lU2VaSaHvTULorc8uo0swoUmiUI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lKlO6E2l0hjG/0kWTceUX5e47Elxn1oGO8drrwsfDECzAvd6LBh6MaOIX6sJN0IOcXe+4h75d8CMJC4ltFiu3nnYvutNeug9+Iir6zxpaiz7i/TDDxH66pKoPHRWTVz9FkdX6hUkwhA5qY4k9uu4Q8wRx6D+lzblVKVXxbBUD5w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jF3oZI/C; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707319340; x=1738855340; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0ZqVkE4MQT6le5S4lU2VaSaHvTULorc8uo0swoUmiUI=; b=jF3oZI/C6hb98mtYHLQaugOK0GTYEdMV4GOoBB9VDN5uccgjt13LzvEU 0S7YVOHaxqmo+FW5kBHHVg9qcZCK9iqsKXFUNzJCEKATt0f9M8YhRBMY6 DLqkyOH2iz0RBimCBo+QH0aexZ68u7o5b5jqovksBXX0j1R95xLQ4TACQ a27uTuCKc3qRaUgyM14ZH1eM2BvBUGj8T0SP6k7pBUcjfamlijkptwk1b 6g5g94pDo/qyo6fRkUU9qarplLhIbsPcuJXolfXMRIzAGOxrvDmpgcrDC oRpB88eJ7tYerjjRLlP95sgZhjIaaqG1Wtvw7vViYFV27mM1FRXvAA4Cz g==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="3998390" X-IronPort-AV: E=Sophos;i="6.05,251,1701158400"; d="scan'208";a="3998390" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2024 07:22:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,251,1701158400"; d="scan'208";a="1657320" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.localnet) ([10.213.22.1]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2024 07:22:16 -0800 From: "Fabio M. De Francesco" To: Peter Zijlstra , Dan Williams Cc: linux-kernel@vger.kernel.org, kernel test robot , oe-kbuild-all@lists.linux.dev, linux-cxl@vger.kernel.org, Dave Jiang , Jonathan Cameron , Ingo Molnar , Ira Weiny Subject: Re: [PATCH 2/2 v3] cxl/region: Use cond_guard() in show_targetN() Date: Wed, 07 Feb 2024 16:22:13 +0100 Message-ID: <4546212.LvFx2qVVIh@fdefranc-mobl3> Organization: intel In-Reply-To: <202402070919.0zuYCxMS-lkp@intel.com> References: <20240206121301.7225-3-fabio.maria.de.francesco@linux.intel.com> <202402070919.0zuYCxMS-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 > | 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