> +struct btrfs_data_container *init_data_container(s32 total_bytes)
> +{
> +     struct btrfs_data_container *data;
> +     unsigned long alloc_bytes;
> +
> +     if (total_bytes < 0)
> +             return ERR_PTR(-EINVAL);
> +
> +     alloc_bytes = max((unsigned long)total_bytes, sizeof(*data));

The return type of sizeof() is unsigned int, so this will cause compile
warning.

We can use max_t() instead.

> +     data = kmalloc(alloc_bytes, GFP_NOFS);
> +     if (!data)
> +             return ERR_PTR(-ENOMEM);
> +
> +     data->size = total_bytes - sizeof(*data);
> +     data->elem_cnt = 0;
> +     data->elem_missed = 0;
> +
> +     return data;
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to