From: David Miller <davem@davemloft.net>
To: ron.mercer@qlogic.com
Cc: netdev@vger.kernel.org
Subject: Re: [net-next PATCH 1/8] qlge: Add data for firmware dump.
Date: Mon, 11 Jan 2010 22:20:09 -0800 (PST) [thread overview]
Message-ID: <20100111.222009.30973638.davem@davemloft.net> (raw)
In-Reply-To: <1263258785-5112-2-git-send-email-ron.mercer@qlogic.com>
From: Ron Mercer <ron.mercer@qlogic.com>
Date: Mon, 11 Jan 2010 17:12:58 -0800
> Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
> ---
> drivers/net/qlge/qlge.h | 285 ++++++++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 284 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
> index ee0e2bd..0094263 100644
> --- a/drivers/net/qlge/qlge.h
> +++ b/drivers/net/qlge/qlge.h
> @@ -75,6 +75,16 @@
> #define TX_DESC_PER_OAL 0
> #endif
>
> +/* Word shifting for converting 64-bit
> + * address to a series of 16-bit words.
> + * This is used for some MPI firmware
> + * mailbox commands.
> + */
> +#define LSW(x) ((u16)(x))
> +#define MSW(x) ((u16)((u32)(x) >> 16))
> +#define LSD(x) ((u32)((u64)(x)))
> +#define MSD(x) ((u32)((((u64)(x)) >> 16) >> 16))
And using plain:
((u32)(((u64)x) >> 32))
doesn't work for MSD() because? Shifting right by 16 bits
twice is pointless, and even more importantly confusing.
> +#define MAC_PROTOCOL_REGISTER_WORDS ((512 * 3) + (32 * 2) + (4096 * 1) + \
> +(4096 * 1) + (4 * 2) + (8 * 2) + (16 * 1) + (4 * 1) + (4 * 4) + (4 * 1))
This is poorly formatted and full of magic constants with absolutely
no explanation.
> +/* Save both the address and data register */
> +#define WORDS_PER_MAC_PROT_ENTRY 2
> +#define MAX_SEMAPHORE_FUNCTIONS 5
> +#define WQC_WORD_SIZE 6
> +#define NUMBER_OF_WQCS 128
> +#define CQC_WORD_SIZE 13
> +#define NUMBER_OF_CQCS 128
Poor formatting.
> +#define MPI_READ 0x00000000
> +#define REG_BLOCK 0x00020000
> +#define TEST_LOGIC_FUNC_PORT_CONFIG 0x1002
> +#define NIC1_FUNCTION_ENABLE 0x00000001
> +#define NIC1_FUNCTION_MASK 0x0000000e
> +#define NIC1_FUNCTION_SHIFT 1
> +#define NIC2_FUNCTION_ENABLE 0x00000010
> +#define NIC2_FUNCTION_MASK 0x000000e0
> +#define NIC2_FUNCTION_SHIFT 5
> +#define FC1_FUNCTION_ENABLE 0x00000100
> +#define FC1_FUNCTION_MASK 0x00000e00
> +#define FC1_FUNCTION_SHIFT 9
> +#define FC2_FUNCTION_ENABLE 0x00001000
> +#define FC2_FUNCTION_MASK 0x0000e000
> +#define FC2_FUNCTION_SHIFT 13
> +#define FUNCTION_SHIFT 6
More poor formatting, use tabs to line up the define values
so that it's easier to read by humans (and therefore easier
to spot bugs).
Same goes for the rest of the defines added by this patch.
I'm not even going to look at the rest of this patch series,
please fix up these fundamental code formatting issues,
check for them in the rest of your changes, and resubmit
the whole series.
Thanks.
next prev parent reply other threads:[~2010-01-12 6:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-12 1:12 [net-next PATCH 0/8] qlge: Add firmware coredump functionality Ron Mercer
2010-01-12 1:12 ` [net-next PATCH 1/8] qlge: Add data for firmware dump Ron Mercer
2010-01-12 6:20 ` David Miller [this message]
2010-01-12 1:12 ` [net-next PATCH 2/8] qlge: Add basic " Ron Mercer
2010-01-12 1:13 ` [net-next PATCH 3/8] qlge: Add probe regs to " Ron Mercer
2010-01-12 1:13 ` [net-next PATCH 4/8] qlge: Add RAM dump " Ron Mercer
2010-01-12 1:13 ` [net-next PATCH 5/8] qlge: Add alternate function's reg dump to fw dump Ron Mercer
2010-01-12 1:13 ` [net-next PATCH 6/8] qlge: Add serdes reg dump to firmware dump Ron Mercer
2010-01-12 1:13 ` [net-next PATCH 7/8] qlge: Add xgmac regs to firwmare dump Ron Mercer
2010-01-12 1:13 ` [net-next PATCH 8/8] qlge: Add option to force firmware core dump Ron Mercer
2010-01-12 6:22 ` [net-next PATCH 0/8] qlge: Add firmware coredump functionality David Miller
-- strict thread matches above, loose matches on Subject: below --
2010-01-15 23:31 Ron Mercer
2010-01-15 23:31 ` [net-next PATCH 1/8] qlge: Add data for firmware dump Ron Mercer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100111.222009.30973638.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=ron.mercer@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).