From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 88410A0093; Thu, 13 Jan 2022 15:19:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EA94142735; Thu, 13 Jan 2022 15:19:35 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 20BA440150 for ; Thu, 13 Jan 2022 15:19:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642083574; x=1673619574; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=FuPhmitC0a09hxUH9ZyYIGKJeAUjIxXGSJRqfUAOzSM=; b=QR2baNOyYTLM1uzywGDLtVfp3IDr1sDG+FDHvXA/9IQN6q6JgREChRah KswHbRWWFZMZ17+0Xv5vy30emnCnT/SKY8nF9rOnr4rXW7OsFaEbUupD0 gKX6oqKX0Pb3ybwD6VhYvKixodG1aA1OwnvWfaSYjZaMrMxtNYfpZYgi2 qtXsQszc7ZeWz+GbKErYuxm04EbSiHcpXXlqYyG8+PpUsvbYEC/Yb8x8V AiKKWelWb1AHI69mTm7mReKMVQuhTiNzMSkxevC3m+vaTOktcMymkVhgN JUwgDPSO5HDyGk5qLvRegqRhJgHFMihSZPnjxtls3M4trEkRMK51Jzl3t Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10225"; a="243968560" X-IronPort-AV: E=Sophos;i="5.88,286,1635231600"; d="scan'208";a="243968560" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2022 06:19:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,286,1635231600"; d="scan'208";a="765554538" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga005.fm.intel.com with ESMTP; 13 Jan 2022 06:19:32 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Thu, 13 Jan 2022 06:19:32 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Thu, 13 Jan 2022 06:19:32 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.172) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Thu, 13 Jan 2022 06:19:31 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kWr96cBiUtz0Xu8LNeai4tpWStnaVLifuYsiLQo7Ea2hmvNmFAeTYrqkBV/kUzTtNYeTMLTVyJ2VgmEZpgISp8XqFcsyrSR1UC49lQvd5TFihJzUNtZh76EdNnkCMK6WlAh++2qh6/QkOc34s37ifBRw1ppTAP1536X4oWRgg687GA1867AUq1TzETH7o//E13jxWRhIkqZkPBpBWx63S+J2Dn7FptS9mLnM4+05QhfWKcWALYW3wQ+jKGa3dxn4gthN62rlHWlhhYyqn4zJTCjtWPJzBR87q/FUISwkC9hIghMQBrFFiePXvO4VpRUngJlb5XRp2OU8yD6k/wxwhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RLSmjYML99WPJGVC+SE607QG4LEwOt6rqr3u/H859uI=; b=P8bjHVIRKbCPsu7z37QnTp3C5rDCwOhxXbOEvCAX8VTPkP+GesvE1dzud3iTMOvXssy9E34LkmrbGsoNybPKWQXVkcSgmWFyT2WHPZjC/yoEyqpfSXN8AmDrOMsRg4Tb/T1+0jTonULxb5yzTxPjiiQP0ZTDsfOq7jg5ZZxCUGj8XXnxl+AfaCYPySmgYFKyyWjEkoJMDWR91JIbc0bhkminPJNNHj8fldJrVGG9PhRG+2SRjf8OMiPbZwIbDTm0otJPZluKzm468hk5+9i27pYJbL07jz2Mx5Vgx8ILjUm5rArKj8HYw9ORHqaEO3Mq33WaNGT3DXO7ZNwN2xkIxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB4252.namprd11.prod.outlook.com (2603:10b6:5:201::26) by DM6PR11MB2923.namprd11.prod.outlook.com (2603:10b6:5:71::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Thu, 13 Jan 2022 14:19:26 +0000 Received: from DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::e0a3:bb14:9df1:70d4]) by DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::e0a3:bb14:9df1:70d4%4]) with mapi id 15.20.4867.012; Thu, 13 Jan 2022 14:19:26 +0000 From: "Xu, Rosen" To: Maxime Gouin , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Zhang, Tianfei" , Olivier Matz , "Huang, Wei" Subject: RE: [PATCH] bus/ifpga: remove useless check while browsing devices Thread-Topic: [PATCH] bus/ifpga: remove useless check while browsing devices Thread-Index: AQHYAh7QGhrAfTK3aEqh7+sYz1Hl5KxhDLyA Date: Thu, 13 Jan 2022 14:19:26 +0000 Message-ID: References: <20220105102652.6400-1-maxime.gouin@6wind.com> In-Reply-To: <20220105102652.6400-1-maxime.gouin@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzMzMmExYjYtNTllYy00NTcyLWIwNDctNmY3YzY3YmM3Nzc3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiOWtaQkw1XC9BUzBoVXFhTU1kd0ZiWEdvYk1CWlhuZys1OW8wb095M3htSEZcLzhxVzBFZnZtM1hRejdjZms3SVwvdCJ9 x-ctpclassification: CTP_NT authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2708fb76-b38b-4c2c-215e-08d9d69fb4b3 x-ms-traffictypediagnostic: DM6PR11MB2923:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vmhKD5dcVfS4dTpbF3+/0kvEZU+ibdzPeTJwfF4WAcAtLzU8YfSTpMbLv9U9KSlFrAAbuBgFsBobQRI17qz73IN0gz7xrNqigvgmBJcghCylyuivk1CxYmrvJZGcuf8U5ZKMJ0iGMzrQIy+DWnf0+P4Wsarm7cLgsiFo8cUKGa7bfjUEI4cuqdWT3dI3LKxlm7y+7IhbdyuczhdHZFEIc5w4vC5142Q8PS/R4mnyhvEO4zDzYTMp2sANA2YorQj34sv/UnfqsYNYcMGYb0mflaTGMQ+oq97yKderaiZNiNcuWGxIrN0sNwokGvFGrPnVkF8w4B8YUMzJ15a200ngRW4O0bUieqhaxvB6SDsRxwoUt51Hb1I2q9/Igwdjjd8ERvbrO4y0AMeV9z/N1BOhxztL0LaIPvVePiEbcobb36W4u4ywrS3rIW74QyBDAmc5jQPtk/vklDtUgeijF0tMYpsMwMQQU2HgcTDnQr9s9cDc3Dh3NDop0bMc+2zULt5ll9YGVjjKBCMNCNRRmlhyZ9RvkNCSuwnUYQJJEG41jLOJQN40ur8WilzbPJPlu1GzfcqQdLwJTqzMKhjZbpR2dohr47cS2oaV5EWyezubJE0blA9Z3x85Ih6jD46T9N6LfsSsJ0BrNnjg1m3ROV69m3OHmRoLqi8H+s4kyJ5N39TvSga9HBuQY+J25jYZMo05+v5hLK1+Pw7SL7uN/H5eMA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4252.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(53546011)(186003)(82960400001)(6506007)(26005)(5660300002)(66946007)(8676002)(66476007)(83380400001)(66556008)(76116006)(2906002)(9686003)(64756008)(66446008)(52536014)(33656002)(110136005)(54906003)(316002)(4326008)(107886003)(86362001)(71200400001)(38100700002)(122000001)(38070700005)(508600001)(55016003)(7696005)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OvUKZM23GrmFOC5CHeT9mrGazskQ4MyzGMn3C+5B36a7/Ujuy+jVIHWO5qrM?= =?us-ascii?Q?oLGCYFFlnUx/GWa1zJkfj9BN41GpWBSBeT2ZNpyPowwaTA37BpD0QspyS3RJ?= =?us-ascii?Q?VFh0pioL17LO6muFJ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ascii?Q?2M8vaDeAHUuZB3oGQqURCV/kzEiVNduK6sDdTwdD/InDGCpMV+2Z7NJ8bl3r?= =?us-ascii?Q?l75wl2jP7h1pcIz/JCj3IiFHuVDD/QyviZkDs6gb061qC72sIDjHSbtE+7lc?= =?us-ascii?Q?j72xGdKtiSvEEjv/PTdlJyF7ewsfh2cpbotNG29FB+X7nqYkJtymEnoLiAkc?= =?us-ascii?Q?1WQwTXb2L1ZOsMKk0nhPnKm4odsrOyhsbLz2uMK56c2NmQo5EQTbyXPMdc2P?= =?us-ascii?Q?e6wCYoUjE8T5upRvFy2zedSmjbCEMSazEY0aj7us1Bt/aWqgFyJMl1dJ5bVR?= =?us-ascii?Q?0Ho1YJVd3N0Usny41HnDVu6yC2A5UBLAWx3WvxX6EvJRW4h8mungNiGbaSgX?= =?us-ascii?Q?nDX5godThKc+AEVuUVEgx+ckYf//Og/sxo2GxlusZ6TbJbjBgtK13ueOtiID?= =?us-ascii?Q?JDvP/jmD6kcwWcXD/0uhC4uEPvFKRus8EAl3UAXxBsVPrLS8Yo4/cNR3jrLU?= =?us-ascii?Q?EiIBJw87cfKRfXC2gue4DNJcpFPMUzHo3vuQfNUHLt4qj3DcOXdYjKUTJcvW?= =?us-ascii?Q?BxopwDn1UH/OeqSNstVVUb24Ah96ty8KIf7refFLAXxyG5aUkPZu+yC48cOK?= =?us-ascii?Q?dElXdefIHDae5UAGnTapPmI=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4252.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2708fb76-b38b-4c2c-215e-08d9d69fb4b3 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2022 14:19:26.8949 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xrvsBaDEpR5HACYVJ3lNbrsBJMZ7sII+mPNKCvYq02MjndTL7ht34OTNjGUOz+KZN5Haz3RiZ9b9rWpz+jVyBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2923 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi, Thanks. > -----Original Message----- > From: Maxime Gouin > Sent: Wednesday, January 05, 2022 18:27 > To: dev@dpdk.org > Cc: Maxime Gouin ; Xu, Rosen > ; Zhang, Qi Z ; Zhang, Tianfei > ; Olivier Matz > Subject: [PATCH] bus/ifpga: remove useless check while browsing devices >=20 > reported by code analysis tool C++test (version 10.4): >=20 > > /build/dpdk-20.11/drivers/bus/ifpga/ifpga_bus.c > > 67 Condition "afu_dev" is always evaluated to true > > 81 Condition "afu_dev" is always evaluated to true >=20 > The "for" loop already checks that afu_dev is not NULL. >=20 > Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library") >=20 > Signed-off-by: Maxime Gouin > Reviewed-by: Olivier Matz > --- > drivers/bus/ifpga/ifpga_bus.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.= c > index cbc680928486..c5c8bbd57219 100644 > --- a/drivers/bus/ifpga/ifpga_bus.c > +++ b/drivers/bus/ifpga/ifpga_bus.c > @@ -64,8 +64,7 @@ ifpga_find_afu_dev(const struct rte_rawdev *rdev, > struct rte_afu_device *afu_dev =3D NULL; >=20 > TAILQ_FOREACH(afu_dev, &ifpga_afu_dev_list, next) { > - if (afu_dev && > - afu_dev->rawdev =3D=3D rdev && > + if (afu_dev->rawdev =3D=3D rdev && > !ifpga_afu_id_cmp(&afu_dev->id, afu_id)) > return afu_dev; > } > @@ -78,8 +77,7 @@ rte_ifpga_find_afu_by_name(const char *name) > struct rte_afu_device *afu_dev =3D NULL; >=20 > TAILQ_FOREACH(afu_dev, &ifpga_afu_dev_list, next) { > - if (afu_dev && > - !strcmp(afu_dev->device.name, name)) > + if (!strcmp(afu_dev->device.name, name)) > return afu_dev; > } > return NULL; > -- > 2.30.2 Acked-by: Rosen Xu