Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1297347iol; Sun, 12 Jun 2022 11:42:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySH++AqTOYDl7ofkoRu6A1fa8pPKaQyFWrWlz9duaAA8BDrgw3yLFQam9imP9tMEVJOaff X-Received: by 2002:a17:906:99c5:b0:6ff:4c8f:6376 with SMTP id s5-20020a17090699c500b006ff4c8f6376mr50501215ejn.328.1655059336474; Sun, 12 Jun 2022 11:42:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655059336; cv=none; d=google.com; s=arc-20160816; b=j0ZFEvFVK9VFzcDbP+oKQ3M+92RVuviuKf9ObNt+rNrKqi8mMn3yXn0pYOaeEnNVYG EpmXkmtYNl4bzAuORrZ2mZaBsH/TdfZ2OnAz0svKPewXUTjX5eZFvK5U4NApH7fFO3Cz ootO3HWjjHi1uC0U/zX65uNSHtdRuBCARAI4an/EjAjB+Lc656qrS5EfDRTOXamFfnru yojNMaeWyfyxEcqpXIKC+FeBgyKwx+ShFqbxFEIuhsMt4XZmuhTV4mCOkpVhIhyNlgjh b/MVpNDyJ5HAlUJUHFbrq3cWkM2hg+E2yDNwHZzSZ39UwZEi3bP+/BgR/VnlCooQ6w9S lgEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=nC0UTP8DRXmynVdBku/6hOPWOfi7VmddW1Od6mn5ECQ=; b=BL4SmqtgM76h4oRD90oDtGn73VFG3oXtjX0zN19cRSIdac7Il6KAWgEUcBEBzMiWOm zVajNx+y4qtXbFGqCg6kQ2UqCDzBMbGDe+2f1vestEnvjDf4JtTxa4lBSLV311L+hfKJ kO6PWFEMAbnGJoCM86rCjaV/PnxV8NRFVl/nJXvExC/R+5qrX3aBsXPiP8ZoCFS1vaJT MEXQ11qdcJBzqTM89tA7nCrVKNA0hZAYoZZ0qWM2i7tsArNmQHso35Ulc6LGdb2hjmg4 uXvlKAhg3sfsINVzu/3X73//Cm8wmxunRLYJZc7eJtndv5yGqJMsj8XiK/bsGS0P9Twd ABtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GM8IQb6u; 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 f14-20020a1709063f4e00b0071223d9f214si5194258ejj.177.2022.06.12.11.41.52; Sun, 12 Jun 2022 11:42:16 -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=GM8IQb6u; 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 S233147AbiFLShi (ORCPT + 99 others); Sun, 12 Jun 2022 14:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230478AbiFLShh (ORCPT ); Sun, 12 Jun 2022 14:37:37 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21622532E2; Sun, 12 Jun 2022 11:37:34 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id a15so5741374lfb.9; Sun, 12 Jun 2022 11:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=nC0UTP8DRXmynVdBku/6hOPWOfi7VmddW1Od6mn5ECQ=; b=GM8IQb6uDiETDnSJH8HJW7XwCKF964hAwlaV8Q/SOybZDkFwDcihd4BWzTbus6vSwV zt+QPBw9/BCA91OFsUiVQ8JTaqNmHFT6Tdk1paoTJQ8uRBH0k0ci332kp4Gs4sXpQC/5 pmm2Rw6RGmQ1IzwsRqBB9UrMseUy5ebTlTIUXubsE3lFPRrLNcn15NKs1j/fjYM0L4HV x3GtmCS4CVmeMFrJ6n3W82+nHXSsPy73NRJFAt/wywBA8VNK/y+GPcJN3rc0Ee7kJO6B CP3MGy4Ap3X+s53K0MgFRzooc++eOPsG8L1es/4TdNOak8ljPrNHy1TAzIDwSUxCHquW aWeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nC0UTP8DRXmynVdBku/6hOPWOfi7VmddW1Od6mn5ECQ=; b=LN+ZKHAwtB4XNmpHDdO6Uqwi9dPPb1LRTc0DaejtyC+IQN54PZFP2/IdYMGBJ25k8Q 1+6XS9Of5NYLT/o88JkQa3ULpQLBKkcmJqPwPsQ68hLRQHEnWd8AQLAYrmhrM2EZOoJq FuoWpxHR+FLBOJZxdODrr5530WuHcoKLOPd52Qe8gQOe4OVRGtLKggCbleVAXJcOZ2qN 72xmpYVUX/+fyQMeZD5YMGH0vwZxYn/9tiF6LhrdJzoMQ/nxtciMpcTXZMMRNh73A3yk OpypTJXB4mOKBQu2MPApSCFKivcqwjWtBDpmtb5E51FAaIO5nDEj6j5jmn5alIGel/Ex jJ1g== X-Gm-Message-State: AOAM5329rA0hh9YcpAcM1/tlzptSN+BNqx16fV/mND4XofWVlXpU1YdS lQSPRQECQMqfiMvHBXzgxp2wo9zEWRs= X-Received: by 2002:a05:6512:693:b0:479:892:3091 with SMTP id t19-20020a056512069300b0047908923091mr32966652lfe.122.1655059051704; Sun, 12 Jun 2022 11:37:31 -0700 (PDT) Received: from [192.168.1.103] ([178.176.73.3]) by smtp.gmail.com with ESMTPSA id h9-20020ac24d29000000b004791b687257sm687885lfk.237.2022.06.12.11.37.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Jun 2022 11:37:31 -0700 (PDT) Subject: Re: [PATCH v2] ata: pata_pxa: handle failure of devm_ioremap() To: Li Qiong , Sergey Shtylyov , Damien Le Moal Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, yuzhe@nfschina.com, renyu@nfschina.com References: <20220612073222.18974-1-liqiong@nfschina.com> <20220612125700.11740-1-liqiong@nfschina.com> From: Sergei Shtylyov Message-ID: Date: Sun, 12 Jun 2022 21:37:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20220612125700.11740-1-liqiong@nfschina.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, 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 On 6/12/22 3:57 PM, Li Qiong wrote: > As the possible failure of the devm_ioremap(), the return value > could be NULL. Therefore it should be better to check it and > print error message, return '-ENOMEM' error code. > > Signed-off-by: Li Qiong > Reviewed-by: Sergey Shtylyov > --- > v2: > - add driver's name (pata_pxa) to subject. > --- > drivers/ata/pata_pxa.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c > index 985f42c4fd70..cd1a8f37f920 100644 > --- a/drivers/ata/pata_pxa.c > +++ b/drivers/ata/pata_pxa.c > @@ -228,6 +228,11 @@ static int pxa_ata_probe(struct platform_device *pdev) > ap->ioaddr.bmdma_addr = devm_ioremap(&pdev->dev, dma_res->start, > resource_size(dma_res)); Looking again into this driver, this statement doesn't make sense: dma_res points to a DMA resource, calling devm_ioremap() on it is just wrong... and 'ap->ioaddr.bmdma_addr' doesn;t seem to be used anyways... MBR, Sergey