diff --git a/src/system/kernel/fs/vfs_boot.cpp b/src/system/kernel/fs/vfs_boot.cpp index 1082ddcb3f..6f10946eec 100644 --- a/src/system/kernel/fs/vfs_boot.cpp +++ b/src/system/kernel/fs/vfs_boot.cpp @@ -1,23 +1,15 @@ /* * Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de. - * Copyright 2002-2006, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2002-2007, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. * Distributed under the terms of the NewOS License. */ + #include "vfs_boot.h" - -#include - -#include -#include - -#include -#include -#include -#include +#include "vfs_net_boot.h" #include #include @@ -27,7 +19,15 @@ #include #include -#include "vfs_net_boot.h" +#include +#include +#include +#include + +#include +#include + +#include //#define TRACE_VFS @@ -56,7 +56,7 @@ static struct { dev_t gBootDevice = -1; -/** No image was chosen - prefer disks with names like "Haiku", or "System" +/*! No image was chosen - prefer disks with names like "Haiku", or "System" */ int compare_image_boot(const void *_a, const void *_b) @@ -89,10 +89,10 @@ compare_image_boot(const void *_a, const void *_b) } -/** The system was booted from CD - prefer CDs over other entries. If there - * is no CD, fall back to the standard mechanism (as implemented by - * compare_image_boot(). - */ +/*! The system was booted from CD - prefer CDs over other entries. If there + is no CD, fall back to the standard mechanism (as implemented by + compare_image_boot(). +*/ static int compare_cd_boot(const void *_a, const void *_b) { @@ -110,12 +110,12 @@ compare_cd_boot(const void *_a, const void *_b) } -/** Computes a check sum for the specified block. - * The check sum is the sum of all data in that block interpreted as an - * array of uint32 values. - * Note, this must use the same method as the one used in - * boot/platform/bios_ia32/devices.cpp (or similar solutions). - */ +/*! Computes a check sum for the specified block. + The check sum is the sum of all data in that block interpreted as an + array of uint32 values. + Note, this must use the same method as the one used in + boot/platform/bios_ia32/devices.cpp (or similar solutions). +*/ static uint32 compute_check_sum(KDiskDevice *device, off_t offset) { @@ -142,8 +142,9 @@ compute_check_sum(KDiskDevice *device, off_t offset) BootMethod::BootMethod(const KMessage& bootVolume, int32 method) - : fBootVolume(bootVolume), - fMethod(method) + : + fBootVolume(bootVolume), + fMethod(method) { } @@ -277,12 +278,12 @@ DiskBootMethod::SortPartitions(KPartition** partitions, int32 count) // #pragma mark - -/** Make the boot partition (and probably others) available. - * The partitions that are a boot candidate a put into the /a partitions - * stack. If the user selected a boot device, there is will only be one - * entry in this stack; if not, the most likely is put up first. - * The boot code should then just try them one by one. - */ +/*! Make the boot partition (and probably others) available. + The partitions that are a boot candidate a put into the /a partitions + stack. If the user selected a boot device, there is will only be one + entry in this stack; if not, the most likely is put up first. + The boot code should then just try them one by one. +*/ static status_t get_boot_partitions(kernel_args *args, PartitionStack &partitions) { @@ -355,7 +356,7 @@ dprintf("get_boot_partitions(): boot method type: %ld\n", bootMethodType); break; } - status_t status = bootMethod->Init(); + status_t status = bootMethod != NULL ? bootMethod->Init() : B_NO_MEMORY; if (status != B_OK) return status; @@ -364,7 +365,8 @@ dprintf("get_boot_partitions(): boot method type: %ld\n", bootMethodType); status = manager->InitialDeviceScan(); if (status != B_OK) { - dprintf("KDiskDeviceManager::InitialDeviceScan() failed: %s\n", strerror(status)); + dprintf("KDiskDeviceManager::InitialDeviceScan() failed: %s\n", + strerror(status)); return status; } diff --git a/src/system/kernel/fs/vfs_net_boot.cpp b/src/system/kernel/fs/vfs_net_boot.cpp index 57e59caf88..48fd8d6cb5 100644 --- a/src/system/kernel/fs/vfs_net_boot.cpp +++ b/src/system/kernel/fs/vfs_net_boot.cpp @@ -48,10 +48,10 @@ compare_partitions_net_devices(const void *_a, const void *_b) KPartition* a = *(KPartition**)_a; KPartition* b = *(KPartition**)_b; - bool aIsCD = is_net_device(a->Device()); - bool bIsCD = is_net_device(b->Device()); + bool aIsNetDevice = is_net_device(a->Device()); + bool bIsNetDevice = is_net_device(b->Device()); - int compare = (int)aIsCD - (int)bIsCD; + int compare = (int)aIsNetDevice - (int)bIsNetDevice; if (compare != 0) return compare;