Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6665826pxv; Thu, 29 Jul 2021 22:20:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrakvSyvL0S0AKWw+8n5WhPvA11RZBfLRiccMP+mRZJJvSwApk59vxAYUzGYVTR9NPY6Cq X-Received: by 2002:a6b:6016:: with SMTP id r22mr982437iog.12.1627622422086; Thu, 29 Jul 2021 22:20:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627622422; cv=none; d=google.com; s=arc-20160816; b=K0irkEtKMjAelk5kSxWpSyqvHJoxSfg9jfRypu7JwQSTxduQUO1517zH0Vryw4b3cc OTQxsWUSjysr0NqIBhwpveOW2o8DOBZ3S0CILBEpED5jrim0y5eqPh1QbbGd3Ro02Xfv TpzNa2c6E1mo2ju6+DMY8VKVSNh6wUT+qj874NtGnw82e5rEdksz2ejaK4kURm6sIXqN wu9HP2Jy4qO5v1exIFCXMjW0MmmjWanAkUrld3Qil24WBOSruBcFdcjXDgoNWxaxQjQJ VSyn+LwW8r0VGQsioJFG3kNzw/fqExRm3A66qlcJaUJ6pAHk8Wt7/mAZ+oaVG4PSYhw8 5i6A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=2Ab74AhJwzRIRCGKgVVDL+7Qsvq0Oe+eaDr5ToQWIrM=; b=p/H4+w9uoFNJkAB83dpNHFvg+kJ0GKDQ7ettA774/eGYBhFjWEmBwsLP9AlWIxMkZ4 lKGWpFTmdgr/xZ8GFa6+y1iu3yRAqpSA/J4G04kT9RHA3EJvMnphTQ9tq1u4uWUCFzNC fFChDP0ySZYAohT8gnxPnMlO9DFbFkUi10cR3A/nxQX00TqfVE/G6rE8FlvMhDzzuFfP KnDcoZ9GRKHyjnTNBt3yq0lKoQzmK9RZlyixktoaxGnJeczJkFmPf31bSWVyDslw7TEH fA8EawPdQ9ICm4jRY6IKSYel7DIrdqF5ssBkiT18Gg9puIckHpEjWg5gwnVtz9JlvYmM wZrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H+H2wlj1; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si631208ioh.47.2021.07.29.22.20.10; Thu, 29 Jul 2021 22:20: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H+H2wlj1; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229696AbhG3FSa (ORCPT + 99 others); Fri, 30 Jul 2021 01:18:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236642AbhG3FS3 (ORCPT ); Fri, 30 Jul 2021 01:18:29 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D06D6C0613D3 for ; Thu, 29 Jul 2021 22:18:24 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id a20so9762424plm.0 for ; Thu, 29 Jul 2021 22:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2Ab74AhJwzRIRCGKgVVDL+7Qsvq0Oe+eaDr5ToQWIrM=; b=H+H2wlj1EE0u8J1jTx+Ex7m4hUnl2baCHpp7Ad6LGMkcRw+7rwr6QGwxb0Zw9Z/+YZ DC6ul5wmzHs0mM3UfV3S41rlBtNoNOYF/ElpLjwU7Rwtcok8UhOXdNYqfuAN5Wm5foQU zF8jYbWZRDaJDt48rN5h8JAOE7qOchc2sKPvVpNQF4u2PJtoqzcJvwuylbikxxxBgDQM DhgJ740i061uzWWiqbaXQObrbX06D5xNBY9/Sz4hPeIVW354g1t2U/AAyHVRLupwrkRW gnjYSQU4fDBBflA0HkHlqTrdcD0dbsOqIeBXch7dFTd5zikxgKHkU98oAFvL9/OINjFE By6Q== 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:mime-version :content-transfer-encoding; bh=2Ab74AhJwzRIRCGKgVVDL+7Qsvq0Oe+eaDr5ToQWIrM=; b=Jx6F7WzfLk0PYOlQSoeh338FphM3Aw9sQjjTcZsNqtqsVnZ2ZfQDq538rKueDmZk0+ P+mIUhyL2quuewzgZYvyLA8snNMhUeN68CSv+jJ+KiO6CS3L2oVuZgUFFjOy3ddE6kDI yTAYwnTbLy9oTafB3kwe0uHtWXqQVn5NWCJxo+8awotUud/73zNi666KzgAvWkZ/+u6e JER1zWDLcWbN5pI4TmmWZrevEkIHaazBjA+JJeDi/4GgJB3cqUcNCZ+cOignFsmdkira G3t4maxqECW1hVm47t7NUXZOBZ3Ftw7TKMAA4fZjdO1PVytXIOabrwQB4LwF2wF3kL/+ nltQ== X-Gm-Message-State: AOAM532Tm8jVmwQXhHfIhwPmaoht4hw09upxaw0B7dGM0wEXBmPwYdFe WZvobh9/K5H8ikFM+GTp5+c= X-Received: by 2002:a17:903:244d:b029:12c:3c0:f21d with SMTP id l13-20020a170903244db029012c03c0f21dmr882043pls.65.1627622304272; Thu, 29 Jul 2021 22:18:24 -0700 (PDT) Received: from localhost.localdomain ([118.200.190.93]) by smtp.gmail.com with ESMTPSA id c4sm655444pfo.45.2021.07.29.22.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 22:18:23 -0700 (PDT) From: Desmond Cheong Zhi Xi To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch Cc: Desmond Cheong Zhi Xi , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm: clean up unused kerneldoc in drm_lease.c Date: Fri, 30 Jul 2021 13:17:59 +0800 Message-Id: <20210730051759.1570630-1-desmondcheongzx@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The kerneldoc in drm_lease.c is unused because none of the functions are driver interfaces as the symbols are not exported. Since they aren't used and much of the existing comments don't provide any insights (e.g. they just repeat the function name or list out the function parameters), they should be removed to make them easier to maintain and to make useful info more obvious. As a note, many of the comments mention whether idr_mutex should be held, but these are mostly redundant in cases where the function contains lockdep assertions or grabs the mutex. To simplify review, here's the reasoning behind each update. drm_lease_owner: function name is self-descriptive _drm_find_lessee: function name is self-descriptive _drm_lease_held_master: function name and signature are self-descriptive _drm_has_leased: kerneldoc is summarized into a comment because the function name could be interpreted ambiguously (check if the object has been leased VS check if the master has a lease on the object) _drm_lease_held: Retain the idr_mutex comment because the function does not directly grab the mutex or use a lockdep assertion. Otherwise, the function name is self-descriptive. drm_lease_held: function name is self-descriptive drm_lease_filter_crtcs: Kerneldoc is summarized into a comment because the function name could be interpreted ambiguously (filter leases based on crtcs mask VS filter crtcs mask based on leases) drm_lease_create: Kerneldoc removed. Useful function details such as atomic leasing are retained. Errno interpretations are useful and retained. drm_lease_destroy: function name is self-descriptive. Additional information is also removed as they're already present as comments inside the function. _drm_lease_revoke: function name is self-descriptive drm_lease_revoke: function name is self-descriptive drm_mode_create_lease_ioctl: Kerneldoc removed, but useful function details retained. drm_mode_list_lessees_ioctl: function name is self-descriptive. Additional details restate what the code does. drm_mode_get_lease_ioctl: Function summary retained to clarify that it's the leased objects that are returned, not the lease structure. drm_mode_revoke_lease_ioctl: Kerneldoc removed, but useful function details retained. Signed-off-by: Desmond Cheong Zhi Xi --- drivers/gpu/drm/drm_lease.c | 131 +++--------------------------------- 1 file changed, 8 insertions(+), 123 deletions(-) diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index 79be797e8689..dee4f24a1808 100644 --- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -71,14 +71,6 @@ static uint64_t drm_lease_idr_object; -/** - * drm_lease_owner - return ancestor owner drm_master - * @master: drm_master somewhere within tree of lessees and lessors - * - * RETURN: - * - * drm_master at the top of the tree (i.e, with lessor NULL - */ struct drm_master *drm_lease_owner(struct drm_master *master) { while (master->lessor != NULL) @@ -86,16 +78,6 @@ struct drm_master *drm_lease_owner(struct drm_master *master) return master; } -/** - * _drm_find_lessee - find lessee by id (idr_mutex held) - * @master: drm_master of lessor - * @lessee_id: id - * - * RETURN: - * - * drm_master of the lessee if valid, NULL otherwise - */ - static struct drm_master* _drm_find_lessee(struct drm_master *master, int lessee_id) { @@ -103,17 +85,6 @@ _drm_find_lessee(struct drm_master *master, int lessee_id) return idr_find(&drm_lease_owner(master)->lessee_idr, lessee_id); } -/** - * _drm_lease_held_master - check to see if an object is leased (or owned) by master (idr_mutex held) - * @master: the master to check the lease status of - * @id: the id to check - * - * Checks if the specified master holds a lease on the object. Return - * value: - * - * true 'master' holds a lease on (or owns) the object - * false 'master' does not hold a lease. - */ static int _drm_lease_held_master(struct drm_master *master, int id) { lockdep_assert_held(&master->dev->mode_config.idr_mutex); @@ -122,17 +93,7 @@ static int _drm_lease_held_master(struct drm_master *master, int id) return true; } -/** - * _drm_has_leased - check to see if an object has been leased (idr_mutex held) - * @master: the master to check the lease status of - * @id: the id to check - * - * Checks if any lessee of 'master' holds a lease on 'id'. Return - * value: - * - * true Some lessee holds a lease on the object. - * false No lessee has a lease on the object. - */ +/* Checks if the given object has been leased to some lessee of drm_master */ static bool _drm_has_leased(struct drm_master *master, int id) { struct drm_master *lessee; @@ -144,17 +105,7 @@ static bool _drm_has_leased(struct drm_master *master, int id) return false; } -/** - * _drm_lease_held - check drm_mode_object lease status (idr_mutex held) - * @file_priv: the master drm_file - * @id: the object id - * - * Checks if the specified master holds a lease on the object. Return - * value: - * - * true 'master' holds a lease on (or owns) the object - * false 'master' does not hold a lease. - */ +/* Called with idr_mutex held */ bool _drm_lease_held(struct drm_file *file_priv, int id) { bool ret; @@ -172,17 +123,6 @@ bool _drm_lease_held(struct drm_file *file_priv, int id) return ret; } -/** - * drm_lease_held - check drm_mode_object lease status (idr_mutex not held) - * @file_priv: the master drm_file - * @id: the object id - * - * Checks if the specified master holds a lease on the object. Return - * value: - * - * true 'master' holds a lease on (or owns) the object - * false 'master' does not hold a lease. - */ bool drm_lease_held(struct drm_file *file_priv, int id) { struct drm_master *master; @@ -207,13 +147,9 @@ bool drm_lease_held(struct drm_file *file_priv, int id) return ret; } -/** - * drm_lease_filter_crtcs - restricted crtc set to leased values (idr_mutex not held) - * @file_priv: requestor file - * @crtcs_in: bitmask of crtcs to check - * - * Reconstructs a crtc mask based on the crtcs which are visible - * through the specified file. +/* + * Given a bitmask of crtcs to check, reconstructs a crtc mask based on the + * crtcs which are visible through the specified file. */ uint32_t drm_lease_filter_crtcs(struct drm_file *file_priv, uint32_t crtcs_in) { @@ -258,10 +194,6 @@ uint32_t drm_lease_filter_crtcs(struct drm_file *file_priv, uint32_t crtcs_in) } /* - * drm_lease_create - create a new drm_master with leased objects (idr_mutex not held) - * @lessor: lease holder (or owner) of objects - * @leases: objects to lease to the new drm_master - * * Uses drm_master_create to allocate a new drm_master, then checks to * make sure all of the desired objects can be leased, atomically * leasing them to the new drmmaster. @@ -330,15 +262,6 @@ static struct drm_master *drm_lease_create(struct drm_master *lessor, struct idr return ERR_PTR(error); } -/** - * drm_lease_destroy - a master is going away (idr_mutex not held) - * @master: the drm_master being destroyed - * - * All lessees will have been destroyed as they - * hold a reference on their lessor. Notify any - * lessor for this master so that it can check - * the list of lessees. - */ void drm_lease_destroy(struct drm_master *master) { struct drm_device *dev = master->dev; @@ -372,10 +295,6 @@ void drm_lease_destroy(struct drm_master *master) DRM_DEBUG_LEASE("drm_lease_destroy done %d\n", master->lessee_id); } -/** - * _drm_lease_revoke - revoke access to all leased objects (idr_mutex held) - * @top: the master losing its lease - */ static void _drm_lease_revoke(struct drm_master *top) { int object; @@ -414,10 +333,6 @@ static void _drm_lease_revoke(struct drm_master *top) } } -/** - * drm_lease_revoke - revoke access to all leased objects (idr_mutex not held) - * @top: the master losing its lease - */ void drm_lease_revoke(struct drm_master *top) { mutex_lock(&top->dev->mode_config.idr_mutex); @@ -549,12 +464,7 @@ static int fill_object_idr(struct drm_device *dev, return ret; } -/** - * drm_mode_create_lease_ioctl - create a new lease - * @dev: the drm device - * @data: pointer to struct drm_mode_create_lease - * @lessor_priv: the file being manipulated - * +/* * The master associated with the specified file will have a lease * created containing the objects specified in the ioctl structure. * A file descriptor will be allocated for that and returned to the @@ -676,18 +586,6 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, return ret; } -/** - * drm_mode_list_lessees_ioctl - list lessee ids - * @dev: the drm device - * @data: pointer to struct drm_mode_list_lessees - * @lessor_priv: the file being manipulated - * - * Starting from the master associated with the specified file, - * the master with the provided lessee_id is found, and then - * an array of lessee ids associated with leases from that master - * are returned. - */ - int drm_mode_list_lessees_ioctl(struct drm_device *dev, void *data, struct drm_file *lessor_priv) { @@ -734,15 +632,7 @@ int drm_mode_list_lessees_ioctl(struct drm_device *dev, return ret; } -/** - * drm_mode_get_lease_ioctl - list leased objects - * @dev: the drm device - * @data: pointer to struct drm_mode_get_lease - * @lessee_priv: the file being manipulated - * - * Return the list of leased objects for the specified lessee - */ - +/* Return the list of leased objects for the specified lessee */ int drm_mode_get_lease_ioctl(struct drm_device *dev, void *data, struct drm_file *lessee_priv) { @@ -796,12 +686,7 @@ int drm_mode_get_lease_ioctl(struct drm_device *dev, return ret; } -/** - * drm_mode_revoke_lease_ioctl - revoke lease - * @dev: the drm device - * @data: pointer to struct drm_mode_revoke_lease - * @lessor_priv: the file being manipulated - * +/* * This removes all of the objects from the lease without * actually getting rid of the lease itself; that way all * references to it still work correctly -- 2.25.1