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 X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0309C433ED for ; Wed, 7 Apr 2021 23:02:54 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 88520611C9 for ; Wed, 7 Apr 2021 23:02:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88520611C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4FG0Kl6yVBz3bqT for ; Thu, 8 Apr 2021 09:02:51 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=walle.cc header.i=@walle.cc header.a=rsa-sha256 header.s=mail2016061301 header.b=i99BezLw; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=walle.cc (client-ip=2a01:4f8:151:8464::1:2; helo=ssl.serverraum.org; envelope-from=michael@walle.cc; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=walle.cc header.i=@walle.cc header.a=rsa-sha256 header.s=mail2016061301 header.b=i99BezLw; dkim-atps=neutral Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4FFqBF5zXWz2yRJ for ; Thu, 8 Apr 2021 02:10:43 +1000 (AEST) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 18A9F22236; Wed, 7 Apr 2021 18:10:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1617811836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gjuAN9QqCnWD77UCettma95Ojaeyk86+8J2wmtLYYZo=; b=i99BezLwmPOE6w4/hGL0FvjE3br7uwuw9VGO9aRg8uJTlzeGu8Ac4FIxGX9vOQ8oMVP/r/ vE3I00R508lGU6R1pfNebHfFNtH5wO92z1+kMGfRRoMcmLezfBux9iSvegup2fWrGU4qza 5flIWUW4ulzNHWTXNBqNWa8WPLM3Izs= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 07 Apr 2021 18:10:30 +0200 From: Michael Walle To: ath9k-devel@qca.qualcomm.com, UNGLinuxDriver@microchip.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-amlogic@lists.infradead.org, linux-oxnas@groups.io, linux-omap@vger.kernel.org, linux-wireless@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH net-next v3 1/2] of: net: pass the dst buffer to of_get_mac_address() In-Reply-To: <20210406220921.24313-2-michael@walle.cc> References: <20210406220921.24313-1-michael@walle.cc> <20210406220921.24313-2-michael@walle.cc> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <50f474611ecf0f5e61c9a14a24b28773@walle.cc> X-Sender: michael@walle.cc X-Mailman-Approved-At: Thu, 08 Apr 2021 09:02:25 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , =?UTF-8?Q?J=C3=A9r=C3=B4me?= =?UTF-8?Q?_Pouiller?= , Kunihiko Hayashi , Andreas Larsson , Rob Herring , Michal Simek , Lorenzo Bianconi , Paul Mackerras , Thomas Petazzoni , =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , Nobuhiro Iwamatsu , Li Yang , Fabio Estevam , Jerome Brunet , Stephen Hemminger , Florian Fainelli , Frank Rowand , Vivien Didelot , Gregory Clement , Madalin Bucur , Russell King , Neil Armstrong , Wingman Kwok , Chen-Yu Tsai , Jose Abreu , bcm-kernel-feedback-list@broadcom.com, NXP Linux Team , Chris Snook , Jakub Kicinski , Radhey Shyam Pandey , Yisen Zhuang , Mark Lee , Sunil Goutham , Sebastian Hesselbarth , Grygorii Strashko , Byungho An , Alexandre Torgue , Stanislaw Gruszka , Martin Blumenstingl , Hauke Mehrtens , Sascha Hauer , Sean Wang , Salil Mehta , Maxime Ripard , Vladimir Zapolskiy , Claudiu Manoil , Ryder Lee , Greg Kroah-Hartman , Murali Karicheri , John Crispin , Matthias Brugger , Giuseppe Cavallaro , Pengutronix Kernel Team , Kalle Valo , Mirko Lindner , Jernej Skrabec , Vladimir Oltean , Fugang Duan , Vadym Kochan , Kevin Hilman , Bryan Whitehead , Helmut Schaa , Nicolas Ferre , "David S . Miller" , Taras Chornyi , Vinod Koul , Sergei Shtylyov , Maxime Coquelin , Joyce Ooi , Heiner Kallweit , Shawn Guo , Claudiu Beznea , Felix Fietkau Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Am 2021-04-07 00:09, schrieb Michael Walle: [..] > diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c > index bc0a27de69d4..2d5d5e59aea5 100644 > --- a/drivers/of/of_net.c > +++ b/drivers/of/of_net.c > @@ -45,42 +45,35 @@ int of_get_phy_mode(struct device_node *np, > phy_interface_t *interface) > } > EXPORT_SYMBOL_GPL(of_get_phy_mode); > > -static const void *of_get_mac_addr(struct device_node *np, const char > *name) > +static int of_get_mac_addr(struct device_node *np, const char *name, > u8 *addr) > { > struct property *pp = of_find_property(np, name, NULL); > > - if (pp && pp->length == ETH_ALEN && is_valid_ether_addr(pp->value)) > - return pp->value; > - return NULL; > + if (pp && pp->length == ETH_ALEN && is_valid_ether_addr(pp->value)) { > + ether_addr_copy(addr, pp->value); Mh, I guess this should rather be memcpy(addr, pp->value, ETH_ALEN) because ether_addr_copy() needs 2 byte aligned source and destination buffers. -michael