Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751323AbdH0Stp (ORCPT ); Sun, 27 Aug 2017 14:49:45 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34041 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbdH0Stn (ORCPT ); Sun, 27 Aug 2017 14:49:43 -0400 Subject: Re: [PATCH] tty: serial: 8250_mtk: Use PTR_ERR_OR_ZERO To: Himanshu Jha , gregkh@linuxfoundation.org Cc: jslaby@suse.com, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1503815501-9205-1-git-send-email-himanshujha199640@gmail.com> From: Matthias Brugger Message-ID: Date: Sun, 27 Aug 2017 21:49:38 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1503815501-9205-1-git-send-email-himanshujha199640@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 846 Lines: 27 On 08/27/2017 09:31 AM, Himanshu Jha wrote: > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR > > Signed-off-by: Himanshu Jha > --- > drivers/tty/serial/8250/8250_mtk.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c > index ce0cc47..fb45770 100644 > --- a/drivers/tty/serial/8250/8250_mtk.c > +++ b/drivers/tty/serial/8250/8250_mtk.c > @@ -171,10 +171,7 @@ static int mtk8250_probe_of(struct platform_device *pdev, struct uart_port *p, > } > > data->bus_clk = devm_clk_get(&pdev->dev, "bus"); > - if (IS_ERR(data->bus_clk)) > - return PTR_ERR(data->bus_clk); > - > - return 0; > + return PTR_ERR_OR_ZERO(data->bus_clk); > } > Reviewed-by: Matthias Brugger