Skip to content

Commit

Permalink
gpt: kill dead store
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Feb 18, 2025
1 parent e9350e6 commit 0835805
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/gpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ static void *
const_map_gpt(const device *d, size_t *mapsize, int *fd, size_t lbasize){
const int pgsize = getpagesize();
const unsigned gptlbas = 1 + (MINIMUM_GPT_ENTRIES * sizeof(struct gpt_entry) / lbasize);
uint64_t off;
void *map;

if(pgsize < 0){
Expand All @@ -351,7 +350,7 @@ const_map_gpt(const device *d, size_t *mapsize, int *fd, size_t lbasize){
}
// The first copy goes into LBA 1. Calculate offset into map due to
// lbasize possibly (probably) not equalling the page size.
if((off = lbasize % pgsize) == 0){
if(lbasize % pgsize == 0){
*mapsize = 0;
}else{
*mapsize = lbasize;
Expand Down
6 changes: 3 additions & 3 deletions src/ptypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,17 +381,17 @@ const ptype ptypes[] = {

// Pass in the common code, get the scheme-specific identifier filled in.
// Returns 0 for a valid code, or -1 if there's no ident for the scheme.
int get_gpt_guid(unsigned code,void *guid){
int get_gpt_guid(unsigned code, void *guid){
const ptype *pt;

for(pt = ptypes ; pt->name ; ++pt){
if(pt->code == code){
static const uint8_t zguid[GUIDSIZE] = {0};

if(memcmp(pt->gpt_guid,zguid,sizeof(zguid)) == 0){
if(memcmp(pt->gpt_guid, zguid, sizeof(zguid)) == 0){
return -1;
}
memcpy(guid,pt->gpt_guid,GUIDSIZE);
memcpy(guid, pt->gpt_guid, GUIDSIZE);
return 0;
}
}
Expand Down

0 comments on commit 0835805

Please sign in to comment.