dt-bindings: mtd: gpmc: Fix the ECC bytes vs. OOB bytes equation
Sasha Levin
maintainerPATCH 1/2 dt-bindings: mtd: gpmc: Fix the ECC bytes vs. OOB bytes equation
From: Miquel Raynal <[email protected]>
[ Upstream commit 778cb8e39f6ec252be50fc3850d66f3dcbd5dd5a ]
"PAGESIZE / 512" is the number of ECC chunks.
"ECC_BYTES" is the number of bytes needed to store a single ECC code. "2" is the space reserved by the bad block marker.
"2 + (PAGESIZE / 512) * ECC_BYTES" should of course be lower or equal than the total number of OOB bytes, otherwise it won't fit.
Fix the equation by substituting s/>=/<=/.
--- Documentation/devicetree/bindings/mtd/gpmc-nand.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/mtd/gpmc-nand.txt +1 -1
@@ -112,7 +112,7 @@ on various other factors also like; so the device should have enough free bytes available its OOB/Spare area to accommodate ECC for entire page. In general following expression helps in determining if given device can accommodate ECC syndrome: - "2 + (PAGESIZE / 512) * ECC_BYTES" >= OOBSIZE" + "2 + (PAGESIZE / 512) * ECC_BYTES" <= OOBSIZE" where OOBSIZE number of bytes in OOB/spare area PAGESIZE number of bytes in main-area of device page
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 2/2 ethtool: Fix an error code in cxgb2.c
From: Yang Li <[email protected]>
[ Upstream commit 7db8263a12155c7ae4ad97e850f1e499c73765fc ]
When adapter->registered_device_map is NULL, the value of err is uncertain, we set err to -EINVAL to avoid ambiguity.
Clean up smatch warning:drivers/net/ethernet/chelsio/cxgb/cxgb2.c:1114 init_one() warn: missing error code 'err'
--- drivers/net/ethernet/chelsio/cxgb/cxgb2.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/chelsio/cxgb/cxgb2.c +1 -0
@@ -1133,6 +1133,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)if (!adapter->registered_device_map) {pr_err ("%s: could not register any net devices\n" ,pci_name (pdev)); + err = -EINVAL ; goto out_release_adapter_res; }
Signature · 1 line
2.30.2