From: Pavel Machek Date: Mon, 26 May 2008 18:40:47 +0000 (+0200) Subject: aperture_64.c: duplicated code, buggy? X-Git-Tag: v2.6.27-rc1~1106^2~251^10~8 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa5b8a30cf03520737e9a0ee2ee03a61b2eccf05;p=pandora-kernel.git aperture_64.c: duplicated code, buggy? Hi! void __init early_gart_iommu_check(void) contains for (num = 24; num < 32; num++) { if (!early_is_k8_nb(read_pci_config(0, num, 3, 0x00))) continue; loop, with very similar loop duplicated in void __init gart_iommu_hole_init(void) . First copy of a loop seems to be buggy, too. It uses 0 as a "nothing set" value, which may actually bite us in last_aper_enabled case (because it may be often zero). (Beware, it is hard to test this patch, because this code has about 2^8 different code paths, depending on hardware and cmdline settings). Plus, the second loop does not check for consistency of aper_enabled. Should it? Signed-off-by: Thomas Gleixner --- Reading git-diff-tree failed