Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2942780pxk; Mon, 28 Sep 2020 04:33:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxusAj7SLih+pq1ONQsO7lIlOqE2ie+Grq+dkl3VKvCjFyh1aOVod0bViH8Kvz00fY51iuN X-Received: by 2002:a17:907:444d:: with SMTP id on21mr1111961ejb.329.1601292818880; Mon, 28 Sep 2020 04:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601292818; cv=none; d=google.com; s=arc-20160816; b=EkrxpsfMY1hzgh98lNwmFGGV9ipl8U22Oo+sYaZSFVSZrVQIwQU5QiUmIpo2KUFlTG 62bVU2w8i91GEHHvRHWxFHNjYGxJx3rzTJgnpgADo9DEYo9dJl3Nb4RHSnEk2oPM7+nD yo5W4H53VtsHKZ71K//ZWFRaDOxvVR4i5kHeJrKH9KzGeE1Xz9XGqrzMJCYBoz7oaX5T yVtKg37dZw6TtODMYoP0CtDRx6qMxeDNTs+C5zdVbio9mA8utbwlgRp9GkbSxm9+/qLo 8Qyp53TNyFgvh7KOvljYRdkiwatAp/BvyGcW17suGfC48v9pNlY2mJHKkDYlW0FZfTAs FYwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=zJmDmcAmefrRVFYr5b/g5imZ9rRAXBz5P3uq1R9+34U=; b=uwEtCyxWbysnPl74rsPqc77mvPKrYwa+L/XGpUjx3sb8srlEULtw/4Hgg3eJv3G55P ttnMXiLuedkezW96OcGJOpg4MOEAyLhUQgKhUG/H3F5yrzzIXDMgzc+vRQAros8LVaac VGizGehUZW0/vd4kkoIGyfADJ3ltRD9OvaJP6dl9D8VdzXvLDE/J1o+IDn4rmZkk0NJY OtFLCa92y8OCvjy9W3kFnmo0t0b9fk9gt+47QHwSNIkhMi1yLrXEPCEhJXVA0TQ8BZSD SEsnq7fQ+bcAnIYAZloP4GxejyEumriMZQ3SuFk1ZdS8lR60yTQ0B1jjuAIWhNh+BJKD LLyg== 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 i11si398598edl.389.2020.09.28.04.33.16; Mon, 28 Sep 2020 04:33:38 -0700 (PDT) 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 S1726589AbgI1Lbp (ORCPT + 99 others); Mon, 28 Sep 2020 07:31:45 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:59587 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726526AbgI1Lbp (ORCPT ); Mon, 28 Sep 2020 07:31:45 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.5]) by rmmx-syy-dmz-app03-12003 (RichMail) with SMTP id 2ee35f71c9871e4-f33dc; Mon, 28 Sep 2020 19:31:19 +0800 (CST) X-RM-TRANSID: 2ee35f71c9871e4-f33dc X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from [192.168.21.77] (unknown[10.42.68.12]) by rmsmtp-syy-appsvr03-12003 (RichMail) with SMTP id 2ee35f71c9858a0-40163; Mon, 28 Sep 2020 19:31:19 +0800 (CST) X-RM-TRANSID: 2ee35f71c9858a0-40163 Subject: Re: [PATCH] usb: bdc: Remove duplicate error message in bdc_probe() To: Greg KH , Felipe Balbi Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Fainelli References: <20200927134218.20028-1-tangbin@cmss.chinamobile.com> <20200927134550.GA302849@kroah.com> <87sgb29r3g.fsf@kernel.org> <02162cfc-cbe3-4747-e518-7f3b3d7a0e7f@cmss.chinamobile.com> <20200928112301.GA415117@kroah.com> From: Tang Bin Message-ID: Date: Mon, 28 Sep 2020 19:31:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200928112301.GA415117@kroah.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi 在 2020/9/28 19:23, Greg KH 写道: > On Mon, Sep 28, 2020 at 06:55:26PM +0800, Tang Bin wrote: >> Hi Balbi: >> >> 在 2020/9/28 17:40, Felipe Balbi 写道: >>> Hi, >>> >>> Tang Bin writes: >>>> Hi Greg KH: >>>> >>>> 在 2020/9/27 21:45, Greg KH 写道: >>>>> On Sun, Sep 27, 2020 at 09:42:18PM +0800, Tang Bin wrote: >>>>>> In this function, we don't need dev_err() message because >>>>>> when something goes wrong, devm_platform_ioremap_resource() >>>>>> can print an error message itself, so remove the redundant >>>>>> one. >>>>>> >>>>>> Signed-off-by: Zhang Shengju >>>>>> Signed-off-by: Tang Bin >>>>>> --- >>>>>> drivers/usb/gadget/udc/bdc/bdc_core.c | 4 +--- >>>>>> 1 file changed, 1 insertion(+), 3 deletions(-) >>>>>> >>>>>> diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c >>>>>> index 02a3a7746..9454f179e 100644 >>>>>> --- a/drivers/usb/gadget/udc/bdc/bdc_core.c >>>>>> +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c >>>>>> @@ -508,10 +508,8 @@ static int bdc_probe(struct platform_device *pdev) >>>>>> bdc->clk = clk; >>>>>> bdc->regs = devm_platform_ioremap_resource(pdev, 0); >>>>>> - if (IS_ERR(bdc->regs)) { >>>>>> - dev_err(dev, "ioremap error\n"); >>>>>> + if (IS_ERR(bdc->regs)) >>>>>> return -ENOMEM; >>>>> Why not return the error given to us? >>>> Because when get ioremap failed, devm_platform_ioremap_resource() can >>>> print error message >>>> >>>> "dev_err(dev, "ioremap failed for resource %pR\n", res)" in it's called >>>> function. So I think this's place's >>>> >>>> dev_err(dev, "ioremap error\n") is redundant. >>> that's not what Greg point you at, though. Greg's concern is valid in >>> that instead of passing along the error within bdc->regs, you always >>> return -ENOMEM. OTW, your code should read like so: >>> >>> if (IS_ERR(bdc->regs)) >>> return PTR_ERR(bdc->regs); >> Thanks for your explain,when I send the patch yesterday, my point is at >> dev_err(), and not aimed at IS_ERR() & PTR_ERR(), >> >> if it's Greg's point, I will change this patch after his reply. > Felipe is correct, and also, you should listen to him over me as he is > the maintainer of this part of the kernel :) > Thanks for your reply, I will send v2 for all of you. For me, all of you are the teachers, I am glad to learn from you. I respect every teacher, I think Felipe should be able to feel.  Because the premise of the patch, Felipe is also teaching me the question. So I feel I am lucky. Thanks for all of you. Thanks Tang Bin