Message ID | 20201001195247.66636-8-saeed@kernel.org |
---|---|
State | Changes Requested |
Delegated to: | David Miller |
Headers | show |
Series | [net,V2,01/15] net/mlx5: Don't allow health work when device is uninitialized | expand |
On Thu, 1 Oct 2020 12:52:39 -0700 saeed@kernel.org wrote: > - for (; i >= 0; i--) { > + for (--i; i >= 0; i--) { while (i--)
On Thu, 2020-10-01 at 16:24 -0700, Jakub Kicinski wrote: > On Thu, 1 Oct 2020 12:52:39 -0700 saeed@kernel.org wrote: > > - for (; i >= 0; i--) { > > + for (--i; i >= 0; i--) { > > while (i--) while(--i) I like this, less characters to maintain :)
On 10/2/2020 10:05, Saeed Mahameed wrote: > On Thu, 2020-10-01 at 16:24 -0700, Jakub Kicinski wrote: >> On Thu, 1 Oct 2020 12:52:39 -0700 saeed@kernel.org wrote: >>> - for (; i >= 0; i--) { >>> + for (--i; i >= 0; i--) { >> >> while (i--) > > while(--i) It has to be: while (i--) Case of i=0, > > I like this, less characters to maintain :) > Mark
On Fri, 2020-10-02 at 10:19 -0700, Mark Bloch wrote: > > On 10/2/2020 10:05, Saeed Mahameed wrote: > > On Thu, 2020-10-01 at 16:24 -0700, Jakub Kicinski wrote: > > > On Thu, 1 Oct 2020 12:52:39 -0700 saeed@kernel.org wrote: > > > > - for (; i >= 0; i--) { > > > > + for (--i; i >= 0; i--) { > > > > > > while (i--) > > > > while(--i) > > It has to be: while (i--) > Case of i=0, > woops ! while (i--) it is. Thanks Mark.
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c index 373981a659c7..ef26a0a6f890 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c @@ -115,7 +115,7 @@ static int request_irqs(struct mlx5_core_dev *dev, int nvec) return 0; err_request_irq: - for (; i >= 0; i--) { + for (--i; i >= 0; i--) { struct mlx5_irq *irq = mlx5_irq_get(dev, i); int irqn = pci_irq_vector(dev->pdev, i);