From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 71DB9ECAAD2 for ; Thu, 1 Sep 2022 23:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VJDXNulylav/bfHgrE3Lq4MCh9V5hrmRTYYc1dIuGCA=; b=AnA4zVn5kmdV0J 9niUkJ+9nHXJml6N+j3shc9Ep3px5I0+McUxZ1yYpRP2sEz19QNeIpGkSbgkfxacZxa2NDw1bfydf Un2xKoR3R/7ei4S/9MhdpAvmZwSsb3PVKLc4s2YQ/f82FtYAxjQLacPEOEFx5IeV+FDIGB6QiN7zq GvPeaD6LsO4TxnqT4L4C8rupFWdYIyS+aU+Qj2N7EoeGWZVzzpDUJ5Zi0bWPJMUu/KXShmG+3fcA7 L8medtSrGxuDDpY5U4RpfOweCr+AHPH9DeO/gZTtbOkP0sSVv9jieO7Naao8cPdr672Poj1uEu9Ez JIS3rGKcZxK5ONOzTtDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTtWS-00FlLa-3R; Thu, 01 Sep 2022 23:22:56 +0000 Received: from [2601:1c0:6280:3f0::a6b3] by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTtWL-00FlIA-4F; Thu, 01 Sep 2022 23:22:49 +0000 Message-ID: <3b86cb68-2b30-76dd-baf5-90af0b0a60a4@infradead.org> Date: Thu, 1 Sep 2022 16:22:47 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v2 01/20] net: add helper eth_addr_add() Content-Language: en-US To: Michael Walle , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla , Shawn Guo , Li Yang , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Frank Rowand Cc: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ahmad Fatoum , Philipp Zabel , Andrew Lunn , Jakub Kicinski References: <20220901221857.2600340-1-michael@walle.cc> <20220901221857.2600340-2-michael@walle.cc> From: Randy Dunlap In-Reply-To: <20220901221857.2600340-2-michael@walle.cc> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 9/1/22 15:18, Michael Walle wrote: > Add a helper to add an offset to a ethernet address. This comes in handy > if you have a base ethernet address for multiple interfaces. > > Signed-off-by: Michael Walle > Reviewed-by: Andrew Lunn > Acked-by: Jakub Kicinski > --- > changes since v1: > - none > > include/linux/etherdevice.h | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h > index a541f0c4f146..f144cadbe99d 100644 > --- a/include/linux/etherdevice.h > +++ b/include/linux/etherdevice.h > @@ -507,6 +507,20 @@ static inline void eth_addr_inc(u8 *addr) > u64_to_ether_addr(u, addr); > } > > +/** > + * eth_addr_add() - Add (or subtract) and offset to/from the given MAC address. an offset ? > + * > + * @offset: Offset to add. > + * @addr: Pointer to a six-byte array containing Ethernet address to increment. > + */ > +static inline void eth_addr_add(u8 *addr, long offset) > +{ > + u64 u = ether_addr_to_u64(addr); > + > + u += offset; > + u64_to_ether_addr(u, addr); > +} > + > /** > * is_etherdev_addr - Tell if given Ethernet address belongs to the device. > * @dev: Pointer to a device structure -- ~Randy _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel