Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp293454pxu; Thu, 15 Oct 2020 04:16:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwZCQY5fJM/0JZNVAvQMDQzg+yC0MAJm3ueMJ4t4XMVp2ShKUCCoJ9l5qab3BLlvz9uVWc X-Received: by 2002:a17:906:d8a3:: with SMTP id qc3mr3976074ejb.183.1602760582429; Thu, 15 Oct 2020 04:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602760582; cv=none; d=google.com; s=arc-20160816; b=sZPcepLyX/FzN1fkjXIjvx7Km43STWXeAV92y2asfTEfoqIY+tjHgKkj0xVjYR/JeR OqBn1yVHSAWhWVEJUIe95Tp38QRCXk1B1j9hxs0MMPMJslLN1j6zKywJ/1FaN+JVuC6J xrL8sV0QQ8+N8+YiWEHCncZjFOJ0dZu4DksENLeKubF6mFCt5ADUsQdul6oEgNWUSW53 rkszPJLQDXnh7ovBER6UbKsqjwPLAk1ZTOF1uYUHpKNT3FWgSE82VcYqANkeqf1Es+Kt bF9Otng1X6POrR6NVW0yhs4DphwjwELbNevlvk5vGTm0104655aPfPEDnJIofNRktpvk ZsIg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Nigbbdmqr7i4KFBl364rMqbOi0JBwMprsyYqMlcH4pc=; b=nOroOKpBl9O4ekKcL2q0HbNh62TYmE+GlUx/cLcWHj7GEFs8NiXnjkUFwKU3OwvqRt d+50uO8ZhxcIPwqxUVTqeocHvqdimzDyvjz5bFJ4fjfhVuC/yVKd6+q/ZeCKBZTbkPTl D0R+WLPdcqaqhtn5iqxdwg8YVp+nx932/HXKqB5oWYLSkUoNEjiAUzq2PmmEFAlq6Io/ d+dcAs5ovvpd/owUUCdUunIFpJVeLEIupDDE0+5Q8tg+42HHvyuHnCamhRdoZBWUKFaq uHYG/CKIC1GwDlUyElkrxUEb1mBIS9zapEy1i7MBHQBjUyfXOHHav6HzO/b/dvdQbsiA N8KQ== 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 u7si1759195edo.531.2020.10.15.04.16.00; Thu, 15 Oct 2020 04:16:22 -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 S2387667AbgJOIIK convert rfc822-to-8bit (ORCPT + 99 others); Thu, 15 Oct 2020 04:08:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:41092 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728048AbgJOIGB (ORCPT ); Thu, 15 Oct 2020 04:06:01 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 03440AF84; Thu, 15 Oct 2020 08:05:59 +0000 (UTC) Date: Thu, 15 Oct 2020 10:05:57 +0200 From: Thomas Zimmermann To: Xu Wang Cc: b.zolnierkie@samsung.com, jani.nikula@intel.com, daniel.vetter@ffwll.ch, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH] au1100fb: Remove NULL pointer check before clk_enable/disable Message-ID: <20201015100557.402f831f@linux-uq9g> In-Reply-To: <20201014082137.23320-1-vulab@iscas.ac.cn> References: <20201014082137.23320-1-vulab@iscas.ac.cn> Organization: SUSE Software Solutions Germany GmbH X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On Wed, 14 Oct 2020 08:21:37 +0000 Xu Wang wrote: > Because clk_enable, clk_disable, clk_prepare, and clk_unprepare already > checked NULL clock parameter, so the additional checks are unnecessary, > just remove them. All clk_*() functions seem to handle NULL pointers gracefully, so you can also remove these checks from the driver's _probe and _remove functions. Best regards Thomas > > Signed-off-by: Xu Wang > --- > drivers/video/fbdev/au1100fb.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c > index 37a6512feda0..3659dfbb81c1 100644 > --- a/drivers/video/fbdev/au1100fb.c > +++ b/drivers/video/fbdev/au1100fb.c > @@ -560,8 +560,7 @@ int au1100fb_drv_suspend(struct platform_device *dev, > pm_message_t state) /* Blank the LCD */ > au1100fb_fb_blank(VESA_POWERDOWN, &fbdev->info); > > - if (fbdev->lcdclk) > - clk_disable(fbdev->lcdclk); > + clk_disable(fbdev->lcdclk); > > memcpy(&fbregs, fbdev->regs, sizeof(struct au1100fb_regs)); > > @@ -577,8 +576,7 @@ int au1100fb_drv_resume(struct platform_device *dev) > > memcpy(fbdev->regs, &fbregs, sizeof(struct au1100fb_regs)); > > - if (fbdev->lcdclk) > - clk_enable(fbdev->lcdclk); > + clk_enable(fbdev->lcdclk); > > /* Unblank the LCD */ > au1100fb_fb_blank(VESA_NO_BLANKING, &fbdev->info); -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer