From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tobias Klauser Date: Mon, 06 Jun 2005 16:24:01 +0000 Subject: Re: [PATCH RFC] Merge udev_scan_block() and udev_scan_class() in udevstart.c Message-Id: <20050606162401.GA777@access.unizh.ch> List-Id: References: <20050605130015.GA4640@access.unizh.ch> In-Reply-To: <20050605130015.GA4640@access.unizh.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On 2005-06-06 at 00:01:18 +0200, Kay Sievers wrote: > On Sun, Jun 05, 2005 at 03:00:16PM +0200, Tobias Klauser wrote: > > udev_scan_block() and udev_scan_class() in udevstart.c have a lot of > > redundant code and therefor I was thinking about a way to merge them. > > My patch might not be the most elegant solution but it reduces the code > > about 40 lines (see diffstat). > > You will not get any class device with that patch! This prevents going > down into the directories where the "dev" files are, it works only > for block devices, cause they find a "dev" at the parent, but > class-directories are empty here: > > if (has_devt(dirname)) > device_list_insert(dirname, type, &device_list); > else > continue; > > Please test more carefully before changing that bootup-critical parts of > udev. The test directory contains a udevstart-test for that reason. Sorry, that was stupid... > There is a reason for these functions to be separate, but if you still think > that this is worth to do, you may check the dirent type: > DTYPE(de) = DT_DIR > instead of "dev" file lookups at every entry, which happens more often after > merging these too functions. > Anyway, I'm not convinced, that these functions are not better kept separate. OK, if there's a reason for them to be separate I just didn't know it while looking at the code. Again, sorry for the noise. Tobias ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel