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]
Message-ID: <20181008211053.71171cff@bbrezillon>
Date:   Mon, 8 Oct 2018 21:10:53 +0200
From:   Boris Brezillon <boris.brezillon@...tlin.com>
To:     Yogesh Gaur <yogeshnarayan.gaur@....com>
Cc:     linux-mtd@...ts.infradead.org, marek.vasut@...il.com,
        linux-spi@...r.kernel.org, devicetree@...r.kernel.org,
        robh@...nel.org, mark.rutland@....com, shawnguo@...nel.org,
        linux-arm-kernel@...ts.infradead.org, computersforpeace@...il.com,
        frieder.schrempf@...eet.de, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/5] spi: spi-mem: Add driver for NXP FlexSPI
 controller

On Mon,  8 Oct 2018 16:41:39 +0530
Yogesh Gaur <yogeshnarayan.gaur@....com> wrote:

> +/* Registers used by the driver */
> +#define FSPI_MCR0			0x00
> +#define FSPI_MCR0_AHB_TIMEOUT_MASK	GENMASK(31, 24)
> +#define FSPI_MCR0_IP_TIMEOUT_MASK	GENMASK(23, 16)

You never mask the IP_TIMEOUT val, so you don't need a _MASK macro
here. Just define

#define FSPI_MCR0_IP_TIMEOUT(x)		((x) < 16)

The same goes for any field that you don't need to mask.

The only case you might need a mask def is when you have the following
pattern:

	val = readl(reg);
	val &= ~XXXX_MASK;
	val |= XXXX(new_field_val);
	writel(val, reg);

> +#define FSPI_MCR0_LEARN_EN_MASK		BIT(15)
> +#define FSPI_MCR0_SCRFRUN_EN_MASK	BIT(14)
> +#define FSPI_MCR0_OCTCOMB_EN_MASK	BIT(13)

Drop the _MASK suffix for any single-bit field:

#define FSPI_MCR0_OCTCOMB_EN		BIT(13)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ