From patchwork Tue May 13 12:58:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 4167431 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1396A9F467 for ; Tue, 13 May 2014 12:58:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 25DCA20364 for ; Tue, 13 May 2014 12:58:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7EF920176 for ; Tue, 13 May 2014 12:58:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754161AbaEMM6Z (ORCPT ); Tue, 13 May 2014 08:58:25 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:37567 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759892AbaEMM6Y (ORCPT ); Tue, 13 May 2014 08:58:24 -0400 Received: from dude.hi.pengutronix.de ([10.1.0.7] helo=dude.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WkCHg-0001tO-Mz; Tue, 13 May 2014 14:58:16 +0200 From: Lucas Stach To: linux-fbdev@vger.kernel.org Cc: Tomi Valkeinen , kernel@pengutronix.de Subject: [PATCH] video: of: display_timing: remove two unsafe error messages Date: Tue, 13 May 2014 14:58:21 +0200 Message-Id: <1399985901-30756-1-git-send-email-l.stach@pengutronix.de> X-Mailer: git-send-email 2.0.0.rc0 X-SA-Exim-Connect-IP: 10.1.0.7 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-fbdev@vger.kernel.org Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The error message would try to dereference the pointer that just has been tested to be NULL. As those messages don't really add any value without the info that the np could provide, just remove them. Signed-off-by: Lucas Stach --- drivers/video/of_display_timing.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index ba5b40f581f6..3dc93cfacd47 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c @@ -115,10 +115,8 @@ int of_get_display_timing(struct device_node *np, const char *name, { struct device_node *timing_np; - if (!np) { - pr_err("%s: no devicenode given\n", of_node_full_name(np)); + if (!np) return -EINVAL; - } timing_np = of_get_child_by_name(np, name); if (!timing_np) { @@ -142,10 +140,8 @@ struct display_timings *of_get_display_timings(struct device_node *np) struct device_node *native_mode; struct display_timings *disp; - if (!np) { - pr_err("%s: no device node given\n", of_node_full_name(np)); + if (!np) return NULL; - } timings_np = of_get_child_by_name(np, "display-timings"); if (!timings_np) {