From b64d76b782264aa91c236c11c72646459b04c301 Mon Sep 17 00:00:00 2001 From: Sergey Ryazanov Date: Tue, 8 Jun 2021 07:02:34 +0300 Subject: net: wwan: make WWAN_PORT_MAX meaning less surprised It is quite unusual when some value can not be equal to a defined range max value. Also most subsystems defines FOO_TYPE_MAX as a maximum valid value. So turn the WAN_PORT_MAX meaning from the number of supported port types to the maximum valid port type. Signed-off-by: Sergey Ryazanov Reviewed-by: Loic Poulain Signed-off-by: David S. Miller --- drivers/net/wwan/wwan_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wwan/wwan_core.c') diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c index 6e8f19c71a9e..632ff86398ac 100644 --- a/drivers/net/wwan/wwan_core.c +++ b/drivers/net/wwan/wwan_core.c @@ -250,7 +250,7 @@ struct wwan_port *wwan_create_port(struct device *parent, struct wwan_port *port; int minor, err = -ENOMEM; - if (type >= WWAN_PORT_MAX || !ops) + if (type > WWAN_PORT_MAX || !ops) return ERR_PTR(-EINVAL); /* A port is always a child of a WWAN device, retrieve (allocate or -- cgit v1.2.3