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: <ADE657CA350FB648AAC2C43247A983F0021DA656FEA0@AUSP01VMBX24.collaborationhost.net>
Date:	Fri, 24 May 2013 12:16:40 -0500
From:	H Hartley Sweeten <hartleys@...ionengravers.com>
To:	Stephen Warren <swarren@...dotorg.org>,
	Mark Brown <broonie@...nel.org>,
	Grant Likely <grant.likely@...aro.org>
CC:	"spi-devel-general@...ts.sourceforge.net" 
	<spi-devel-general@...ts.sourceforge.net>,
	Mike Frysinger <vapier@...too.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"device-drivers-devel@...ckfin.uclinux.org" 
	<device-drivers-devel@...ckfin.uclinux.org>
Subject: RE: [PATCH 2/2] spi: convert drivers to use bits_per_word_mask

On Tuesday, May 21, 2013 7:37 PM, Stephen Warren wrote:
>
> Fill in the recently added spi_master.bits_per_word_mask field in as
> many drivers as possible. Make related cleanups, such as removing any
> redundant error-checking, or empty setup callbacks.
>
> Cc: device-drivers-devel@...ckfin.uclinux.org
> Cc: Mike Frysinger <vapier@...too.org>
> Signed-off-by: Stephen Warren <swarren@...dotorg.org>
> ---

<snip>

>  drivers/spi/spi-ep93xx.c        |   11 +----------

<snip>

> diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
> index d7bac60..f1b1497 100644
> --- a/drivers/spi/spi-ep93xx.c
> +++ b/drivers/spi/spi-ep93xx.c
> @@ -296,12 +296,6 @@ static int ep93xx_spi_setup(struct spi_device *spi)
>  	struct ep93xx_spi *espi = spi_master_get_devdata(spi->master);
>  	struct ep93xx_spi_chip *chip;
>  
> -	if (spi->bits_per_word < 4 || spi->bits_per_word > 16) {
> -		dev_err(&espi->pdev->dev, "invalid bits per word %d\n",
> -			spi->bits_per_word);
> -		return -EINVAL;
> -	}
> -
>  	chip = spi_get_ctldata(spi);
>  	if (!chip) {
>  		dev_dbg(&espi->pdev->dev, "initial setup for %s\n",
> @@ -365,10 +359,6 @@ static int ep93xx_spi_transfer(struct spi_device *spi, struct spi_message *msg)
>  
>  	/* first validate each transfer */
>  	list_for_each_entry(t, &msg->transfers, transfer_list) {
> -		if (t->bits_per_word) {
> -			if (t->bits_per_word < 4 || t->bits_per_word > 16)
> -				return -EINVAL;
> -		}
>  		if (t->speed_hz && t->speed_hz < espi->min_rate)
>  				return -EINVAL;
>  	}
> @@ -1046,6 +1036,7 @@ static int ep93xx_spi_probe(struct platform_device *pdev)
>  	master->bus_num = pdev->id;
>  	master->num_chipselect = info->num_chipselect;
>  	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
> +	master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 16);
>  
>  	platform_set_drvdata(pdev, master);

Seems reasonable. For the spi-ep93xx driver:

Acked-by: H Hartley Sweeten <hsweeten@...ionengravers.com>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ