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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3B43C6FA82 for ; Fri, 23 Sep 2022 09:25:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231703AbiIWJZJ (ORCPT ); Fri, 23 Sep 2022 05:25:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231704AbiIWJZC (ORCPT ); Fri, 23 Sep 2022 05:25:02 -0400 Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8EE16C74F; Fri, 23 Sep 2022 02:25:00 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 7A1A3580C6D; Fri, 23 Sep 2022 05:24:57 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Fri, 23 Sep 2022 05:24:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1663925097; x=1663928697; bh=t50zxbg1je 01zo3yx+LqGItWRVx6GNoJo4k1q5aGeVg=; b=mnD6w11k5nxhH9/kQW48EZGzp7 5oOwVtxHS6LcB154wnimw3mI+61b/xqSLY+QBAbhAcYTfAhf1Z75Az0+dlaLASIT ZJxsHkU5+BpVsi8bTH2HUIo7V1gKzXNElLI3N1/3JFYPVS8S9+SZYkNXCoFYOe4U E+P3B+9VCSs1Gzq9UcghvFSgtG2I4ygXTbHxUNLIiTuYxIcOYOcWxI8NyvK7sHUZ sZXhBlaAA4PXrz2DdYp5b4nABQ0l6BU2MSTBPIB2l/cRsNLbo4Y2t3itUoWN8gCC 9zvEFKQ5/zvH5MYV1/HQP1BDLvODbjTeYUiWFs9UYI2gAhwPyzYNJkohDNGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663925097; x=1663928697; bh=t50zxbg1je01zo3yx+LqGItWRVx6 GNoJo4k1q5aGeVg=; b=AuZv+USLGde8oMEu1C58bKJrB412oxQvNHao8ZeMUfQA 3toGUYt/r6EojSrXcwB0kK6RKwLEa8e92tPItzAJVadNejYiYoli5mtQtl3GZVjO gcELQKqq6mIy+AK5DS90bqj9AMWCr6HLIIerihmtnrIVkVOaLgbPTgESdKOLhG5S Cz9e8fwsXCsEZF9zc4jiXrjt8wcgokE8d36g+zCmzH3joAX9UJDzVw9tFlmBP52T RRlA2xQYUPVuywC6rmh5ueQJPySYTHdHddIO62mEA2531U1xP2OAR2PIDDMD8Saf tQyKLWOUXqZZtIl62/irkpR1v3qLMWgduT9FHg508Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeefiedgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id DA519B60086; Fri, 23 Sep 2022 05:24:56 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-935-ge4ccd4c47b-fm-20220914.001-ge4ccd4c4 Mime-Version: 1.0 Message-Id: <230d397d-1bf8-422b-8ce0-4a63bb451394@www.fastmail.com> In-Reply-To: References: <20220427162123.110458-1-maukka@ext.kapsi.fi> <20220922202458.7592-1-maukka@ext.kapsi.fi> <20220922202458.7592-4-maukka@ext.kapsi.fi> <89f85393-c767-4c0c-90db-d78a2927d465@www.fastmail.com> Date: Fri, 23 Sep 2022 11:24:35 +0200 From: "Arnd Bergmann" To: "Mauri Sandberg" Cc: "Rob Herring" , krzysztof.kozlowski+dt@linaro.org, "Olof Johansson" , "Andrew Lunn" , "Sebastian Hesselbarth" , "Gregory Clement" , "Russell King" , =?UTF-8?Q?Pali_Roh=C3=A1r?= , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 3/3] ARM: orion5x: Add D-Link DNS-323 based on Device Tree Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 23, 2022, at 11:13 AM, maukka@ext.kapsi.fi wrote: > On 23.9.2022 00:39, Arnd Bergmann wrote: >> Can you use simple_strntoull() to parse the address into a u64 instead? >> > Nice idea. Its current replacement seems to be kstrtoull(). Right. > I'll have to do > it byte by byte, right? Or what do you have in mind with 64bit unsigned? I misread your code and assumed it was stored as a 12-digit hexadecimal number, but you are right: with the colons you still need to iterate the bytes. I looked a little further and found the mac_pton() function that I think does exactly what you need. Arnd 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 6A69BECAAD8 for ; Fri, 23 Sep 2022 09:26:30 +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:Subject:Cc:To:From:Date:References: In-Reply-To:Message-Id:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WlKcSgFBVhOxQLi+HV02ry2pplvR4cgz1lESM6AJVa4=; b=dVW3zbPkY6Whad 7Q6AHzqW+EK08ecp195o3rgagrs3VOW1KsJds5zMIQvplP/HE2+DpQJzqw8Bq0Ooak0qWMGi5fajM wFGU2AyWyLALoZL6tuulMaydlNHYDxYHEZDWYDZA8+yaIsEwyg39NkAVmHTj/Aj7h/ifrXtVpBlJW FiaDKkUfnmRTUbEn5fXUdOAdSM4mNhu1kmFcGa0R3uLcwK+gVV7EQFSEjQJsZgD79DKKpU8vL2cZT S+YIY+jADUFn9/Sfzo0WLThUAJGnP+asJVbvLuydtw02JlGKTDqk2iwnKl9XgVnJUIxIcJR1DuosI x7F83m+PlGrWLb+Tm/BA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obevq-003Irm-Kd; Fri, 23 Sep 2022 09:25:14 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obevk-003IiL-Tb for linux-arm-kernel@lists.infradead.org; Fri, 23 Sep 2022 09:25:10 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 7A1A3580C6D; Fri, 23 Sep 2022 05:24:57 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute3.internal (MEProxy); Fri, 23 Sep 2022 05:24:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1663925097; x=1663928697; bh=t50zxbg1je 01zo3yx+LqGItWRVx6GNoJo4k1q5aGeVg=; b=mnD6w11k5nxhH9/kQW48EZGzp7 5oOwVtxHS6LcB154wnimw3mI+61b/xqSLY+QBAbhAcYTfAhf1Z75Az0+dlaLASIT ZJxsHkU5+BpVsi8bTH2HUIo7V1gKzXNElLI3N1/3JFYPVS8S9+SZYkNXCoFYOe4U E+P3B+9VCSs1Gzq9UcghvFSgtG2I4ygXTbHxUNLIiTuYxIcOYOcWxI8NyvK7sHUZ sZXhBlaAA4PXrz2DdYp5b4nABQ0l6BU2MSTBPIB2l/cRsNLbo4Y2t3itUoWN8gCC 9zvEFKQ5/zvH5MYV1/HQP1BDLvODbjTeYUiWFs9UYI2gAhwPyzYNJkohDNGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1663925097; x=1663928697; bh=t50zxbg1je01zo3yx+LqGItWRVx6 GNoJo4k1q5aGeVg=; b=AuZv+USLGde8oMEu1C58bKJrB412oxQvNHao8ZeMUfQA 3toGUYt/r6EojSrXcwB0kK6RKwLEa8e92tPItzAJVadNejYiYoli5mtQtl3GZVjO gcELQKqq6mIy+AK5DS90bqj9AMWCr6HLIIerihmtnrIVkVOaLgbPTgESdKOLhG5S Cz9e8fwsXCsEZF9zc4jiXrjt8wcgokE8d36g+zCmzH3joAX9UJDzVw9tFlmBP52T RRlA2xQYUPVuywC6rmh5ueQJPySYTHdHddIO62mEA2531U1xP2OAR2PIDDMD8Saf tQyKLWOUXqZZtIl62/irkpR1v3qLMWgduT9FHg508Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeefiedgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id DA519B60086; Fri, 23 Sep 2022 05:24:56 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-935-ge4ccd4c47b-fm-20220914.001-ge4ccd4c4 Mime-Version: 1.0 Message-Id: <230d397d-1bf8-422b-8ce0-4a63bb451394@www.fastmail.com> In-Reply-To: References: <20220427162123.110458-1-maukka@ext.kapsi.fi> <20220922202458.7592-1-maukka@ext.kapsi.fi> <20220922202458.7592-4-maukka@ext.kapsi.fi> <89f85393-c767-4c0c-90db-d78a2927d465@www.fastmail.com> Date: Fri, 23 Sep 2022 11:24:35 +0200 From: "Arnd Bergmann" To: "Mauri Sandberg" Cc: "Rob Herring" , krzysztof.kozlowski+dt@linaro.org, "Olof Johansson" , "Andrew Lunn" , "Sebastian Hesselbarth" , "Gregory Clement" , "Russell King" , =?UTF-8?Q?Pali_Roh=C3=A1r?= , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 3/3] ARM: orion5x: Add D-Link DNS-323 based on Device Tree X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220923_022509_111437_111B80C7 X-CRM114-Status: GOOD ( 11.44 ) 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 Fri, Sep 23, 2022, at 11:13 AM, maukka@ext.kapsi.fi wrote: > On 23.9.2022 00:39, Arnd Bergmann wrote: >> Can you use simple_strntoull() to parse the address into a u64 instead? >> > Nice idea. Its current replacement seems to be kstrtoull(). Right. > I'll have to do > it byte by byte, right? Or what do you have in mind with 64bit unsigned? I misread your code and assumed it was stored as a 12-digit hexadecimal number, but you are right: with the colons you still need to iterate the bytes. I looked a little further and found the mac_pton() function that I think does exactly what you need. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel