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: <12fe1b84-1981-bf56-9323-b7f5b698c196@metafoo.de>
Date:   Mon, 17 Oct 2022 15:04:56 +0200
From:   Lars-Peter Clausen <lars@...afoo.de>
To:     Amit Kumar Mahapatra <amit.kumar-mahapatra@....com>,
        broonie@...nel.org, sanju.mehta@....com,
        chin-ting_kuo@...eedtech.com, clg@...d.org, kdasu.kdev@...il.com,
        f.fainelli@...il.com, rjui@...adcom.com, sbranden@...adcom.com,
        eajames@...ux.ibm.com, olteanv@...il.com, han.xu@....com,
        john.garry@...wei.com, shawnguo@...nel.org, s.hauer@...gutronix.de,
        narmstrong@...libre.com, khilman@...libre.com,
        matthias.bgg@...il.com, haibo.chen@....com,
        linus.walleij@...aro.org, daniel@...que.org,
        haojian.zhuang@...il.com, robert.jarzmik@...e.fr,
        agross@...nel.org, bjorn.andersson@...aro.org, heiko@...ech.de,
        krzysztof.kozlowski@...aro.org, andi@...zian.org,
        mcoquelin.stm32@...il.com, alexandre.torgue@...s.st.com,
        wens@...e.org, jernej.skrabec@...il.com, samuel@...lland.org,
        masahisa.kojima@...aro.org, jaswinder.singh@...aro.org,
        rostedt@...dmis.org, mingo@...hat.com, l.stelmach@...sung.com,
        davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, alex.aring@...il.com, stefan@...enfreihafen.org,
        kvalo@...nel.org, miquel.raynal@...tlin.com, richard@....at,
        vigneshr@...com, jic23@...nel.org, tudor.ambarus@...rochip.com,
        pratyush@...nel.org
Cc:     git@....com, linux-spi@...r.kernel.org,
        linux-kernel@...r.kernel.org, joel@....id.au, andrew@...id.au,
        radu_nicolae.pirea@....ro, nicolas.ferre@...rochip.com,
        alexandre.belloni@...tlin.com, claudiu.beznea@...rochip.com,
        bcm-kernel-feedback-list@...adcom.com, fancer.lancer@...il.com,
        kernel@...gutronix.de, festevam@...il.com, linux-imx@....com,
        jbrunet@...libre.com, martin.blumenstingl@...glemail.com,
        avifishman70@...il.com, tmaimon77@...il.com, tali.perry1@...il.com,
        venture@...gle.com, yuenn@...gle.com, benjaminfair@...gle.com,
        yogeshgaur.83@...il.com, konrad.dybcio@...ainline.org,
        alim.akhtar@...sung.com, ldewangan@...dia.com,
        thierry.reding@...il.com, jonathanh@...dia.com,
        michal.simek@....com, linux-aspeed@...ts.ozlabs.org,
        openbmc@...ts.ozlabs.org, linux-arm-kernel@...ts.infradead.org,
        linux-rpi-kernel@...ts.infradead.org,
        linux-amlogic@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
        linux-rockchip@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org,
        linux-stm32@...md-mailman.stormreply.com,
        linux-sunxi@...ts.linux.dev, linux-tegra@...r.kernel.org,
        netdev@...r.kernel.org, linux-wpan@...r.kernel.org,
        libertas-dev@...ts.infradead.org, linux-wireless@...r.kernel.org,
        linux-mtd@...ts.infradead.org, Michael.Hennerich@...log.com,
        linux-iio@...r.kernel.org, michael@...le.cc, akumarma@....com,
        amitrkcian2002@...il.com
Subject: Re: [PATCH 03/10] net: Replace spi->chip_select references to
 spi->chip_select[0]

On 10/17/22 14:12, Amit Kumar Mahapatra wrote:
> For adding multi CS support & to prevent any existing driver from
> breaking, replaced all spi->chip_select references to spi->chip_select[0].

But the tree is broken, isn't it? You introduce make chipselect an array 
in one of the earlier patches and then change drivers one by one in 
separate patches.

How about adding a inline helper function spi_chipselect(struct 
spi_device *spi, unsigned int idx). Update all drivers to use that 
function and then once there are no drivers left that directly reference 
the chipselect field you can introduce multi-chipselect support and 
update the helper function.

>
> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@....com>
> ---
>   drivers/net/ethernet/asix/ax88796c_main.c      | 2 +-
>   drivers/net/ethernet/davicom/dm9051.c          | 2 +-
>   drivers/net/ieee802154/ca8210.c                | 2 +-
>   drivers/net/wan/slic_ds26522.c                 | 2 +-
>   drivers/net/wireless/marvell/libertas/if_spi.c | 2 +-
>   5 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/asix/ax88796c_main.c b/drivers/net/ethernet/asix/ax88796c_main.c
> index 6ba5b024a7be..65586ff24dfb 100644
> --- a/drivers/net/ethernet/asix/ax88796c_main.c
> +++ b/drivers/net/ethernet/asix/ax88796c_main.c
> @@ -1006,7 +1006,7 @@ static int ax88796c_probe(struct spi_device *spi)
>   	ax_local->mdiobus->parent = &spi->dev;
>   
>   	snprintf(ax_local->mdiobus->id, MII_BUS_ID_SIZE,
> -		 "ax88796c-%s.%u", dev_name(&spi->dev), spi->chip_select);
> +		 "ax88796c-%s.%u", dev_name(&spi->dev), spi->chip_select[0]);
>   
>   	ret = devm_mdiobus_register(&spi->dev, ax_local->mdiobus);
>   	if (ret < 0) {
> diff --git a/drivers/net/ethernet/davicom/dm9051.c b/drivers/net/ethernet/davicom/dm9051.c
> index a523ddda7609..835674ad6ceb 100644
> --- a/drivers/net/ethernet/davicom/dm9051.c
> +++ b/drivers/net/ethernet/davicom/dm9051.c
> @@ -1121,7 +1121,7 @@ static int dm9051_mdio_register(struct board_info *db)
>   	db->mdiobus->phy_mask = (u32)~BIT(1);
>   	db->mdiobus->parent = &spi->dev;
>   	snprintf(db->mdiobus->id, MII_BUS_ID_SIZE,
> -		 "dm9051-%s.%u", dev_name(&spi->dev), spi->chip_select);
> +		 "dm9051-%s.%u", dev_name(&spi->dev), spi->chip_select[0]);
>   
>   	ret = devm_mdiobus_register(&spi->dev, db->mdiobus);
>   	if (ret)
> diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
> index 42c0b451088d..f0ccf1cd79f4 100644
> --- a/drivers/net/ieee802154/ca8210.c
> +++ b/drivers/net/ieee802154/ca8210.c
> @@ -2967,7 +2967,7 @@ static int ca8210_test_interface_init(struct ca8210_priv *priv)
>   		sizeof(node_name),
>   		"ca8210@...%d",
>   		priv->spi->master->bus_num,
> -		priv->spi->chip_select
> +		priv->spi->chip_select[0]
>   	);
>   
>   	test->ca8210_dfs_spi_int = debugfs_create_file(
> diff --git a/drivers/net/wan/slic_ds26522.c b/drivers/net/wan/slic_ds26522.c
> index 6063552cea9b..eb053a76fe52 100644
> --- a/drivers/net/wan/slic_ds26522.c
> +++ b/drivers/net/wan/slic_ds26522.c
> @@ -211,7 +211,7 @@ static int slic_ds26522_probe(struct spi_device *spi)
>   
>   	ret = slic_ds26522_init_configure(spi);
>   	if (ret == 0)
> -		pr_info("DS26522 cs%d configured\n", spi->chip_select);
> +		pr_info("DS26522 cs%d configured\n", spi->chip_select[0]);
>   
>   	return ret;
>   }
> diff --git a/drivers/net/wireless/marvell/libertas/if_spi.c b/drivers/net/wireless/marvell/libertas/if_spi.c
> index ff1c7ec8c450..074d6c1f0c2c 100644
> --- a/drivers/net/wireless/marvell/libertas/if_spi.c
> +++ b/drivers/net/wireless/marvell/libertas/if_spi.c
> @@ -1051,7 +1051,7 @@ static int if_spi_init_card(struct if_spi_card *card)
>   				"spi->max_speed_hz=%d\n",
>   				card->card_id, card->card_rev,
>   				card->spi->master->bus_num,
> -				card->spi->chip_select,
> +				card->spi->chip_select[0],
>   				card->spi->max_speed_hz);
>   		err = if_spi_prog_helper_firmware(card, helper);
>   		if (err)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ