Dan Williams <[email protected]> writes:

> Static analysis reports that 'size_align' could be used uninitialized,
> so set the default at definition time.

Right.  I looked into this previously and decided it was a false
positive.  Still, I'm happy to see an obvious fix.  :)

Acked-by: Jeff Moyer <[email protected]>


>
> Signed-off-by: Dan Williams <[email protected]>
> ---
>  ndctl/namespace.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/ndctl/namespace.c b/ndctl/namespace.c
> index 895e39bb8c7d..4e39975d5b6a 100644
> --- a/ndctl/namespace.c
> +++ b/ndctl/namespace.c
> @@ -428,7 +428,7 @@ static int validate_namespace_options(struct ndctl_region 
> *region,
>               struct ndctl_namespace *ndns, struct parsed_parameters *p)
>  {
>       const char *region_name = ndctl_region_get_devname(region);
> -     unsigned long long size_align, units = 1;
> +     unsigned long long size_align = SZ_4K, units = 1;
>       unsigned int ways;
>       int rc = 0;
>  
> @@ -540,8 +540,6 @@ static int validate_namespace_options(struct ndctl_region 
> *region,
>               if (p->mode == NDCTL_NS_MODE_MEMORY
>                               || p->mode == NDCTL_NS_MODE_DAX)
>                       size_align = p->align;
> -             else
> -                     size_align = SZ_4K;
>       }
>  
>       /* (re-)validate that the size satisfies the alignment */
>
> _______________________________________________
> Linux-nvdimm mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/linux-nvdimm
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to