Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp498556rdb; Thu, 22 Feb 2024 09:59:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUGwobrSDOuDUqZ+e/7rU9ADoclsMAlQTBxX9n/UvLIf9nkkNg8a/qxwNnHLOYEYd2Y3cMVlQsS0SIwiKVkcOpDcW+oQS0jjda5lbAM3Q== X-Google-Smtp-Source: AGHT+IHKBxUakKtwv9hzztvmP+Xp6Ib2KLKKyC9vKqwFLUDhSa3V+8r4YocBJ1Mo+Ygl0Xa5OKpK X-Received: by 2002:a05:620a:2442:b0:787:a211:160a with SMTP id h2-20020a05620a244200b00787a211160amr2207860qkn.40.1708624765213; Thu, 22 Feb 2024 09:59:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708624765; cv=pass; d=google.com; s=arc-20160816; b=LxiIkq7ArSK0F4NXAnwHHHj8Q0tIVG2C0FowqFcNPHlBw10O2o7CPxIc9m+pz/6CvM Mq2gyiHX7aGMxKZzPZCOMvNcqPS+vfARWct5GrzIZAhPUIynNT+wN8QhbmpWX03lknN7 BPaxiIZ5cUB8FVy/m7AmvMfZeFR23YkU8YndurTSpDU1HeBNRDc4PdiAWwEJcegKGM/X I2cgEv+u4p1BDWks3rnoutMTSLiVTUJi5J2JdPxmbtPQwJcgCbOj9eehKgnL3zt+L3jR O0VVaNwzm5DzUvk45pXjpgRzsrdx2YEApKCoUoyQRzDHMHe4jMKUf4BDJjO0J5CuFM8Y 82Rw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=fOW9you0b0342rsDJpYsth5h/RvQ0i1KuZysF40tbO0=; fh=OOO7xtSWWtVzH9QQIWaWPx5XdYVcPIma0gmSzCxRclo=; b=WDYPopzs6wAY2j0Y+LcOEchTe/RnEj4iGF3Z9eR7N9d+FNrBTg7iUinsO83TQ3PImA 20I2uXffZeLr6uv4VCsaF2hzq1l5fUcJjzxqliNJw4bXb2pTkVyB5DORk6kUFid573mH aIQEjAbMVCh8W2rFiy/Cnw2+i46XKtc7MSpont84AtLkrWvz4c+KYtvpBvoWK/ITOB3m t5474v8mAMyBrTVMew9jSO/+9amg7bOvtYKxknE/r35f+9oOOmGE8e0E5o38hoeoDB6a D3ASCoMTpm0rKg3wQKwbQcJaAFbnZ37UaT3djnuTm7FU53EuB45Z+AbBf/jCphvIW0J3 vpLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ND7LaGMG; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-77023-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77023-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bk28-20020a05620a1a1c00b00787a8cdf6dasi854424qkb.66.2024.02.22.09.59.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:59:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77023-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ND7LaGMG; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-77023-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77023-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F2AE11C23BB1 for ; Thu, 22 Feb 2024 17:59:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEA7E1586CB; Thu, 22 Feb 2024 17:59:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ND7LaGMG" Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47592156961; Thu, 22 Feb 2024 17:58:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624742; cv=none; b=bLOIQ+43Kfz4qgtjL4/0n3hP+Gvou/dAa4sHrN+Zu7e9neinvKABisugcnS/PmxDZCWAiJB9fZPPQGvRxFlavfcFuBd+I2JuwlZ0duAY3zo3ZEq33ne2TJltyv3H0GszhvWqOWwleCZj2CVHt1ZZwnifiev8ErL53pzMTv/RxgU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624742; c=relaxed/simple; bh=xivy3UlSQqvQmx57Qi8EAzpF57Mk2WtzBv+/+8Pqri0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lmuYPXrPUALW0Oc7+liTja9EKqkFjh+EFnC1bTzCB1vlZs6Oo+CM5eYqD0VQ3tCaq6i3SjA06YT3Too63BZ05u/A/lH8BT2pmi6FyN+V1i7CtvkjFB10yNC/y1KJh1NZNNUQv3v0QNyLek80IAggOTFxs7b7CteI0HT3SChkRUc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ND7LaGMG; arc=none smtp.client-ip=209.85.208.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2d2305589a2so720531fa.1; Thu, 22 Feb 2024 09:58:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708624738; x=1709229538; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fOW9you0b0342rsDJpYsth5h/RvQ0i1KuZysF40tbO0=; b=ND7LaGMGGP4KJRUteYyehlGShGyC7clWpA5cMBWUeZd8jZVT5eKgtnQyHJ8+rVENPE VdDZxDjlFKMP5YSYLXr6H2WRINBwErRnqiHtTWc/6htsD/jRJGfXU+/snc+p1JhyotvI wOy9J698BVb52nBl4FPGXoEUztB+XjOsr6ybFKH0Hd/pRNt+aBRRiaxYq6qeL+bZw3kR qVoj38aizdu2h0GNWm4ncnVN6NcglNRn/za+VqyF2XGg+LrE3NxqXuRCiWjQMwRasGDl sWjBju+RG2/PcCtvpACnki3DnD3e8Y/9Okv2of8s1i4W+xvSoIG0IqgqWH6EoSR9UqNf CM5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708624738; x=1709229538; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fOW9you0b0342rsDJpYsth5h/RvQ0i1KuZysF40tbO0=; b=gRUwXvp/RRFu4fyAy6F9ONKQWaGpKwJUGtM+VkAaWjUieSPfiRId4M2nA8vv9FNZcS 80jphcct+YoIDj5TdGjxtAgWR/7xvkvT92U58AgBeTo780/nophlEbxdso2/238ecSuY CJH20Pu5NMb1AkWCDR4u+zaR0PbkDiKn389jnxatwxefW4JoDHzpUABEOLMbFge8XlO1 kGcSZ9mp03J04JWujTQI2akp8lkIMtQ+UC9xPx2a1sPnXTkTonVHga+yYHe37GfFVCNu 2hb5zMgLZwwgcTLp/brl3RlKp9dmY3nX7EXpud5F8uQ6SI6Nj8goc14f+Re+FmTVLKYY bXXQ== X-Forwarded-Encrypted: i=1; AJvYcCW0lYxJ89VGMR5rL/dPpvOe8Evoe1A4tIy3HcH2aGcDYD+uIUKBwcS4nnXMGPhWQubM6JfoBe6tLkkwYi1sApgkBqD8zqS/Lh5bxHz3IP2pNnsU4fSXYNaJWlQKdAh5SPrumubR X-Gm-Message-State: AOJu0Yw1MukSQoaZUQHp+NdAtGPxlNr85hWRq1KBBtGGA9IQd0nIvpvu MuXEahDV64UE8T/oi3NKMh59bsN+kwkyjSibLj6i/M3bkxoo6LEM X-Received: by 2002:a05:651c:b0f:b0:2d2:64c8:49a6 with SMTP id b15-20020a05651c0b0f00b002d264c849a6mr1360670ljr.21.1708624738266; Thu, 22 Feb 2024 09:58:58 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id z33-20020a2ebe21000000b002d230f2e808sm2011743ljq.48.2024.02.22.09.58.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 09:58:57 -0800 (PST) From: Serge Semin To: Jose Abreu , Jose Abreu , Andrew Lunn , Heiner Kallweit , Russell King , Jakub Kicinski , Vladimir Oltean , Maxime Chevallier , "David S. Miller" , Eric Dumazet , Paolo Abeni Cc: Serge Semin , Mengyuan Lou , Tomer Maimon , Jiawen Wu , Alexandre Torgue , openbmc@lists.ozlabs.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Oltean Subject: [PATCH net-next v2 1/4] net: pcs: xpcs: Drop sentinel entry from 2500basex ifaces list Date: Thu, 22 Feb 2024 20:58:20 +0300 Message-ID: <20240222175843.26919-2-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240222175843.26919-1-fancer.lancer@gmail.com> References: <20240222175843.26919-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit There are currently only two methods (xpcs_find_compat() and xpcs_get_interfaces()) defined in the driver which loop over the available interfaces. All of them rely on the xpcs_compat::num_interfaces field value to get the total number of supported interfaces. Thus the interface arrays are supposed to be filled with actual interface IDs and there is no need in the dummy terminating ID placed at the end of the arrays. Based on the above drop the PHY_INTERFACE_MODE_MAX entry from the xpcs_2500basex_interfaces array and the PHY_INTERFACE_MODE_MAX-based conditional statement from the xpcs_get_interfaces() method as redundant. Signed-off-by: Serge Semin Reviewed-by: Vladimir Oltean --- drivers/net/pcs/pcs-xpcs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index 31f0beba638a..dc7c374da495 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -130,7 +130,6 @@ static const phy_interface_t xpcs_1000basex_interfaces[] = { static const phy_interface_t xpcs_2500basex_interfaces[] = { PHY_INTERFACE_MODE_2500BASEX, - PHY_INTERFACE_MODE_MAX, }; enum { @@ -636,8 +635,7 @@ void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces) const struct xpcs_compat *compat = &xpcs->id->compat[i]; for (j = 0; j < compat->num_interfaces; j++) - if (compat->interface[j] < PHY_INTERFACE_MODE_MAX) - __set_bit(compat->interface[j], interfaces); + __set_bit(compat->interface[j], interfaces); } } EXPORT_SYMBOL_GPL(xpcs_get_interfaces); -- 2.43.0