Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2257163pxp; Mon, 21 Mar 2022 15:08:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuDp7uS/1oIY7/oe0TU7nto+qYTEMIS93AJusbQC5w4uoen7FET0ja5SR6DxHw/B5CVK5E X-Received: by 2002:a17:902:ccce:b0:154:7a02:2a05 with SMTP id z14-20020a170902ccce00b001547a022a05mr2628853ple.42.1647900517601; Mon, 21 Mar 2022 15:08:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1647900517; cv=pass; d=google.com; s=arc-20160816; b=ZUHj0qf58gi0Qc8glqMQCX0T8OLX+yNdDnhhcl3iiGKRVXObvucDGZjcAGbnwkVn+f F6u3QFPxEWNu+xwzZIPefp9lVewoHQE9iYO+9EfORFw4s31+b41R8r2Mgyom3nZmgKy1 qsLN7CM2SEpmjEJhX6dh3dxx20l4SxRi5Vr6fWcEYvpYTFlc83NETTebCCmWZQ2o9b4p o//98Q1L/f+HAGtgS3I0aewVTVnrj8hLX/iGv3e0OCVtA9fBN2ajqp3tD9zYZu+C52Sa Xz1x4vjgph37ym4/7KoCISGegEmqbcY4NTQkl6ujV3+xYtGesJ8MeIH7aL7k+rIiUMKY tg5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=8DdarTynyysUTO96dCG/HtMTnIPH9KQ3ExgmVURIHNQ=; b=zj5xBEgD36mH7nx6orr9BMds+0KtM2YGXtYPdvv0ZlFu4LaYiNerOP6NDT/nvL3Fph A4pHor+nQZQ0mHlH2bsBQLDZsIFkVim/sxFtI2HV5SadOU+qB8Z8UVdbbDB7RSiYtaRD VRObx/dstzarxWX7xmUiHKo35DxJndMN5mocqobuyOZR+yxAc5iyH1ZKe+AKQ+5KNFvl 6b8Vxm8b3Q3jiDvDwELikSFgnJYteT6A2u2kTcCGJD5VMPANDUxyVbcbvLvdFbrSRwJp 84Gm0C3v2ZBX6d12NBljpkFnBNz9pD/GA8d1qcs2LUL1a05OpCJqj2Z8hpTt038WfRq/ bFrQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=iH2inuq2; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b18-20020a170902d31200b00153b2d164c5si10902838plc.205.2022.03.21.15.08.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:08:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=iH2inuq2; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5ADEF35CE45; Mon, 21 Mar 2022 14:29:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238708AbiCTWwa (ORCPT + 99 others); Sun, 20 Mar 2022 18:52:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231670AbiCTWw3 (ORCPT ); Sun, 20 Mar 2022 18:52:29 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2079.outbound.protection.outlook.com [40.107.223.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1356E49CA5 for ; Sun, 20 Mar 2022 15:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZA7JQVKYGGAJ0r298s3BKtP6arOKLCUSWugMsP1GST8Aa5Zetvf6LC1o1gcaDZh3j60nEdzT7qMs/RLtfbTByV8nWKqH35HgFMYWmbO7uVkp/fsmdQWqp/Du96jTtvntvCzbQaHoG43sxfJv9U94b7EEF/QL8qGsgCRq7uvjg5Vb+hl58aeBe24xLEIhy1RnvMoF2W/0t8Ow2zmpy7Px5hdbGanDTJdkmiZk9g8B0XBvnhhIR8uEhiDzJ8i5pfspbOZDSPFWNFE+1DtPPRnxXVc4oUsklRSne9HK0C8mXdU5rprUfNfLkVmtTWPpLeU7qvfdaPPJGjqsLOMT/JkPHg== 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=8DdarTynyysUTO96dCG/HtMTnIPH9KQ3ExgmVURIHNQ=; b=SvSiDKe7aMpe/+QtnMgqJz0iZk9fZL9rD0DJptwMBaPI4fYeIl6xupkgS+toCRSTbH1QKhVdLGFVFlBjGuXKbERlQWjioxmb3eJ8y9kNZDmqu6BBjR6NctOVtHyRF+Esuim7Zut1TSyXkMVftk2ltU7rX8IBLPYnib99lL4hPATM24a8gec0EmIXWXL2HoQvtZIApJYlRN8XRcYUwfvaXAHRgNpjjXn10XZajfzgQnflv9IGqco4xcncZhT1Px7qFAxEORHJQ2PXSxxNGSvtB+HcvK6CZuDhI07r1CCm9we7AzcpIeCIzajqufP5YNxhKLLyoLFoK0xEP8Jc7klZZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8DdarTynyysUTO96dCG/HtMTnIPH9KQ3ExgmVURIHNQ=; b=iH2inuq2Qgo7erXhPpOpGHCPktdXuds6elyl7n1aqA9Q63LQjbYZByqEXPSi2zNyB8U5RT37uGwe/q/ei30jiTOPsQojPL5ta/+nvZImk8puHBk/K4hHPDEYSAcI2r9OeuXZ0KNgT17+lnv5K34skfWDV1SKI0/EkO/FF2h1TYvEgNrPqNE88u/Z/KnabsEVnpd9+l7bDOBDQUWvwIXO5mR/JHPXqLNy7ovr1tLxLEtCClXtxCWlFsvnDTQlW+0Zl3XmlB4YecL83781dbKYD1xG6uao+hHPiXBC9jEuql3Ty7A5rlvYBgaH5yf1cP5aw042GKfLKzoHev1YE/Qe1A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by CO6PR12MB5409.namprd12.prod.outlook.com (2603:10b6:5:357::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Sun, 20 Mar 2022 22:50:58 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::b4d2:1b8:7a7b:fdcb]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::b4d2:1b8:7a7b:fdcb%7]) with mapi id 15.20.5081.022; Sun, 20 Mar 2022 22:50:58 +0000 Message-ID: <82bcda66-cf26-c9f5-fe2e-e41f739ec1ff@nvidia.com> Date: Sun, 20 Mar 2022 15:50:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] rapidio: remove unnecessary use of list iterator Content-Language: en-US To: Jakob Koschel , Matt Porter Cc: linux-kernel@vger.kernel.org, Alexandre Bounine , Kees Cook , Andrew Morton , Mike Rapoport , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." References: <20220319203344.2547702-1-jakobkoschel@gmail.com> From: John Hubbard In-Reply-To: <20220319203344.2547702-1-jakobkoschel@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR06CA0018.namprd06.prod.outlook.com (2603:10b6:a03:d4::31) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d022bf82-c6e8-4c53-e6b5-08da0ac41930 X-MS-TrafficTypeDiagnostic: CO6PR12MB5409:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uGHH1jitd9CR9gXoXD1bWl69XL0079RTPVYnGN80gMmXHgJAUBXn4gEWkKhl9F4MPWQQvV+I3+pV1bcJRLgtQj/MOClePwIgdBNYKWwPHPFIXRHkRvlcv+NjToe7uv8gZis5AbxPPyeVtwjh6UFOhhss5NSXmzLmGCmluutG7iGvdIQ5U0PeaGO7ailimMOFrjWL7sMSJOhpBBStjsGn86Mx00QqC29cFtGB10BiZXQK9OEglWnvPmSEOimXIFZSGdRHJ9W5SIHzRPt9JTp/BOlgBzQtyShebIwved/E5VHaf1b482VrvHa/2uWI1fhD/RK+FwS+PTByhG8ntf9ZgmDGBkkpLnBujCwQbK8AUwIqugldLOZaCfoWf0J2Bg9YXR7+ZKd+J6mqnyYiF+zmKoPDVIYoZwDonWnQyhxJH4orxCppmCtPg2AbTsstChxc6gIqlvYw0mTNib1VOUxaX1h0xP1b/a4sfUz/8nhKa76RUfHXqAouZgYKhfVhLC19AZDPjARigkPWyl4m1tf8e96ZuVFLRacLhs11Vx4f/Lhw7s6QNfgvtotUDgsWEShzfVMpUZa5/P8JBjhCduYH1pk0prWV3k7Nk9Iy7gzj+43N5iK52/BDwwkO+kWAT/Lc4nTfgWUtkGdtk5CuVpdYHhqOrwhU+d00FsYCr6OlNV1oHyXxVIzSwXVy/CEfelPQggrIq43YjdLtymV0rYXZfMhP9C18s7AE1uEggH+zQCIs6GQmKJfGbzjk+rCJ7u+PgLdEhnIArc8ODYDrFa6Tw7DU+5Dd675Rwr5SJW8Ejkoat39hIi/rNIy/QiEDtB6zcIqaxyJbi2phiQyEiUJexA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4130.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6512007)(4326008)(66476007)(36756003)(31686004)(66556008)(83380400001)(2906002)(8936002)(53546011)(66946007)(2616005)(6666004)(8676002)(6506007)(38100700002)(7416002)(110136005)(508600001)(86362001)(54906003)(966005)(6486002)(316002)(186003)(31696002)(26005)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TWhXN0d6QjV4WGVxMlNOVHphUEoxS2pucXpRcjRydVJyT1UxY1JVNk5sdDAz?= =?utf-8?B?cDVsbTRPQWZrc2ZGeDRyRHVuNzk0aGViblQzZlNoWWlNZ3FzVTdacnY5dy9v?= =?utf-8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HN1BzQnFlNUlpT3JoUktkN3p2WnFa?= =?utf-8?B?UHl6YnhTUWNmZThuT3kwZUNGNEJyMlNRaDZ6bXhBNXAzUkIzMU5zd2lCSDNz?= =?utf-8?B?cVdkWG1oODFBPT0=?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d022bf82-c6e8-4c53-e6b5-08da0ac41930 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2022 22:50:58.4473 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lA69hn5peMBThSOCMwmMddyxQ5DaXMuvNVTZgUI+qm/50pTYCIQlxhmbEWy+cAKgMwZEvvB+g9Pdo8bXJZjRMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5409 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/19/22 13:33, Jakob Koschel wrote: > req->map is set in the valid case and always equals 'map' if the break > was hit. It therefore is unnecessary to use the list iterator variable > and the use of 'map' can be replaced with req->map. > > This is done in preparation to limit the scope of a list iterator to > the list traversal loop [1]. > > Link: https://lore.kernel.org/all/YhdfEIwI4EdtHdym@kroah.com/ > Signed-off-by: Jakob Koschel > --- > drivers/rapidio/devices/rio_mport_cdev.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c > index 7df466e22282..2cdc054e53a5 100644 > --- a/drivers/rapidio/devices/rio_mport_cdev.c > +++ b/drivers/rapidio/devices/rio_mport_cdev.c > @@ -915,7 +915,7 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode, > goto err_req; > } > > - if (xfer->length + xfer->offset > map->size) { > + if (xfer->length + xfer->offset > req->map->size) { > ret = -EINVAL; > goto err_req; > } > @@ -927,7 +927,7 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode, > } > > sg_set_buf(req->sgt.sgl, > - map->virt_addr + (baddr - map->phys_addr) + > + req->map->virt_addr + (baddr - req->map->phys_addr) + > xfer->offset, xfer->length); > } I'm not a RapidIO expert, but this change is small and clearly correct, so: Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA > > > base-commit: 34e047aa16c0123bbae8e2f6df33e5ecc1f56601 > -- > 2.25.1 >