Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp59751pxb; Mon, 8 Feb 2021 15:13:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyByOAekkv3pVrYQDLdE/UCU+UstaKRbe8ajFY6x32qxhTL9aerzL4VAUL2xdDl2whJWDhz X-Received: by 2002:a05:6402:3508:: with SMTP id b8mr19914744edd.341.1612825989482; Mon, 08 Feb 2021 15:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612825989; cv=none; d=google.com; s=arc-20160816; b=Yxmw1tdUC4rKgZ0WDzsVR941ycbmR1y4b5oaIc5btj3PAaAfHqA2QWQPRZUxGb+ZGN Z+JwpbtwkALvidB3VBbkrPl/K0Ovo5mlk1s7ZEzU/4tlFWt6bZJj1yBtDMMKTJWllwCn vRG1dSzvPWbHKV6HmvF7BidB5wGUdEHop/8rTDNtKkgR22T9EJgFLuw5xffKoHDe3gHx mRp8TFQarsUeaYjT98imd83L6/RgOLKoB03vImuJvswZSYAlEJZj20CC7pNL98INsP/h ZFm+EuVZayOaV7tlv7UpHv9ncQj5WFonj8XLOMqGKYMuEqcYNCTHUdI+DgXP0h0o/EY4 Swpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=kS2s2dPI8ytNFZbp+yZg3gpLYqkSZkDa3K+KlRfCscc=; b=FAPXdoSplVMxF3yaQ8J0jwnaSYPFIB99NK2L+jPV1k2AX7vMAdvKtI0u79RAcxm6M/ e911mPpswPxIEnk8NXMgGJ9pU3GwEBSZsSM3gIJORfYaB0lLeqd4cIFVMrP0rt2ocvnJ 7spgVM8HT1jSs3UEjvmuHpMVTttKKyQw+/nzoo4OWJrWPY6K4x0YL8XPZuQQhCi2sx8b 7H67nF5uwXeFqGZWQ5ekjj8wQMLD0laX/PS5DQbH2fIzoIrYro6OD5baQJ1VrrXawU7t FAkkQ/wyoa6JBS2XG14Rv7p/xh9cle9NQdxd6dG/a4Fh9cCk6pnZ/F0lgCnuV6DCfnsn S7eQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sb11si11542296ejb.0.2021.02.08.15.12.46; Mon, 08 Feb 2021 15:13:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231303AbhBHWyr (ORCPT + 99 others); Mon, 8 Feb 2021 17:54:47 -0500 Received: from mail-wr1-f54.google.com ([209.85.221.54]:38789 "EHLO mail-wr1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231193AbhBHWyj (ORCPT ); Mon, 8 Feb 2021 17:54:39 -0500 Received: by mail-wr1-f54.google.com with SMTP id b3so19152472wrj.5; Mon, 08 Feb 2021 14:54:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kS2s2dPI8ytNFZbp+yZg3gpLYqkSZkDa3K+KlRfCscc=; b=X6g1SUM14CetOT8E28Ij12tvO3sKdtFYfP4eUdMWrSEnhq5VstpxEFFtEkzI+XE9ct xFLCD+BgWInAou/8idYKJ0P+T30+BvANod/UiKtxb6Nvvw4QcVcv79Zn3ORoMVr5XbjX tzC4pMtH9g/WIE+iLFmvJAeZBbuOeoz4LIiGTgTCA+Gz2p80EAzAFPgwN2Oi5G3A8ZzM tB7FnVn9Xc1TpluQ1zAwzgPEd0YHjehqFk0lSJjeuYyyH6EbwY5JxiW/Ls1MT27Pi7+y hTTGpyZ2zlf7iddiJEzMgOSt7lv0m3tlPmO5xFybEnTybqTfLKoB67Pgg6OEAJrN/TuE KR3A== X-Gm-Message-State: AOAM530gkLMJsm/CquxUuHbqsUDxDMkyuw/7GPtpZsHE2uttBLKTis/O pel5MSp6MVYuJsaTd55Tk3E= X-Received: by 2002:a5d:4287:: with SMTP id k7mr7719744wrq.317.1612824836871; Mon, 08 Feb 2021 14:53:56 -0800 (PST) Received: from rocinante ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id b2sm11598136wrv.73.2021.02.08.14.53.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 14:53:55 -0800 (PST) Date: Mon, 8 Feb 2021 23:53:54 +0100 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Gustavo Pimentel Cc: "linux-doc@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Andrew Morton , Greg Kroah-Hartman , Jonathan Corbet , Bjorn Helgaas Subject: Re: [RESEND v4 1/6] misc: Add Synopsys DesignWare xData IP driver Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Bjorn] Hi Gustavo, [...] > Thanks for your review. I will wait for a couple of days, before sending > a new version of this patch series based on your feedback. Thank you! There might be one more change, and improvement, to be done as per Bjorn's feedback, see: https://lore.kernel.org/linux-pci/20210208193516.GA406304@bjorn-Precision-5520/ The code in question would be (exceprt from the patch): [...] +static int dw_xdata_pcie_probe(struct pci_dev *pdev, + const struct pci_device_id *pid) +{ + const struct dw_xdata_pcie_data *pdata = (void *)pid->driver_data; + struct dw_xdata *dw; [...] + dw->rg_region.vaddr = pcim_iomap_table(pdev)[pdata->rg_bar]; + if (!dw->rg_region.vaddr) + return -ENOMEM; [...] Perhaps something like the following would would? void __iomem * const *iomap_table; iomap_table = pcim_iomap_table(pdev); if (!iomap_table) return -ENOMEM; dw->rg_region.vaddr = iomap_table[pdata->rg_bar]; if (!dw->rg_region.vaddr) return -ENOMEM; With sensible error messages added, of course. What do you think? Krzysztof