Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3579552imj; Tue, 12 Feb 2019 00:49:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IZPNH0b2WlzMwJDhinwqeUOqXqXzBzr91tM7bSbMmtXLBx5DjSEyp3nieFnnZX0IOg6lpxo X-Received: by 2002:a17:902:8a91:: with SMTP id p17mr2921720plo.316.1549961360463; Tue, 12 Feb 2019 00:49:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549961360; cv=none; d=google.com; s=arc-20160816; b=nDTtSQ6GxFDBc5IxGEb4BJqMyKc0jmg+suS4NVT1pHCu0gqtHwq97hFjTLO4+wLSBB Hqq5Ek0457bnOD/OL7d2wq1USLW3TYB5MpUS1TBgOM7ibp461l4z+OQkxFZATRJUbgK0 aF/qoseppwZ83GWFGOysQZS/TNgZ0tBsqBH3nwMBFG5DIbgRZu0jAuMDMs6mHVb0wNjJ M6uDjin/4gxxNa2h0lTPD7tAh9FErifawdwg3+9Vd0SyMpCDK0sUCoStl+gYCvBIx+ch nv2mxV8b+9D+FUPMNPxLeqYl4sY87yIyXOUSG1i4Vl5X2D9Cs0udUyMzxYAC7il9PWaj y9UA== 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; bh=5qK54jJq++Za7HFJQS0KYIBYZ7js4AtPaqsvK6PbzQA=; b=lBKqJNsXNv3OCtik0EbhGC0zQZK6zASQseoGs5o7f/UAwrr+nb5xCc562A+wGhz133 OPfkk7W1I/2YuEQByAHi5XfjoqZY0TmN3amhkYKoVdt0Ita+kym5Nma3vOGjKKV1HU87 LfsINyPZyhkS+xZ+Y4Pk5fQgR6LBw4sHeM62+SsMNW/nYrQKoW7+JBA2RbeY0iZj+qsg fqWs4Kkue63xwfZ8dHtyz1fEglxcbfFemkbiVzHkTLFcLaMA6ns+WuJ0w6J9vqzvsMIR PycqAeDHSGvhDtl3HoEoqN3TmA/sWe8G97xvXDuVy65hZMS5KsNicxgKCqOE9Ao+slK+ OEdw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t22si11319666pgv.190.2019.02.12.00.49.02; Tue, 12 Feb 2019 00:49:20 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728594AbfBLIsh (ORCPT + 99 others); Tue, 12 Feb 2019 03:48:37 -0500 Received: from mout.gmx.net ([212.227.15.15]:37213 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728410AbfBLIsh (ORCPT ); Tue, 12 Feb 2019 03:48:37 -0500 Received: from localhost.localdomain ([218.18.229.179]) by mail.gmx.com (mrgmx001 [212.227.17.184]) with ESMTPSA (Nemesis) id 0MTSKd-1gU11q46Yp-00SO7U; Tue, 12 Feb 2019 09:48:34 +0100 From: Chengguang Xu To: gregkh@linuxfoundation.org Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Chengguang Xu Subject: [PATCH 2/2] chardev: showing minor range for chardev in the output of /proc/devices Date: Tue, 12 Feb 2019 16:47:39 +0800 Message-Id: <20190212084739.27602-2-cgxu519@gmx.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190212084739.27602-1-cgxu519@gmx.com> References: <20190212084739.27602-1-cgxu519@gmx.com> MIME-Version: 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yukSKZXCNIAS4pv56fqsHPZE9bfey1fMAav/SBB5++m5PZoRupG+lrrU2n5MpwH 4KJKekni4zZT05eq7znWDUz4xV1uMfXGHRQXM0ZM0u6NnsBBw100DqvtfGgfXG3yGDZAEIo8q QWqCMF+AdDWV6eKCN/5WR44qlYOVDPRlw669cF0/9sWUKq9qSlj3irY+r7IqDy Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently chardev allows to share major, showing major with minor range for chardev will be more helpful. Signed-off-by: Chengguang Xu --- fs/char_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/char_dev.c b/fs/char_dev.c index b25b1da097d5..6f00acdeb308 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c @@ -55,7 +55,9 @@ void chrdev_show(struct seq_file *f, off_t offset) mutex_lock(&chrdevs_lock); for (cd = chrdevs[major_to_index(offset)]; cd; cd = cd->next) { if (cd->major == offset) - seq_printf(f, "%3d %s\n", cd->major, cd->name); + seq_printf(f, "%3d %s (%u-%u)\n", cd->major, cd->name, + cd->baseminor, + cd->baseminor + cd->minorct - 1); } mutex_unlock(&chrdevs_lock); } -- 2.20.1