From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759449AbcBTVgM (ORCPT ); Sat, 20 Feb 2016 16:36:12 -0500 Received: from mail-ig0-f169.google.com ([209.85.213.169]:37963 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752145AbcBTVgK (ORCPT ); Sat, 20 Feb 2016 16:36:10 -0500 MIME-Version: 1.0 In-Reply-To: <1455892568-22586-2-git-send-email-linus.walleij@linaro.org> References: <1455892568-22586-1-git-send-email-linus.walleij@linaro.org> <1455892568-22586-2-git-send-email-linus.walleij@linaro.org> Date: Sat, 20 Feb 2016 13:36:09 -0800 X-Google-Sender-Auth: qN2o_4drJmov_ez1TiHfJkDtxX0 Message-ID: Subject: Re: [PATCH 2/2] RFC: chrdev: allocate chardevs in all unused holes From: Linus Torvalds To: Linus Walleij Cc: Linux Kernel Mailing List , Greg Kroah-Hartman , Alan Cox , Arnd Bergmann Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 19, 2016 at 6:36 AM, Linus Walleij wrote: > This is a duct-tape-and-chewing-gum solution to the problem with > the major numbers running out when allocating major numbers > dynamically. Ugh. This is too ugly to live. Can't you do something with a simple bitmap, and just pre-allocate the fixed numbers? Allocate new major numbers using find_next_zero_bit() or something.. I can't imagine that we couldn't do something prettier in less code than that too-disgusting-to-live free_majors[] array.. Linus