From patchwork Mon Jan 27 11:09:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 11352477 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C449092A for ; Mon, 27 Jan 2020 11:10:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1862214AF for ; Mon, 27 Jan 2020 11:10:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="J/JVNOJy"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="YUrxf9eN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1862214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wfDjHWVH0dtk7Ys1gso7J7yv3IM9AQ2u5tm4XjCvF9M=; b=J/JVNOJy3aCzoEcuRdOQD4MPsn ZtnoANcwx9VDyTL9UYbA1ZVZ8ySGn2aj7+sEaE0ZIpM0N/e6QqoSm9qxA7zbeKJyWNzN4DnmFp0vC 5iXwHL+5dhmHYBeR0XWChWhVV/ZATn4T6prAKAcY/JnmnB0KTvGTbmlmdhHimvxfpVWVK1hMSSRLi kJ4s3k8yHREhaYgAkglvlcEgrln8nZYGpYFNbszGm2oS7hhSeDikd/YHOfdNQ+GoDibLaM6HMjBYD 2xQXISFgRrmT31MDVe6Rqc/oKBSQbCEBFE40yFleulVdcvWaJA6xXrrX9O6ebdv2ERzYiTQBrFK8D Captb3dQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iw2Hf-00079k-6U; Mon, 27 Jan 2020 11:10:23 +0000 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iw2Gt-0005RV-Kn for linux-arm-kernel@lists.infradead.org; Mon, 27 Jan 2020 11:09:38 +0000 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 36A30407CF; Mon, 27 Jan 2020 11:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1580123375; bh=WDHga405QA2kRfIL5nzi84ZTD/uxWi96ihnmJZFBiA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=YUrxf9eNQACZD7KbzDtLfihxIi56TQmyd0NMNnynlFpfaSDri1drYwli4nT6U1t9T RyAvJ3XnPifHW0TROUXhsjOOkKT6I3p1NJ3a+eH2uUCIN/LFJqCIj5RmKfnKLfnG0O a82XdOEdkJJqT8K1wLEUR8V5LogU+VdrbgrW+BzoZM3ATGVn91pnKswamzx5EjH0DY xcXGgG/M9YKHOiNAnZx4MzPb/zRubtPuAOdqL0ykXg1wljOR1u4DakphjdSU1KBSfD nhrc5e/uU980M2/bLb4L52FTRZ+g5okYl3O0aLt+q+CDO0nms4sIg6Ak/4y4NO6erI DbzzAH8Yt/Tag== Received: from de02dwia024.internal.synopsys.com (de02dwia024.internal.synopsys.com [10.225.19.81]) by mailhost.synopsys.com (Postfix) with ESMTP id 913E1A008A; Mon, 27 Jan 2020 11:09:28 +0000 (UTC) From: Jose Abreu To: netdev@vger.kernel.org Subject: [RFC net-next 2/8] net: phylink: Add phylink_and and phylink_andnot Helpers Date: Mon, 27 Jan 2020 12:09:07 +0100 Message-Id: <9509e5d75810da4ef49c674f0fd5cacb81d1a536.1580122909.git.Jose.Abreu@synopsys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200127_030935_686466_CE865C14 X-CRM114-Status: UNSURE ( 9.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jose Abreu , Andrew Lunn , Joao Pinto , Alexandre Torgue , linux-kernel@vger.kernel.org, Russell King , linux-stm32@st-md-mailman.stormreply.com, Florian Fainelli , Maxime Coquelin , Jakub Kicinski , Giuseppe Cavallaro , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Heiner Kallweit MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add two new helpers for bitmap handling. Signed-off-by: Jose Abreu --- Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Jose Abreu Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Maxime Coquelin Cc: Russell King Cc: Andrew Lunn Cc: Florian Fainelli Cc: Heiner Kallweit Cc: netdev@vger.kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- include/linux/phylink.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 523209e70947..70a2f7a4450b 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -272,6 +272,10 @@ int phylink_mii_ioctl(struct phylink *, struct ifreq *, int); #define phylink_zero(bm) \ bitmap_zero(bm, __ETHTOOL_LINK_MODE_MASK_NBITS) +#define phylink_and(bm, obm) \ + bitmap_and(bm, bm, obm, __ETHTOOL_LINK_MODE_MASK_NBITS) +#define phylink_andnot(bm, obm) \ + bitmap_andnot(bm, bm, obm, __ETHTOOL_LINK_MODE_MASK_NBITS) #define __phylink_do_bit(op, bm, mode) \ op(ETHTOOL_LINK_MODE_ ## mode ## _BIT, bm)