diff mbox series

[4/5] dma: tegra: reduce channel name field size

Message ID 20181121161323.20226-5-ben.dooks@codethink.co.uk
State Deferred
Headers show
Series [1/5] dma: tegra: avoid overflow of byte tracking | expand

Commit Message

Ben Dooks Nov. 21, 2018, 4:13 p.m. UTC
The name field is used for "apbdma.%d" which is rarely going to be
more than 10 bytes, so reduce the size from 30 to 12. This is only
being used by the interrupt registration, so is not critical to the
operation of the driver either.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 drivers/dma/tegra20-apb-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jon Hunter Nov. 22, 2018, 9:26 a.m. UTC | #1
On Wed, Nov 21, 2018 at 4:15 PM Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>
> The name field is used for "apbdma.%d" which is rarely going to be
> more than 10 bytes, so reduce the size from 30 to 12. This is only
> being used by the interrupt registration, so is not critical to the
> operation of the driver either.

Do you mean 'never' above instead of 'rarely'? The max number of
channels is never more than 2 digits and so the change is fine with
me. So for the change ...

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon
Ben Dooks Nov. 22, 2018, 3:14 p.m. UTC | #2
On 22/11/2018 09:26, Jon Hunter wrote:
> On Wed, Nov 21, 2018 at 4:15 PM Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>>
>> The name field is used for "apbdma.%d" which is rarely going to be
>> more than 10 bytes, so reduce the size from 30 to 12. This is only
>> being used by the interrupt registration, so is not critical to the
>> operation of the driver either.
> 
> Do you mean 'never' above instead of 'rarely'? The max number of
> channels is never more than 2 digits and so the change is fine with
> me. So for the change ...

I've never seen a system with more than 64 channels in it, but it didn't
seem worth trying to get it below 12 anyway.
Jon Hunter Nov. 22, 2018, 3:24 p.m. UTC | #3
On 22/11/2018 15:14, Ben Dooks wrote:
> On 22/11/2018 09:26, Jon Hunter wrote:
>> On Wed, Nov 21, 2018 at 4:15 PM Ben Dooks <ben.dooks@codethink.co.uk>
>> wrote:
>>>
>>> The name field is used for "apbdma.%d" which is rarely going to be
>>> more than 10 bytes, so reduce the size from 30 to 12. This is only
>>> being used by the interrupt registration, so is not critical to the
>>> operation of the driver either.
>>
>> Do you mean 'never' above instead of 'rarely'? The max number of
>> channels is never more than 2 digits and so the change is fine with
>> me. So for the change ...
> 
> I've never seen a system with more than 64 channels in it, but it didn't
> seem worth trying to get it below 12 anyway.

I see. If you look at the 'nr_channels' definition for the various Tegra
devices that use this driver, there is nothing more than 32. So for this
driver the max is 32. Newer Tegra devices are not using this anymore and
so in the case of this specific driver we can say 'never' (although I
understand now you meant rarely in the general case).

Cheers Jon
diff mbox series

Patch

diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index ec8938a2ecab..c60c3f7cad5f 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -186,7 +186,7 @@  typedef void (*dma_isr_handler)(struct tegra_dma_channel *tdc,
 /* tegra_dma_channel: Channel specific information */
 struct tegra_dma_channel {
 	struct dma_chan		dma_chan;
-	char			name[30];
+	char			name[12];
 	bool			config_init;
 	int			id;
 	int			irq;