[PATCH v2 01/10] iommu/arm-smmu-v3: Do not zero the strtab twice
Daniel Mentz
danielmentz at google.com
Tue Jun 11 16:52:57 PDT 2024
On Mon, Jun 10, 2024 at 5:31 PM Jason Gunthorpe <jgg at nvidia.com> wrote:
> + cfg->l1_desc = devm_kcalloc(smmu->dev, cfg->num_l1_ents,
> + sizeof(*cfg->l1_desc), GFP_KERNEL);
> + if (!cfg->l1_desc) {
> + dev_err(smmu->dev,
> + "failed to allocate l1 stream table (%zu bytes)\n",
> + cfg->num_l1_ents * sizeof(*cfg->l1_desc));
The error message "failed to allocate l1 stream table (%zu bytes)\n"
is identical to the one a few lines above that's printed if
dmam_alloc_coherent fails. This might make it difficult to determine
the origin of this message if someone sees it in a log file. Also,
it's not technically an SMMUv3 l1 stream table but rather some
internal data structure.
I thought there was a guideline around not printing error messages on
certain allocation failures because there'll be a generic OOM message
that'll get printed. Also, this driver never prints an error message
when devm_kcalloc or devm_kzalloc fails, only on dmam_alloc_coherent
failures.
Just nitpicking here. Looks good to me, otherwise.
More information about the linux-arm-kernel
mailing list