net/mlx5: Fix passing zero to 'PTR_ERR'
authorYueHaibing <yuehaibing@huawei.com>
Tue, 1 Dec 2020 22:42:06 +0000 (14:42 -0800)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 8 Dec 2020 19:28:48 +0000 (11:28 -0800)
Fix smatch warnings:

drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c:105 esw_acl_egress_lgcy_setup() warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_ofld.c:177 esw_acl_egress_ofld_setup() warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c:184 esw_acl_ingress_lgcy_setup() warn: passing zero to 'PTR_ERR'
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c:262 esw_acl_ingress_ofld_setup() warn: passing zero to 'PTR_ERR'

esw_acl_table_create() never returns NULL, so
NULL test should be removed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_lgcy.c
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/egress_ofld.c
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c
drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_ofld.c

index d46f8b225ebe338f754d2211772c40a758cd1ff2..2b85d4777303a5c47a15664a9684d18c72630cfd 100644 (file)
@@ -101,7 +101,7 @@ int esw_acl_egress_lgcy_setup(struct mlx5_eswitch *esw,
        vport->egress.acl = esw_acl_table_create(esw, vport->vport,
                                                 MLX5_FLOW_NAMESPACE_ESW_EGRESS,
                                                 table_size);
-       if (IS_ERR_OR_NULL(vport->egress.acl)) {
+       if (IS_ERR(vport->egress.acl)) {
                err = PTR_ERR(vport->egress.acl);
                vport->egress.acl = NULL;
                goto out;
index c3faae67e4d6ee0578b7949639b593c613d02c1c..4c74e2690d57bc85bd26f33ae6aa001c432de109 100644 (file)
@@ -173,7 +173,7 @@ int esw_acl_egress_ofld_setup(struct mlx5_eswitch *esw, struct mlx5_vport *vport
                table_size++;
        vport->egress.acl = esw_acl_table_create(esw, vport->vport,
                                                 MLX5_FLOW_NAMESPACE_ESW_EGRESS, table_size);
-       if (IS_ERR_OR_NULL(vport->egress.acl)) {
+       if (IS_ERR(vport->egress.acl)) {
                err = PTR_ERR(vport->egress.acl);
                vport->egress.acl = NULL;
                return err;
index b68976b378b81a53d778af04ee50b754f7a29f2d..d64fad2823e73cd097a7e85b5641ae292c21340e 100644 (file)
@@ -180,7 +180,7 @@ int esw_acl_ingress_lgcy_setup(struct mlx5_eswitch *esw,
                vport->ingress.acl = esw_acl_table_create(esw, vport->vport,
                                                          MLX5_FLOW_NAMESPACE_ESW_INGRESS,
                                                          table_size);
-               if (IS_ERR_OR_NULL(vport->ingress.acl)) {
+               if (IS_ERR(vport->ingress.acl)) {
                        err = PTR_ERR(vport->ingress.acl);
                        vport->ingress.acl = NULL;
                        return err;
index 4e55d7225a265c2ec382c435aa59fd957eb6f853..548c005ea63358be4500b3f78a1cd5c790b7ef2b 100644 (file)
@@ -258,7 +258,7 @@ int esw_acl_ingress_ofld_setup(struct mlx5_eswitch *esw,
        vport->ingress.acl = esw_acl_table_create(esw, vport->vport,
                                                  MLX5_FLOW_NAMESPACE_ESW_INGRESS,
                                                  num_ftes);
-       if (IS_ERR_OR_NULL(vport->ingress.acl)) {
+       if (IS_ERR(vport->ingress.acl)) {
                err = PTR_ERR(vport->ingress.acl);
                vport->ingress.acl = NULL;
                return err;