Cmnt: [eoan:linux-gcp][PATCH 1/2] UBUNTU: SAUCE: raid6: Add option for default PQ algorithm

Sultan Alsawaf sultan.alsawaf at
Wed Nov 6 21:47:34 UTC 2019

On Wed, Nov 06, 2019 at 03:57:38PM -0300, Marcelo Henrique Cerri wrote:
> +	if (strlen(raid6_pq_default_alg)) {

The strlen() can be replaced with raid6_pq_default_alg[0].

> +		for (algo = raid6_algos; *algo; algo++) {
> +			if (!strncmp(raid6_pq_default_alg, (*algo)->name, sizeof(raid6_pq_default_alg))) {

(*algo)->name is a statically initialized kernel string, which is terminated.
The module parameter string set function also ensures that raid6_pq_default_alg
will be terminated. You can safely use strcmp() here instead of strncmp().

> +				if ((*algo)->valid && !(*algo)->valid()) {
> +					pr_info("raid6: default alg \"%s\" is invalid.\n",
> +						raid6_pq_default_alg);
> +					continue;
> +				}

Why continue if the default algorithm is invalid?

> +				pr_info("raid6: using default algorithm %s gen() without performace tests.\n",
> +					(*algo)->name);

Misspelling: s/performace/performance/
Also, as per the kernel coding style guide, kernel messages do not need to be
terminated with a period.

Other than those nits, this seems fine.


More information about the kernel-team mailing list