diff mbox series

[v2,4/5] PCI/switchtec: Replace ENOTSUPP with EOPNOTSUPP

Message ID 20211014141859.11444-5-kelvin.cao@microchip.com
State New
Headers show
Series Switchtec Fixes and Improvements | expand

Commit Message

Kelvin Cao Oct. 14, 2021, 2:18 p.m. UTC
From: Kelvin Cao <kelvin.cao@microchip.com>

ENOTSUPP is not a SUSV4 error code, and the following checkpatch.pl
warning will be given for new patches which still use ENOTSUPP.

    WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP

See the link below for the discussion.

  https://lore.kernel.org/netdev/20200511165319.2251678-1-kuba@kernel.org/

Replace ENOTSUPP with EOPNOTSUPP to align with future patches which will
be using EOPNOTSUPP.

Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com>
---
 drivers/pci/switch/switchtec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Krzysztof WilczyƄski Oct. 15, 2021, 1:55 a.m. UTC | #1
[+cc Jakub for visibility]

Hi,

> ENOTSUPP is not a SUSV4 error code, and the following checkpatch.pl
> warning will be given for new patches which still use ENOTSUPP.
> 
>     WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
> 
> See the link below for the discussion.
> 
>   https://lore.kernel.org/netdev/20200511165319.2251678-1-kuba@kernel.org/

This makes me wonder whether we should fix other occurrences of ENOTSUPP we
have in the PCI tree, as per:

  Index File                                       Line Content
      0 drivers/pci/msi.c                          1304 *  -ENOTSUPP otherwise
      1 drivers/pci/msi.c                          1316 return -ENOTSUPP;
      2 drivers/pci/pcie/dpc.c                      355 return -ENOTSUPP;
      3 drivers/pci/setup-res.c                     421 return -ENOTSUPP;
      4 drivers/pci/setup-res.c                     433 return -ENOTSUPP;
      5 drivers/pci/pci.c                          3600 * Returns -ENOTSUPP if resizable BARs are not supported at all.
      6 drivers/pci/pci.c                          3610 return -ENOTSUPP;
      7 drivers/pci/switch/switchtec.c              330 return -ENOTSUPP; \
      8 drivers/pci/switch/switchtec.c              616 return -ENOTSUPP;
      9 drivers/pci/switch/switchtec.c              824 return -ENOTSUPP;
     10 drivers/pci/switch/switchtec.c             1559 return -ENOTSUPP;
     11 drivers/pci/controller/dwc/pcie-tegra194.c 2244 return -ENOTSUPP;

What do you think Bjorn? Jakub?

	Krzysztof
diff mbox series

Patch

diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 97a93c9b4629..236cb40cc7c5 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -376,7 +376,7 @@  static ssize_t field ## _show(struct device *dev, \
 		return io_string_show(buf, &si->gen4.field, \
 				      sizeof(si->gen4.field)); \
 	else \
-		return -ENOTSUPP; \
+		return -EOPNOTSUPP; \
 } \
 \
 static DEVICE_ATTR_RO(field)
@@ -668,7 +668,7 @@  static int ioctl_flash_info(struct switchtec_dev *stdev,
 		info.flash_length = ioread32(&fi->gen4.flash_length);
 		info.num_partitions = SWITCHTEC_NUM_PARTITIONS_GEN4;
 	} else {
-		return -ENOTSUPP;
+		return -EOPNOTSUPP;
 	}
 
 	if (copy_to_user(uinfo, &info, sizeof(info)))
@@ -876,7 +876,7 @@  static int ioctl_flash_part_info(struct switchtec_dev *stdev,
 		if (ret)
 			return ret;
 	} else {
-		return -ENOTSUPP;
+		return -EOPNOTSUPP;
 	}
 
 	if (copy_to_user(uinfo, &info, sizeof(info)))
@@ -1611,7 +1611,7 @@  static int switchtec_init_pci(struct switchtec_dev *stdev,
 	else if (stdev->gen == SWITCHTEC_GEN4)
 		part_id = &stdev->mmio_sys_info->gen4.partition_id;
 	else
-		return -ENOTSUPP;
+		return -EOPNOTSUPP;
 
 	stdev->partition = ioread8(part_id);
 	stdev->partition_count = ioread8(&stdev->mmio_ntb->partition_count);