lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 20 Nov 2014 23:55:54 -0800
From:	Joe Perches <joe@...ches.com>
To:	Hariprasad Shenai <hariprasad@...lsio.com>
Cc:	netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
	linux-scsi@...r.kernel.org, davem@...emloft.net,
	roland@...estorage.com, JBottomley@...allels.com,
	hch@...radead.org, swise@...ngridcomputing.com, leedom@...lsio.com,
	anish@...lsio.com, nirranjan@...lsio.com, kumaras@...lsio.com,
	praveen@...lsio.com, varun@...lsio.com
Subject: Re: [PATCH net-next 1/5] RDMA/cxgb4: Cleanup Filter related
 macros/register defines

On Fri, 2014-11-21 at 12:52 +0530, Hariprasad Shenai wrote:
> This patch cleanups all filter related macros/register defines that are defined
> in t4fw_api.h and the affected files.

Is there any real value in the FW_FILTER_WR_ prefix?
Does it need to be so long?

Perhaps it'd be nicer to read if
_S was _SHIFT
_M was _MASK
_V was whatever it's supposed to represent (_SET?)
and
_G was _GET

> +#define FW_FILTER_WR_TID_S      12
> +#define FW_FILTER_WR_TID_M      0xfffff
> +#define FW_FILTER_WR_TID_V(x)   ((x) << FW_FILTER_WR_TID_S)
> +#define FW_FILTER_WR_TID_G(x)   \
> +	(((x) >> FW_FILTER_WR_TID_S) & FW_FILTER_WR_TID_M)

Why aren't the _V defines masked then shifted?

#define FW_FILTER_WR_<foo>_V(x)				\
	(((x) & FW_FILTER_<foo>_M) << FW_FILTER_<foo>_S)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ