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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 E806DC43603 for ; Wed, 7 Apr 2021 16:10:54 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 8E90C610E8 for ; Wed, 7 Apr 2021 16:10:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E90C610E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:Cc:To:From :Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zI9MANZYr66rbAkJBp9VFh5q81Ya1km+wwlcPjgDJOU=; b=HdlzGUjaI/xQfihjgSWIAsV++ PTgrpBXT2DReVrzS3qFZFsOr759D0xGaMiGHUw6VsjArGngFUyM4rRAhMJpVJHT7CnC80S1QItgHa 1NZ7KryBcWGg2I1000TCBfCjDkDqd6Yohew5N7nfkbItG359GVtWz6DMX35h1RvhVAYRgo/Qunwm2 DjQqGExexmApR09xocfXHjRRp4n3+OLDovGFHjtvxcvc2qqSULTZMGrQnERHP1btEwme5covf73oE zAkYOdThS7K69rvU3JXisFU8j2cbWwbFMjbpxbGTP0KwdxwyXzvYczbm7BfS1/5TsPUaZwfm3Jl8C i/ImHxCqg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUAlT-005Q0s-IN; Wed, 07 Apr 2021 16:10:47 +0000 Received: from ssl.serverraum.org ([2a01:4f8:151:8464::1:2]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUAlP-005PzQ-Fc; Wed, 07 Apr 2021 16:10:45 +0000 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 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 Cc: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Russell King , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Andreas Larsson , "David S . Miller" , Jakub Kicinski , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Joyce Ooi , Chris Snook , =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , bcm-kernel-feedback-list@broadcom.com, Florian Fainelli , Nicolas Ferre , Claudiu Beznea , Sunil Goutham , Fugang Duan , Madalin Bucur , Pantelis Antoniou , Claudiu Manoil , Li Yang , Yisen Zhuang , Salil Mehta , Hauke Mehrtens , Thomas Petazzoni , Vadym Kochan , Taras Chornyi , Mirko Lindner , Stephen Hemminger , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Matthias Brugger , Bryan Whitehead , Vladimir Zapolskiy , Sergei Shtylyov , Byungho An , Kunihiko Hayashi , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Vinod Koul , Nobuhiro Iwamatsu , Grygorii Strashko , Wingman Kwok , Murali Karicheri , Michal Simek , Radhey Shyam Pandey , Kalle Valo , Lorenzo Bianconi , Ryder Lee , Stanislaw Gruszka , Helmut Schaa , Heiner Kallweit , Rob Herring , Frank Rowand , Greg Kroah-Hartman , =?UTF-8?Q?J=C3=A9r=C3=B4me?= =?UTF-8?Q?_Pouiller?= , Vivien Didelot , Vladimir Oltean 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210407_171043_651294_90BD2036 X-CRM114-Status: GOOD ( 12.50 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic