Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1042877ybf; Thu, 27 Feb 2020 04:05:34 -0800 (PST) X-Google-Smtp-Source: APXvYqzjMQ7k3QmUwQmg7JuwYPxr5iV2nRdeco+2Mty+Ul1PzclAy1NJN83SX1hBuLXDTXF22PBQ X-Received: by 2002:aca:62c4:: with SMTP id w187mr3055254oib.38.1582805134604; Thu, 27 Feb 2020 04:05:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582805134; cv=none; d=google.com; s=arc-20160816; b=eFESJPvgQ8xcKYGrYWdDnE9ttqnQA3YMcamGOz81a4PYGy1eRnSyfaK+oHurmuMxrx Fsi+OUv1QwD6ShTIOMGGwuu8pvJQNaUsC+64Rvhxfg7WM3siuSh/WR/j0HnB48cZ5J23 koiLEmWgFvywGhkurKs6nRme7MZG/5SuejSzQzgzFqFiUak+t1NdJZD211/SOH9gKJRL nSvRO4AkkCqRtgR9LV2v7qQ+kqtbbMxtEHG6fJopjGzMogWmQMfHUIhF8ksvggpdpKEr K2xySoD4A52I0kISOWmAqgVCR2XG6gIrGi37cpB6ZSLXrVFEdMeLxb8WVQgNs6RyVMEV XVYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eMyHRnupYOweRXusdsPzOOaYHKBaQWgPr4VgAjx/YvA=; b=qwLjIgxl6EjHSGqamlNzqvYAIMP/yKdn9z0TI6V/gIHukc5luosT88WIqeGVxWl+WM BWo0V6hLORFG6AmfeDRo+iHibxHkSqVdgs4+tRtxoU6z5/sDqzfGQnmRBi2zb2lyRPQl bHC76BSVaGLyMERT65Pu9sItO9GrWh/0fZSPh9JvJSgI6IC8KOTV0yrdziBUQNDHccTE u7H2NzL1XNBoAFmGK6XtcO6zInneMg+RLSUDg2s07gNRlclhBM9kNZwGsMfZERsUlv/Z 6pevo3FeurH64KJYWSqxS2deutIBMHpCH46Cia21cDnf4PK/w3rtKLXalqMs0sNlSbfN 7+LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=J26Ir02K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v25si1354111ote.90.2020.02.27.04.05.22; Thu, 27 Feb 2020 04:05:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=J26Ir02K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729134AbgB0MDZ (ORCPT + 99 others); Thu, 27 Feb 2020 07:03:25 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:37104 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728882AbgB0MDY (ORCPT ); Thu, 27 Feb 2020 07:03:24 -0500 Received: by mail-wm1-f67.google.com with SMTP id a141so3107575wme.2; Thu, 27 Feb 2020 04:03:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eMyHRnupYOweRXusdsPzOOaYHKBaQWgPr4VgAjx/YvA=; b=J26Ir02KepKBJUbXxXkkWJYVkP5vOgClZy+ask2wsbUGCXhEGHhsdjjBMp4pQeyL4v o+PockS+TMBNAj3bDRcefvZcTiGRv//s7LP6xY6F+VIkrxqhEpnYaMhZkScQ6ysjJ1kp Vp3lVS1t6hzYlLN9T4BABFFkiDQUghrhefzvXox7WxnQSf4ze69i0XCqKtlcRumUAyoS cxm0yHZKo9AnodukiroeL7uqp0p26ZtcPOC45KXNVKrfM5QZYTdTeqhPS3kn/oS4bWRg 4AVKdsxNrNwlrkr8WIVIGkAi4/xGyozaKVgg9yaksEXPuNddWbur6TmFwvaUNFEe7IDF 7mKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eMyHRnupYOweRXusdsPzOOaYHKBaQWgPr4VgAjx/YvA=; b=Ip9gxyF69JSayFpDHBluuErv7lkoK9np1wxfJLqL91vPMHB/yEPOKljma878bwBQAq HIhxHy8W3nKCVi5SIyuZBGnLnxl7/G8Ew/N6g6hXKeKSEkjOscveKlQMqAAbHTembMlV NISWnQpkKBQ2UnhaF+qgwtxFJJ7HBTRv2ctVcK89Yf6bIHaV5LHb4ezOv8IHOYjjyxkN +G0GRZhZqZpYTLSW93HQvkpBLLCHTVShL5kkZv3LEO+TERGMNZQRD/9mGGA51ZJV7Svl grMs7hlBQLIjpSD4bJhnjZICyBznqdziXyKYR3axx8OXC3d8tazAv7R00GtROyq3rCvC wZXQ== X-Gm-Message-State: APjAAAWMB/Xp0Q88usKqlo0OP64R3TIRlF67jKhLEoEOFGGHDpDpTNhN QwKySUBhVfgG8Wn/oGfGrAw= X-Received: by 2002:a1c:108:: with SMTP id 8mr4988938wmb.30.1582805002941; Thu, 27 Feb 2020 04:03:22 -0800 (PST) Received: from wambui.zuku.co.ke ([197.237.61.225]) by smtp.googlemail.com with ESMTPSA id t10sm7655017wru.59.2020.02.27.04.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 04:03:22 -0800 (PST) From: Wambui Karuga To: daniel@ffwll.ch, airlied@linux.ie, Thierry Reding , Jonathan Hunter Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org Subject: [PATCH 10/21] drm/tegra: remove checks for debugfs functions return value Date: Thu, 27 Feb 2020 15:02:21 +0300 Message-Id: <20200227120232.19413-11-wambui.karugax@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200227120232.19413-1-wambui.karugax@gmail.com> References: <20200227120232.19413-1-wambui.karugax@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since 987d65d01356 (drm: debugfs: make drm_debugfs_create_files() never fail) there is no need to check the return value of drm_debugfs_create_files(). Therefore, remove the return checks and error handling of the drm_debugfs_create_files() function from various debugfs init functions in drm/tegra and have them return 0 directly. This change also includes removing the use of drm_debugfs_create_files as a return value in tegra_debugfs_init() and have the function declared as void. Signed-off-by: Wambui Karuga --- drivers/gpu/drm/tegra/dc.c | 11 +---------- drivers/gpu/drm/tegra/drm.c | 8 ++++---- drivers/gpu/drm/tegra/dsi.c | 11 +---------- drivers/gpu/drm/tegra/hdmi.c | 11 +---------- drivers/gpu/drm/tegra/sor.c | 11 +---------- 5 files changed, 8 insertions(+), 44 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 7c70fd31a4c2..e70d58b21964 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1496,7 +1496,6 @@ static int tegra_dc_late_register(struct drm_crtc *crtc) struct drm_minor *minor = crtc->dev->primary; struct dentry *root; struct tegra_dc *dc = to_tegra_dc(crtc); - int err; #ifdef CONFIG_DEBUG_FS root = crtc->debugfs_entry; @@ -1512,17 +1511,9 @@ static int tegra_dc_late_register(struct drm_crtc *crtc) for (i = 0; i < count; i++) dc->debugfs_files[i].data = dc; - err = drm_debugfs_create_files(dc->debugfs_files, count, root, minor); - if (err < 0) - goto free; + drm_debugfs_create_files(dc->debugfs_files, count, root, minor); return 0; - -free: - kfree(dc->debugfs_files); - dc->debugfs_files = NULL; - - return err; } static void tegra_dc_early_unregister(struct drm_crtc *crtc) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index bd268028fb3d..d4f51b5c7ee5 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -839,11 +839,11 @@ static struct drm_info_list tegra_debugfs_list[] = { { "iova", tegra_debugfs_iova, 0 }, }; -static int tegra_debugfs_init(struct drm_minor *minor) +static void tegra_debugfs_init(struct drm_minor *minor) { - return drm_debugfs_create_files(tegra_debugfs_list, - ARRAY_SIZE(tegra_debugfs_list), - minor->debugfs_root, minor); + drm_debugfs_create_files(tegra_debugfs_list, + ARRAY_SIZE(tegra_debugfs_list), + minor->debugfs_root, minor); } #endif diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index 88b9d64c77bf..30626fcf61eb 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -234,7 +234,6 @@ static int tegra_dsi_late_register(struct drm_connector *connector) struct drm_minor *minor = connector->dev->primary; struct dentry *root = connector->debugfs_entry; struct tegra_dsi *dsi = to_dsi(output); - int err; dsi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files), GFP_KERNEL); @@ -244,17 +243,9 @@ static int tegra_dsi_late_register(struct drm_connector *connector) for (i = 0; i < count; i++) dsi->debugfs_files[i].data = dsi; - err = drm_debugfs_create_files(dsi->debugfs_files, count, root, minor); - if (err < 0) - goto free; + drm_debugfs_create_files(dsi->debugfs_files, count, root, minor); return 0; - -free: - kfree(dsi->debugfs_files); - dsi->debugfs_files = NULL; - - return err; } static void tegra_dsi_early_unregister(struct drm_connector *connector) diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 6f117628f257..d7799d13d8ad 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -1064,7 +1064,6 @@ static int tegra_hdmi_late_register(struct drm_connector *connector) struct drm_minor *minor = connector->dev->primary; struct dentry *root = connector->debugfs_entry; struct tegra_hdmi *hdmi = to_hdmi(output); - int err; hdmi->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files), GFP_KERNEL); @@ -1074,17 +1073,9 @@ static int tegra_hdmi_late_register(struct drm_connector *connector) for (i = 0; i < count; i++) hdmi->debugfs_files[i].data = hdmi; - err = drm_debugfs_create_files(hdmi->debugfs_files, count, root, minor); - if (err < 0) - goto free; + drm_debugfs_create_files(hdmi->debugfs_files, count, root, minor); return 0; - -free: - kfree(hdmi->debugfs_files); - hdmi->debugfs_files = NULL; - - return err; } static void tegra_hdmi_early_unregister(struct drm_connector *connector) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 81226a4953c1..47c1d133069a 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -1687,7 +1687,6 @@ static int tegra_sor_late_register(struct drm_connector *connector) struct drm_minor *minor = connector->dev->primary; struct dentry *root = connector->debugfs_entry; struct tegra_sor *sor = to_sor(output); - int err; sor->debugfs_files = kmemdup(debugfs_files, sizeof(debugfs_files), GFP_KERNEL); @@ -1697,17 +1696,9 @@ static int tegra_sor_late_register(struct drm_connector *connector) for (i = 0; i < count; i++) sor->debugfs_files[i].data = sor; - err = drm_debugfs_create_files(sor->debugfs_files, count, root, minor); - if (err < 0) - goto free; + drm_debugfs_create_files(sor->debugfs_files, count, root, minor); return 0; - -free: - kfree(sor->debugfs_files); - sor->debugfs_files = NULL; - - return err; } static void tegra_sor_early_unregister(struct drm_connector *connector) -- 2.25.0