Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1982114pxp; Mon, 21 Mar 2022 08:53:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzraS71GJd+LFkzGy2ehtEkRGR8p4iSCgcn/vZ3j4TgRQm3PhaqpXbgd/Pyuy+Yu/gKkyoN X-Received: by 2002:a17:906:974a:b0:6db:4f47:58f5 with SMTP id o10-20020a170906974a00b006db4f4758f5mr22040016ejy.38.1647878025350; Mon, 21 Mar 2022 08:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647878025; cv=none; d=google.com; s=arc-20160816; b=kInwYOxlvmvpQF87GtLAjvqx8KNVE1ykdxIf2vxlxzGVeoeZumqsWKu77ZOeCXSlih k75XJZbSVY4CSajg+LDjnujdITHWZEr4r9mPRjefrSBL25S4fbTbeH8VuL9v4OjjQcXs 3Ha6YgXiCl2ne7xeV4b0p2cZ7GdFhNbfA2mlK0YHIewysF7pSO2EveJCEf0F2ZGO/zpi YxHunJF8rPnR9DaV67oMq2Q3975ZSQ1GPJjuBf2Hak3DajSRqwdIIwgkp8TYIcu+rLiZ iDD9R84Fb3BVTVbZ4B8PZXZmLbb/fI17Nt7ovF4iji7N3mS1+L2TGBN+V5baSUMqz1mS OQQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1j/LMABFlKxiQiqNjegxYwlhyzGKpOnQ73hq4DOupwE=; b=EZr9/+yCM8YtCMloS/KCCM/zq3tTcZPnNZTQC8t6BwWCoU52wYyFc87H0yFHu/Nzrd 3jH+AOxU0LL79UFraAsAAX6tEzjtjmCZ4YkW4Ot+7cZ8mR/71nplYxLyc+EDIwbvKuD3 wwq/R+kK69Mq8IhJS+p0wWg+HBK/e+U//SMkE0upjC86QDMaKq3h93T69PRVaROc6zWJ qqRVcC8vM0zcJvCNCD2oxdFZ/hJj/7zVwZw+VSLJZG1c4Zt6zKzIg203P8tPkgiTC75E cwKEbDeI+2VLK3nVaB47TEp/xEhYDWXcSEdWxpHewFLhhKFYgYlnjjhihUFyWKSlvAdE M8qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OhL3haaG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fi1-20020a1709073ac100b006df76385d2dsi6672686ejc.461.2022.03.21.08.53.19; Mon, 21 Mar 2022 08:53:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=OhL3haaG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244150AbiCSUfQ (ORCPT + 99 others); Sat, 19 Mar 2022 16:35:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235693AbiCSUfP (ORCPT ); Sat, 19 Mar 2022 16:35:15 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FCD211BDBF for ; Sat, 19 Mar 2022 13:33:53 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id t1so13912342edc.3 for ; Sat, 19 Mar 2022 13:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1j/LMABFlKxiQiqNjegxYwlhyzGKpOnQ73hq4DOupwE=; b=OhL3haaGthCsvRcFFsS4y9PSbMbS1jur2LY3uaicYJHh6mz0cs8cB914hTuLd1KYbX Rf5gHj8CefeqBeSoVvm0DEmZCPRnDGx78RnSNWAKWQrp5oKe6hV/QYEm1FHMPobWxC68 G0wne6ppuXcDrmjl/B3+XEm6XpaW/uLvXkrlOz7al5QlnCgSofeGe009sv8yCOD5jCzO oGA5qewS0nN2pgYeh3fWXLlkDYEZj2JM32gWIM0E2QoDnALZvzRuuz2evW+8Hyj5TtPw nKS7Med5/e8K5fNXKiSjBLVlgaqfMyfOvdTYfDSYjRCEpnHmuOgWbOH9KZhhpPF1UEnU suRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1j/LMABFlKxiQiqNjegxYwlhyzGKpOnQ73hq4DOupwE=; b=f2rSppZweTgyMyXvHLMa4bFtkDJbWBg5qhnMxygXElT7AuerjZcxjyKgPO3c8j9l0G WGSUFMUc7t3wqQ2Bx12xtvHi0WI4g5A55GnRH5QMDPaiSy2LVyp2m0iRa7nEGu1V6TJa +LS8KMkeHRGJqQLy607RyHQEqVz4ASGMDHddQh7f3za2yS/sJIEsvTlk0TWIoc552Rg7 y6ksZQiebZNZnliKmFJDU1NQctx2h7N87J/I9/lsg209skjFrC9XnDkky2ideZNBKG63 DCup80iWBLKaNytBnj0EC90+Mw87J1TnelXo7TPvK6d9IDll9AkCz4wJwH7VJTpj/KTx I/Xg== X-Gm-Message-State: AOAM533AF4EBjFZp7x+D0tlNLN4pR3guUwi3w40D3m83ZdadiFVCWP3U B/P5kErOODOPdYUqgk+R0H0= X-Received: by 2002:a50:d711:0:b0:410:a51a:77c5 with SMTP id t17-20020a50d711000000b00410a51a77c5mr15801434edi.154.1647722032176; Sat, 19 Mar 2022 13:33:52 -0700 (PDT) Received: from localhost.localdomain (i130160.upc-i.chello.nl. [62.195.130.160]) by smtp.googlemail.com with ESMTPSA id gl2-20020a170906e0c200b006a767d52373sm5174158ejb.182.2022.03.19.13.33.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Mar 2022 13:33:51 -0700 (PDT) From: Jakob Koschel To: Matt Porter Cc: Jakob Koschel , linux-kernel@vger.kernel.org, Alexandre Bounine , Kees Cook , John Hubbard , Andrew Morton , Mike Rapoport , "Brian Johannesmeyer" , Cristiano Giuffrida , "Bos, H.J." Subject: [PATCH] rapidio: remove unnecessary use of list iterator Date: Sat, 19 Mar 2022 21:33:44 +0100 Message-Id: <20220319203344.2547702-1-jakobkoschel@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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); } base-commit: 34e047aa16c0123bbae8e2f6df33e5ecc1f56601 -- 2.25.1