From patchwork Mon Jan 20 11:13:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Jensen X-Patchwork-Id: 3511651 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 966D49F2D6 for ; Mon, 20 Jan 2014 11:20:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D59EA2015D for ; Mon, 20 Jan 2014 11:20:56 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AEFBB2010E for ; Mon, 20 Jan 2014 11:20:55 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5CuQ-0007fu-Ch; Mon, 20 Jan 2014 11:20:50 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5CuN-0002If-RM; Mon, 20 Jan 2014 11:20:47 +0000 Received: from mail-lb0-x22e.google.com ([2a00:1450:4010:c04::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W5CuL-0002Gz-2Q for linux-arm-kernel@lists.infradead.org; Mon, 20 Jan 2014 11:20:45 +0000 Received: by mail-lb0-f174.google.com with SMTP id l4so3214533lbv.33 for ; Mon, 20 Jan 2014 03:20:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yOzM2yBaYm1JZiA/hnKxHA+GMhJiYCLj+8fpg16S6so=; b=u207L17MQn3Dy4yzbLNiFD9ob87ynH4QS6X7G2AAHR2d/JhOVFcwUxfOctyXLV32hR D9F5DwIbudnAUllr0oYJeIGL+Xzg9Qty1vE5Y2ImzAHUbVHsmL6I9129VIPtLAoicg6c iaJEuM4vMxJtBFGOU1Oqs1KQdiGhY+N2Pkj1ooAwUWGzrSxB4NWoVFeGovVRyquWg2r7 qj9iBkQnYGPBRvl546HuryxlFEERZTLjeCBr+mOND8RxYAJt06oBE8PitOVhszYhivuY vsr6kNEnZRISf1dRD5wgDQEaXi0NzgcHQvU/vdFc+1Zu11ouIpXSrP2zfUGz5g88mxDq EXoA== X-Received: by 10.112.181.232 with SMTP id dz8mr11014512lbc.8.1390216443270; Mon, 20 Jan 2014 03:14:03 -0800 (PST) Received: from Ildjarn.ath.cx (static-213-115-41-10.sme.bredbandsbolaget.se. [213.115.41.10]) by mx.google.com with ESMTPSA id sv5sm551815lbb.9.2014.01.20.03.14.01 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 20 Jan 2014 03:14:02 -0800 (PST) From: Jonas Jensen To: netdev@vger.kernel.org Subject: [PATCH v3 7/7] net: moxa: use eth_mac_addr() Date: Mon, 20 Jan 2014 12:13:19 +0100 Message-Id: <1390216399-27028-7-git-send-email-jonas.jensen@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1390216399-27028-1-git-send-email-jonas.jensen@gmail.com> References: <1390216399-27028-1-git-send-email-jonas.jensen@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140120_062045_276972_78AFCD0B X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) Cc: f.fainelli@gmail.com, linux-kernel@vger.kernel.org, Jonas Jensen , bhutchings@solarflare.com, davem@davemloft.net, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace boilerplate in moxart_set_mac_address() with eth_mac_addr(). Signed-off-by: Jonas Jensen --- Notes: Applies to next-20140120 drivers/net/ethernet/moxa/moxart_ether.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c index 0f25f4dc..8378be9 100644 --- a/drivers/net/ethernet/moxa/moxart_ether.c +++ b/drivers/net/ethernet/moxa/moxart_ether.c @@ -56,12 +56,7 @@ static void moxart_update_mac_address(struct net_device *ndev) static int moxart_set_mac_address(struct net_device *ndev, void *addr) { - struct sockaddr *address = addr; - - if (!is_valid_ether_addr(address->sa_data)) - return -EADDRNOTAVAIL; - - memcpy(ndev->dev_addr, address->sa_data, ndev->addr_len); + eth_mac_addr(ndev, addr); moxart_update_mac_address(ndev); return 0;