summaryrefslogtreecommitdiffstats
path: root/src/godmode.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-05-25 10:31:06 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-05-25 10:31:06 +0200
commit47d35cc0760c6279db5a382c602c35a496277d06 (patch)
tree408b1e072927a4c84a1c0a1a0702da8f7fac21c3 /src/godmode.c
parentf361dc27c90c74cdf57491c44691fc7e8a95ebf8 (diff)
Remove some dead code in search_part()
Diffstat (limited to 'src/godmode.c')
-rw-r--r--src/godmode.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/godmode.c b/src/godmode.c
index 8bfd62c..188dbc0 100644
--- a/src/godmode.c
+++ b/src/godmode.c
@@ -764,30 +764,12 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
{ /* Detect Linux md 0.9 software raid */
unsigned int disk_factor;
unsigned int help_factor;
-#if 0
- unsigned int help_factor_max;
-#endif
- const int align=2;
- CHS_t end;
- offset2CHS_inline(disk_car,partition->part_offset+partition->part_size-1,&end);
- if(align>0)
- {
- end.sector=disk_car->geom.sectors_per_head;
- if(align>1)
- end.head=disk_car->geom.heads_per_cylinder-1;
- }
-#if 0
- help_factor_max=((uint64_t)CHS2offset_inline(disk_car, &end)-partition->part_offset+disk_car->sector_size-partition->part_size)/MD_RESERVED_BYTES;
- if(help_factor_max<3)
- help_factor_max=3;
- help_factor_max+=MD_MAX_CHUNK_SIZE/MD_RESERVED_BYTES;
-#endif
for(disk_factor=6;disk_factor>=1 && ind_stop==0;disk_factor--)
{ /* disk_factor=1, detect Raid 0/1 */
/* disk_factor>1, detect Raid 5 */
for(help_factor=0;help_factor<=MD_MAX_CHUNK_SIZE/MD_RESERVED_BYTES+3 && ind_stop==0;help_factor++)
{
- uint64_t offset=(uint64_t)MD_NEW_SIZE_SECTORS((partition->part_size/disk_factor+help_factor*MD_RESERVED_BYTES-1)/MD_RESERVED_BYTES*MD_RESERVED_BYTES/512)*512;
+ const uint64_t offset=(uint64_t)MD_NEW_SIZE_SECTORS((partition->part_size/disk_factor+help_factor*MD_RESERVED_BYTES-1)/MD_RESERVED_BYTES*MD_RESERVED_BYTES/512)*512;
hint_insert(try_offset_raid, partition->part_offset+offset, &try_offset_raid_nbr);
}
}