[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0dcf9712a49968da1935061de130bc3668e63088.camel@perches.com>
Date: Tue, 28 Apr 2020 21:31:10 -0700
From: Joe Perches <joe@...ches.com>
To: Rylan Dmello <mail@...an.coffee>,
Manish Chopra <manishc@...vell.com>,
GR-Linux-NIC-Dev@...vell.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
netdev@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] staging: qlge: Remove multi-line dereferences from
qlge_main.c
On Wed, 2020-04-29 at 00:04 -0400, Rylan Dmello wrote:
> Fix checkpatch.pl warnings:
>
> WARNING: Avoid multiple line dereference - prefer 'qdev->func'
> WARNING: Avoid multiple line dereference - prefer 'qdev->flags'
Assuming you are doing this for exercise:
It'd be better to unindent all the switch/case
blocks for the entire function so more functions
fit on single lines
switch (foo) {
case bar:
{
...;
should be:
switch (foo) {
case bar: {
...;
goto exit; might as well be break; and remove
the exit label too.
> Signed-off-by: Rylan Dmello <mail@...an.coffee>
> ---
> drivers/staging/qlge/qlge_main.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
> index d7e4dfafc1a3..10daae025790 100644
> --- a/drivers/staging/qlge/qlge_main.c
> +++ b/drivers/staging/qlge/qlge_main.c
> @@ -396,8 +396,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
> * the route field to NIC core.
> */
> cam_output = (CAM_OUT_ROUTE_NIC |
> - (qdev->
> - func << CAM_OUT_FUNC_SHIFT) |
> + (qdev->func << CAM_OUT_FUNC_SHIFT) |
> (0 << CAM_OUT_CQ_ID_SHIFT));
> if (qdev->ndev->features & NETIF_F_HW_VLAN_CTAG_RX)
> cam_output |= CAM_OUT_RV;
> @@ -3432,9 +3431,9 @@ static int ql_request_irq(struct ql_adapter *qdev)
> &qdev->rx_ring[0]);
> status =
> request_irq(pdev->irq, qlge_isr,
> - test_bit(QL_MSI_ENABLED,
> - &qdev->
> - flags) ? 0 : IRQF_SHARED,
> + test_bit(QL_MSI_ENABLED, &qdev->flags)
> + ? 0
> + : IRQF_SHARED,
> intr_context->name, &qdev->rx_ring[0]);
> if (status)
> goto err_irq;
Powered by blists - more mailing lists