[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YYh+ldT5wU2s0sWY@rocinante>
Date: Mon, 8 Nov 2021 02:34:13 +0100
From: Krzysztof WilczyĆski <kw@...ux.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: nsaenz@...nel.org, jim2101024@...il.com, f.fainelli@...il.com,
bcm-kernel-feedback-list@...adcom.com, lorenzo.pieralisi@....com,
robh@...nel.org, bhelgaas@...gle.com,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] PCI: brcmstb: Declare a bitmap as a bitmap, not as a
plain 'unsigned long'
Hi Christophe!
[...]
> This bitmap can be BRCM_INT_PCI_MSI_LEGACY_NR or BRCM_INT_PCI_MSI_NR long.
Ahh. OK. Given this an option would be to: do nothing (keep current
status quo); allocate memory dynamically passing the "msi->nr" after it
has been set accordingly; use BRCM_INT_PCI_MSI_NR and waste a little bit
of space.
Perhaps moving to using the DECLARE_BITMAP() would be fine in this case
too, at least to match style of other drivers more closely.
Jim, Florian and Lorenzo - is this something that would be OK with you,
or you would rather keep things as they were?
> Addresses-Coverity: "Out-of-bounds access (ARRAY_VS_SINGLETON)"
This tag would have to be written as:
Addresses-Coverity: ("Out-of-bounds access (ARRAY_VS_SINGLETON)")
[...]
> + DECLARE_BITMAP (used, BRCM_INT_PCI_MSI_NR);
Probably not the most elegant solution, but I would keep it as:
DECLARE_BITMAP(used, BRCM_INT_PCI_MSI_NR);
Otherwise aligning either before or after the open bracket will cause
either an error or a warning issued by checkpatch.pl accordingly about
the style. Other users of this (a vast majoirty) macro don't do any
specific alignment at large
[...]
> + /*
> + * Sanity check to make sure that the 'used' bitmap in struct brcm_msi
> + * is large enough.
> + */
> + BUILD_BUG_ON(BRCM_INT_PCI_MSI_LEGACY_NR > BRCM_INT_PCI_MSI_NR);
A healthy paranoia, I see. :-)
Krzysztof
Powered by blists - more mailing lists