mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-03 13:20:28 -05:00
Beautification with unscrustify
This commit is contained in:
parent
1166d9dcea
commit
3e62e22411
5 changed files with 9 additions and 9 deletions
|
|
@ -1129,7 +1129,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna
|
||||||
++failed_count;
|
++failed_count;
|
||||||
|
|
||||||
log_tag("%s:%u:%s:%s: Open error at position %u. %s.\n", es(errno), i, disk->name, esc_tag(file->sub, esc_buffer), file_pos, strerror(errno));
|
log_tag("%s:%u:%s:%s: Open error at position %u. %s.\n", es(errno), i, disk->name, esc_tag(file->sub, esc_buffer), file_pos, strerror(errno));
|
||||||
|
|
||||||
if (errno == EIO) {
|
if (errno == EIO) {
|
||||||
++io_error;
|
++io_error;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2120,7 +2120,7 @@ int state_check(struct snapraid_state* state, int fix, block_off_t blockstart, b
|
||||||
if (errno == EIO) {
|
if (errno == EIO) {
|
||||||
log_fatal_errno(errno, lev_config_name(l));
|
log_fatal_errno(errno, lev_config_name(l));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* continue anyway */
|
/* continue anyway */
|
||||||
parity_ptr[l] = 0;
|
parity_ptr[l] = 0;
|
||||||
|
|
|
||||||
|
|
@ -461,7 +461,7 @@ static double smart_afr(uint64_t* smart, const char* model)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the probability of at least one failure occurring
|
* Calculates the probability of at least one failure occurring
|
||||||
* within a year using a Poisson distribution.
|
* within a year using a Poisson distribution.
|
||||||
*
|
*
|
||||||
* @param afr The aggregate Annual Failure Rate (lambda).
|
* @param afr The aggregate Annual Failure Rate (lambda).
|
||||||
|
|
|
||||||
|
|
@ -454,7 +454,7 @@ int randomize(void* ptr, size_t size);
|
||||||
/**
|
/**
|
||||||
* Unified Wear Level Metric (0-100)
|
* Unified Wear Level Metric (0-100)
|
||||||
*
|
*
|
||||||
* Represents the remaining life of an SSD.
|
* Represents the remaining life of an SSD.
|
||||||
* - 0: Brand new drive (0% wear).
|
* - 0: Brand new drive (0% wear).
|
||||||
* - 100: Drive has reached or exceeded its manufacturer-rated design life.
|
* - 100: Drive has reached or exceeded its manufacturer-rated design life.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1812,8 +1812,8 @@ int smartctl_attribute(FILE* f, const char* file, const char* name, uint64_t* sm
|
||||||
|
|
||||||
smart[id] = raw;
|
smart[id] = raw;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Map normalized health percentage to our unified wear level for SSDs
|
* Map normalized health percentage to our unified wear level for SSDs
|
||||||
* 177: Wear_Leveling_Count (Samsung/Crucial)
|
* 177: Wear_Leveling_Count (Samsung/Crucial)
|
||||||
* 231: SSD_Life_Left (Kingston/WD)
|
* 231: SSD_Life_Left (Kingston/WD)
|
||||||
* 233: Media_Wearout_Indicator (Intel)
|
* 233: Media_Wearout_Indicator (Intel)
|
||||||
|
|
|
||||||
|
|
@ -607,11 +607,11 @@ static int devuuid_darwin(const char* path, char* uuid, size_t uuid_size)
|
||||||
*uuid = 0;
|
*uuid = 0;
|
||||||
|
|
||||||
path_apple = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8);
|
path_apple = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8);
|
||||||
if (!path_apple)
|
if (!path_apple)
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|
||||||
session = DASessionCreate(kCFAllocatorDefault);
|
session = DASessionCreate(kCFAllocatorDefault);
|
||||||
if (!session)
|
if (!session)
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|
||||||
path_appler = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path_apple, kCFURLPOSIXPathStyle, false);
|
path_appler = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path_apple, kCFURLPOSIXPathStyle, false);
|
||||||
|
|
@ -645,7 +645,7 @@ static int devuuid_darwin(const char* path, char* uuid, size_t uuid_size)
|
||||||
if (description) {
|
if (description) {
|
||||||
/* key might not exist for NTFS/ExFAT on some drivers */
|
/* key might not exist for NTFS/ExFAT on some drivers */
|
||||||
const void* value = (CFUUIDRef)CFDictionaryGetValue(description, kDADiskDescriptionVolumeUUIDKey);
|
const void* value = (CFUUIDRef)CFDictionaryGetValue(description, kDADiskDescriptionVolumeUUIDKey);
|
||||||
CFStringRef uuid_string = NULL;
|
CFStringRef uuid_string = NULL;
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
if (CFGetTypeID(value) == CFUUIDGetTypeID()) {
|
if (CFGetTypeID(value) == CFUUIDGetTypeID()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue