From mboxrd@z Thu Jan 1 00:00:00 1970 From: "He, Shaopeng" Subject: Re: [PATCH V5 5/7] bus: add helper to handle sigbus Date: Fri, 6 Jul 2018 15:22:01 +0000 Message-ID: <7A795063ED59344FA044FE7D577A3D9878C73D@SHSMSX101.ccr.corp.intel.com> References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1530776333-30318-1-git-send-email-jia.guo@intel.com> <1530776333-30318-6-git-send-email-jia.guo@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "jblunck@infradead.org" , "shreyansh.jain@nxp.com" , "dev@dpdk.org" , "Zhang, Helin" To: "Guo, Jia" , "stephen@networkplumber.org" , "Richardson, Bruce" , "Yigit, Ferruh" , "Ananyev, Konstantin" , "gaetan.rivet@6wind.com" , "Wu, Jingjing" , "thomas@monjalon.net" , "motih@mellanox.com" , "matan@mellanox.com" , "Van Haaren, Harry" , "Zhang, Qi Z" , "Iremonger, Bernard" Return-path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 408F91BDFB for ; Fri, 6 Jul 2018 17:22:13 +0200 (CEST) In-Reply-To: <1530776333-30318-6-git-send-email-jia.guo@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Guo, Jia > Sent: Thursday, July 5, 2018 3:39 PM >=20 > This patch aim to add a helper to iterate all buses to find the > corresponding bus to handle the sigbus error. >=20 [...] > + bus =3D rte_bus_find(NULL, bus_handle_sigbus, failure_addr); > + /* failed to handle the sigbus, pass the new errno. */ > + if (bus && rte_errno =3D=3D -1) > + return -1; > + else if (!bus) > + ret =3D 1; Change the compare order, code will be a little bit shorter? if (!bus) ret =3D 1 else if (rte_errno =3D=3D -1) return -1; [...] Acked-by: Shaopeng He