Skip to content

Commit

Permalink
Merge pull request #4721 from ldoolitt/main
Browse files Browse the repository at this point in the history
kernel/drivertools.h: avoid maybe-uninitialized compile warnings
  • Loading branch information
povik authored Nov 27, 2024
2 parents 956313e + 3ae9ca7 commit 1717a0b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions kernel/drivertools.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ struct DriveBit

unsigned int hash() const
{
unsigned int inner;
unsigned int inner = 0;
switch (type_)
{
case DriveType::NONE:
Expand All @@ -385,6 +385,9 @@ struct DriveBit
case DriveType::MULTIPLE:
inner = multiple_.hash();
break;
default:
log_abort();
break;
}
return mkhash((unsigned int)type_, inner);
}
Expand Down Expand Up @@ -912,7 +915,7 @@ struct DriveChunk

unsigned int hash() const
{
unsigned int inner;
unsigned int inner = 0;
switch (type_)
{
case DriveType::NONE:
Expand All @@ -933,6 +936,9 @@ struct DriveChunk
case DriveType::MULTIPLE:
inner = multiple_.hash();
break;
default:
log_abort();
break;
}
return mkhash((unsigned int)type_, inner);
}
Expand Down

0 comments on commit 1717a0b

Please sign in to comment.