Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1042025ybf; Thu, 27 Feb 2020 04:04:54 -0800 (PST) X-Google-Smtp-Source: APXvYqz5LEpBVtcxFnSfHycfhlTw/6RrQZMuFJ3HrqWV6jm4gtECBHfwYgTXyePIfmQUifgR2gjg X-Received: by 2002:aca:2112:: with SMTP id 18mr2850573oiz.155.1582805094139; Thu, 27 Feb 2020 04:04:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582805094; cv=none; d=google.com; s=arc-20160816; b=B1XxGkfrRRb74wZBi0rHrfpbl4lBd3t9Sj0nIRxzeDzQZ9gecD7ackyPnf5mF+rbm5 fRKB9GYC8AkbS8L6oFyOoRepa3GKWOVFLYsJAreBVLryQ5r+veQ1A+S5Vo2R2UvtDPZE 2vouh+CfxEXzmQWbdWmrNLStGApmyCcNcSmxoYWBjaN84hHNMPcl6tRSvEdB2n1Z04zX rtvd3Kcr2uhRMq4+iavgInMuaNcIaQSgodpz0uppDk/589/nIB+aEHttxHgITwUyGYw2 axH61hlP0d+j7TdfZLbxyHlKQAK49p/LSvGYnjKA6vdY9bbonGtDbT77/ic5DyZYb0aw +gRQ== 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=2+KWhSsNubWek+s087bQ51ysemcEcbIre0xKjY3xCvk=; b=lu4H+LO+t3D9AJcVOa4DNNzWaJgT1kaYpEehYZrT06OMUfIym1Xz/914jmmfEaTg/V IG8KSYxUulVDm7sGpSZuKWw36nkoDx5zIhIRH6zNlMetKLsAf621+yBjgPXpPhd6nliP kJMvgEv6RmL1sUp8KYjACP8o0/+FyG5m/DbJu6hqD3uJdiKgZxsGdngtl6RPLn/Bt6+J bLA812bYuDW5aH8HSLINVcIpCmbwsH1kCvxyUUxtqGslFPgLofRmAFbd1CSV/ft25O5A 3DeXq/EoFOoTZSya9Gr0xopNQTwy8PPpY77dnqmCl/sId3bg3fV9TBY0J/UKZcuazMNO AYHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YAZcESBc; 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 y73si1278163oia.246.2020.02.27.04.04.42; Thu, 27 Feb 2020 04:04:54 -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=YAZcESBc; 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 S1729270AbgB0MEC (ORCPT + 99 others); Thu, 27 Feb 2020 07:04:02 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40217 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729264AbgB0MEB (ORCPT ); Thu, 27 Feb 2020 07:04:01 -0500 Received: by mail-wm1-f67.google.com with SMTP id t14so3089998wmi.5 for ; Thu, 27 Feb 2020 04:03:59 -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=2+KWhSsNubWek+s087bQ51ysemcEcbIre0xKjY3xCvk=; b=YAZcESBcaRtP75t+snUpVawMs7r/LA1nbZUdnL2VIerOC1w737obl8VFdfneZhFyr0 R4B26u9NH0H9Xl8cgeFuWHsQlTyFI1XPz9CBFWHW1h6zkq1ZOIIwuBpyX5YTGBlkmXv0 iMERA3ryPFf4mKdbu90j3uNmXLLqDmYEwgrhrji+tjkM5HHWyo71/MVGmj/MP6FCQLw5 5gi9l9+wFeJTr0/E1FJ/TcVXvisgtqdM01QSnsga9l42kvJv97qWcqCSBx4dFTi01DN0 zHuG8+XwUPf8OwTC5wHUikg43DDWSHZxQETRa6+imlIlCcZmKjxMTNoMn4/M7lO7MsbE zsNg== 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=2+KWhSsNubWek+s087bQ51ysemcEcbIre0xKjY3xCvk=; b=CMNLQcya0GAnAgnhJ41ZM+7g79l97JsMf+RUeD0/kd+2lws69vpxh1fowWagvBLv2A Ejq5EOnAMK444aSDIP30KcjciHE3cH5v++qjCLat2LRGsI6r/FN0AVXUNdJj+BGaN7z7 r1mVMeqGPvAxdJvCaRGIcLGTOB4NAKa3QBu6ieeOSM1gXTloJjwx0LaScgober+JphFv lWbwpS/h4nT85AU+4h3xifXqeN9ikpIbzqUgfTc+qO9sYp0GJXz6IiqxRUi0dLBVc3jG ZW8Bm/+hLyH3zH4zm9+xlM3Huu6El+pqhcBQ+8zAY5TcY4YN2cxDpOqksiWARX9NCfG5 M0NA== X-Gm-Message-State: APjAAAX0EtsFRSlkPXpBpY7TzAvRWLfiiYy1d090i1G1FCmLPwT1ptTf lvvqJb0Br2VTyeYQxa3N+98= X-Received: by 2002:a1c:108:: with SMTP id 8mr4992146wmb.30.1582805039094; Thu, 27 Feb 2020 04:03:59 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 04:03:58 -0800 (PST) From: Wambui Karuga To: daniel@ffwll.ch, airlied@linux.ie, Gerd Hoffmann Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org Subject: [PATCH 20/21] drm/qxl: have debugfs functions return void. Date: Thu, 27 Feb 2020 15:02:31 +0300 Message-Id: <20200227120232.19413-21-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 Due to the conversion of the .debugfs_init() hook to return void (drm: convert the .debugfs_init() hook to return void), there is no need for the return value of qxl_debugfs_init(). Therefore, refactor the function to return void. This change also includes the conversion of various functions that can be converted to return void as a result of the changes to qxl_debugfs_init(). Signed-off-by: Wambui Karuga --- drivers/gpu/drm/qxl/qxl_debugfs.c | 21 +++++++-------------- drivers/gpu/drm/qxl/qxl_drv.h | 13 +++++-------- drivers/gpu/drm/qxl/qxl_ttm.c | 6 ++---- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_debugfs.c b/drivers/gpu/drm/qxl/qxl_debugfs.c index a4f4175bbdbe..88123047fdd4 100644 --- a/drivers/gpu/drm/qxl/qxl_debugfs.c +++ b/drivers/gpu/drm/qxl/qxl_debugfs.c @@ -79,36 +79,30 @@ static struct drm_info_list qxl_debugfs_list[] = { #define QXL_DEBUGFS_ENTRIES ARRAY_SIZE(qxl_debugfs_list) #endif -int +void qxl_debugfs_init(struct drm_minor *minor) { #if defined(CONFIG_DEBUG_FS) - int r; struct qxl_device *dev = (struct qxl_device *) minor->dev->dev_private; drm_debugfs_create_files(qxl_debugfs_list, QXL_DEBUGFS_ENTRIES, minor->debugfs_root, minor); - r = qxl_ttm_debugfs_init(dev); - if (r) { - DRM_ERROR("Failed to init TTM debugfs\n"); - return r; - } + qxl_ttm_debugfs_init(dev); #endif - return 0; } -int qxl_debugfs_add_files(struct qxl_device *qdev, - struct drm_info_list *files, - unsigned int nfiles) +void qxl_debugfs_add_files(struct qxl_device *qdev, + struct drm_info_list *files, + unsigned int nfiles) { unsigned int i; for (i = 0; i < qdev->debugfs_count; i++) { if (qdev->debugfs[i].files == files) { /* Already registered */ - return 0; + return; } } @@ -116,7 +110,7 @@ int qxl_debugfs_add_files(struct qxl_device *qdev, if (i > QXL_DEBUGFS_MAX_COMPONENTS) { DRM_ERROR("Reached maximum number of debugfs components.\n"); DRM_ERROR("Report so we increase QXL_DEBUGFS_MAX_COMPONENTS.\n"); - return -EINVAL; + return; } qdev->debugfs[qdev->debugfs_count].files = files; qdev->debugfs[qdev->debugfs_count].num_files = nfiles; @@ -126,5 +120,4 @@ int qxl_debugfs_add_files(struct qxl_device *qdev, qdev->ddev.primary->debugfs_root, qdev->ddev.primary); #endif - return 0; } diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index 27e45a2d6b52..435126facc9b 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.h +++ b/drivers/gpu/drm/qxl/qxl_drv.h @@ -190,9 +190,6 @@ struct qxl_debugfs { unsigned int num_files; }; -int qxl_debugfs_add_files(struct qxl_device *rdev, - struct drm_info_list *files, - unsigned int nfiles); int qxl_debugfs_fence_init(struct qxl_device *rdev); struct qxl_device; @@ -442,8 +439,8 @@ int qxl_garbage_collect(struct qxl_device *qdev); /* debugfs */ -int qxl_debugfs_init(struct drm_minor *minor); -int qxl_ttm_debugfs_init(struct qxl_device *qdev); +void qxl_debugfs_init(struct drm_minor *minor); +void qxl_ttm_debugfs_init(struct qxl_device *qdev); /* qxl_prime.c */ int qxl_gem_prime_pin(struct drm_gem_object *obj); @@ -461,9 +458,9 @@ int qxl_gem_prime_mmap(struct drm_gem_object *obj, int qxl_irq_init(struct qxl_device *qdev); irqreturn_t qxl_irq_handler(int irq, void *arg); -int qxl_debugfs_add_files(struct qxl_device *qdev, - struct drm_info_list *files, - unsigned int nfiles); +void qxl_debugfs_add_files(struct qxl_device *qdev, + struct drm_info_list *files, + unsigned int nfiles); int qxl_surface_id_alloc(struct qxl_device *qdev, struct qxl_bo *surf); diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index 62a5e424971b..93a2eb14844b 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/gpu/drm/qxl/qxl_ttm.c @@ -322,7 +322,7 @@ static int qxl_mm_dump_table(struct seq_file *m, void *data) } #endif -int qxl_ttm_debugfs_init(struct qxl_device *qdev) +void qxl_ttm_debugfs_init(struct qxl_device *qdev) { #if defined(CONFIG_DEBUG_FS) static struct drm_info_list qxl_mem_types_list[QXL_DEBUGFS_MEM_TYPES]; @@ -343,8 +343,6 @@ int qxl_ttm_debugfs_init(struct qxl_device *qdev) qxl_mem_types_list[i].data = qdev->mman.bdev.man[TTM_PL_PRIV].priv; } - return qxl_debugfs_add_files(qdev, qxl_mem_types_list, i); -#else - return 0; + qxl_debugfs_add_files(qdev, qxl_mem_types_list, i); #endif } -- 2.25.0