summaryrefslogtreecommitdiff
path: root/src/glibext/gbinportion.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext/gbinportion.c')
-rw-r--r--src/glibext/gbinportion.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/glibext/gbinportion.c b/src/glibext/gbinportion.c
index 731cd08..c0e14fa 100644
--- a/src/glibext/gbinportion.c
+++ b/src/glibext/gbinportion.c
@@ -488,7 +488,7 @@ const mrange_t *g_binary_portion_get_range(const GBinPortion *portion)
/******************************************************************************
* *
* Paramètres : portion = description de partie à mettre à jour. *
-* max = première position physique hors limite. *
+* max = taille maximale accordée à la portion. *
* *
* Description : Assure qu'une portion ne dépasse pas une position donnée. *
* *
@@ -501,19 +501,14 @@ const mrange_t *g_binary_portion_get_range(const GBinPortion *portion)
bool g_binary_portion_limit_range(GBinPortion *portion, phys_t max)
{
bool result; /* Bilan à retourner */
- vmpa2t end; /* Limite actuelle de portion */
- const vmpa2t *start; /* Position de départ */
+ phys_t current; /* Taille courante */
- compute_mrange_end_addr(&portion->range, &end);
+ current = get_mrange_length(&portion->range);
- result = get_phy_addr(&end) > max;
+ result = (current > max);
if (result)
- {
- start = get_mrange_addr(&portion->range);
- set_mrange_length(&portion->range, max - get_phy_addr(start));
-
- }
+ set_mrange_length(&portion->range, max);
return result;