From patchwork Thu Feb 22 17:58:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 204929 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp119252dyb; Thu, 22 Feb 2024 10:13:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUHzxVPbkInW6+5GQ0uShmvY+hhx9aaOId4XGJxjcCa9hxba5rzieQIZBL0A1sX5f9J7OaC4RuN5hUGf+2rhDP0WTBv8A== X-Google-Smtp-Source: AGHT+IGsps+2A5XzdxOy8dAt0qmwROQw90+mf2aNIN3Z7II/IW1fJspsMrc8lt1PeXB8G19Obebp X-Received: by 2002:a17:90a:cb98:b0:299:35f5:be6c with SMTP id a24-20020a17090acb9800b0029935f5be6cmr15475349pju.17.1708625593757; Thu, 22 Feb 2024 10:13:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708625593; cv=pass; d=google.com; s=arc-20160816; b=UQSEDjL41U+Oh0N3s0gwSdnrjiKs1C/edjqJSvTqY4aaH7hjX4kE1bxgZFaqRRqsax ihLPHFDzCVSNXsvWhKWcNeMgNP8m81Ech/WIvFF827PUfodr6Gg5uR5GfnDyYMHfZ46E quVaNKs8mFzkWO9qU6d8cHGC6Ywuv/lTWmIZ3sm+Pz5yFPuR6sU1Yh5y3wxOvkY2bCae 0IKVSCfc1tFz56HwAtXJpOMincehgdbGrcEbAKuXolRZfOBbJDImvub+kF2Ex2QPq8vj wWeGu0W2j1XloLAg1qyMcepfeTM30PRdAk+NltAdf9qyRfe3lAswJ8iyFHfFJCHEuLnM lTBg== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77023-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id mh1-20020a17090b4ac100b00296f86d4ffbsi3549501pjb.90.2024.02.22.10.13.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:13:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77023-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77023-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9E6A5B21D2C for ; Thu, 22 Feb 2024 17:59:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD615158D6F; Thu, 22 Feb 2024 17:59:04 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791623790219320450 X-GMAIL-MSGID: 1791623790219320450 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);