[LTP] [PATCH] syscalls/mallopt: Does not work correctly?

Cyril Hrubis chrubis@suse.cz
Thu Oct 22 15:16:00 CEST 2015


Hi!
I've wrote commit description for the change, add your signed-of-by,
did small changes (see below) and pushed, thanks.

> -	free(buf);
> +	if (mallopt(M_MXFAST, MAX_FAST_SIZE) == 0)
> +		tst_resm(TFAIL, "mallopt(M_MXFAST, %d) failed", MAX_FAST_SIZE);
> +	else
> +		tst_resm(TPASS, "mallopt(M_MXFAST, %d) succeeded", MAX_FAST_SIZE);

I've added cast to (int) for the MAX_FAST_SIZE constant here to supress
warnings.


> +	if ((buf = malloc(1024)) == NULL)
> +		tst_resm(TFAIL, "malloc(1024) failed");
> +	else {
> +		tst_resm(TPASS, "malloc(1024) succeeded");
> +		free(buf);
> +	}

LKML coding style preffers curly braces around both blocks if they are
needed around one of them. So I've added them before I pushed the patch.

FYI, you can use checkpatch.pl (distributed with Linux kernel sources)
to check patches before submission.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the Ltp mailing list