aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-02-16 11:47:39 -0600
committerDavid S. Miller <davem@davemloft.net>2018-02-19 11:12:24 -0500
commite21fed5864e408732653e0aa067b6669b7d88cda (patch)
treec27c29dbc4915a593b14e0292a0049cbaf203e38
parentptr_ring: Remove now-redundant smp_read_barrier_depends() (diff)
downloadlinux-dev-e21fed5864e408732653e0aa067b6669b7d88cda.tar.xz
linux-dev-e21fed5864e408732653e0aa067b6669b7d88cda.zip
net: dsa: mv88e6xxx: hwtstamp: remove unnecessary range checking tests
_port_ is already known to be a valid index in the callers [1]. So these checks are unnecessary. [1] https://lkml.org/lkml/2018/2/16/469 Addresses-Coverity-ID: 1465287 Addresses-Coverity-ID: 1465291 Suggested-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/mv88e6xxx/hwtstamp.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/hwtstamp.c b/drivers/net/dsa/mv88e6xxx/hwtstamp.c
index 2149d332dea0..ac7694c71266 100644
--- a/drivers/net/dsa/mv88e6xxx/hwtstamp.c
+++ b/drivers/net/dsa/mv88e6xxx/hwtstamp.c
@@ -179,9 +179,6 @@ int mv88e6xxx_port_hwtstamp_set(struct dsa_switch *ds, int port,
if (!chip->info->ptp_support)
return -EOPNOTSUPP;
- if (port < 0 || port >= mv88e6xxx_num_ports(chip))
- return -EINVAL;
-
if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
return -EFAULT;
@@ -206,9 +203,6 @@ int mv88e6xxx_port_hwtstamp_get(struct dsa_switch *ds, int port,
if (!chip->info->ptp_support)
return -EOPNOTSUPP;
- if (port < 0 || port >= mv88e6xxx_num_ports(chip))
- return -EINVAL;
-
return copy_to_user(ifr->ifr_data, config, sizeof(*config)) ?
-EFAULT : 0;
}
@@ -255,9 +249,6 @@ static u8 *mv88e6xxx_should_tstamp(struct mv88e6xxx_chip *chip, int port,
if (!chip->info->ptp_support)
return NULL;
- if (port < 0 || port >= mv88e6xxx_num_ports(chip))
- return NULL;
-
hdr = parse_ptp_header(skb, type);
if (!hdr)
return NULL;