[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] LVM2 include/.symlinks.in lib/Makefile.in lib/ ...



Dne 30.11.2010 12:53, mornfall sourceware org napsal(a):
> CVSROOT:	/cvs/lvm2
> Module name:	LVM2
> Changes by:	mornfall sourceware org	2010-11-30 11:53:33
> 
>  
>  		if (segtype->ops->target_percent &&
>  		    !segtype->ops->target_percent(&dm->target_state,
> -						  &percent_range, dm->mem,
> +						  &percent, dm->mem,
>  						  dm->cmd, seg, params,
>  						  &total_numerator,
>  						  &total_denominator))
>  			goto_out;
>  
>  		if (first_time) {
> -			combined_percent_range = percent_range;
> +			*overall_percent = percent;
>  			first_time = 0;

When we are friends with analyzers now ;) -
if (segtype->ops->target_percent == NULL)
is not defined of fails -  'percent' will contain some garbage.

I assume something like this would help?

-	percent_t percent;
+	percent_t percent = PERCENT_INVALID;


Other thing is - how the _combine_percent() is supposed to work in this case?

Maybe you want to goto_out if segtype->ops->target_percent == NULL) as
programming error ?

Zdenek


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]