From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by dpdk.org (Postfix) with ESMTP id A0524AD8D for ; Wed, 2 Mar 2016 00:09:15 +0100 (CET) Received: by mail-pf0-f181.google.com with SMTP id 124so59543063pfg.0 for ; Tue, 01 Mar 2016 15:09:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JznI7BvD961eC6H2NwDvyzCnT4d6r2j5ih81EBx1cm8=; b=gtU9jkUUE656F4CcuGSWeqEHyP8FmLX1nH8IphuzK2LrZJ8lB7Bzj4wBWPxLd01o3w nmLatS9pjlNbsOQRKpSxNdnIK3L+r92ey+Ajz15nNQh0WqcLRcPUtOHWkfKQr6TDMLPU Ocb6N1SSGwVqvlloYPr8pjNChHYiijiMIs5MlohSt9Y2sWxEDpYbRSIeLdUHvMlgOdW4 mQC5WdCosLLqCPoMzfYhMi0Hrtb7yuGJqwhRnLzg6s5AOBxo+HGDyD4F6BisGIeQooPO fPAxtM9rwMpzW2r11ZtspqkyfdnfDLDklnX9qXLu1LejF834f4vILlvzX6YJvHv/BeX8 XqyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JznI7BvD961eC6H2NwDvyzCnT4d6r2j5ih81EBx1cm8=; b=CRourQlGg3vH4q5yxn491k2NRIyt3t3St2IJ0HYaz86ILmy1sKLHP/QxRT7hi6G7Ir fMBkSnTYOrXgbKN+IgKt8sDPkRJbHj2I1BGExSM71FtOdARRY6+E9N6VvJYq2rTmZebn sKq6oyNBo6pWVFFeSo1kbEOb4tdauyQcYwrTGKiYLp5NS6ZGAHQsvifwQ33VfpDViJR7 SNSwML/Aah9rL0W1EhhhPSpPr7toumXFuFK2kHWFM+D1FB96UQUyfnq5HY7UT5U4ekSX CWnph0X4dE5UvjpmiNpVLvagPt6yrc1XotnWSKqRFC7SqrVWH3lwj+4zxlo6PQYHb7Ym 9gGA== X-Gm-Message-State: AD7BkJL9bVgCsR2XCSdyYUOgIafpSkdQfv3Idb1u9hWVNSEtASqLOK1jbgf08a4UtYI6iw== X-Received: by 10.98.67.8 with SMTP id q8mr33921970pfa.133.1456873755062; Tue, 01 Mar 2016 15:09:15 -0800 (PST) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id l24sm47865394pfb.73.2016.03.01.15.09.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Mar 2016 15:09:14 -0800 (PST) Date: Tue, 1 Mar 2016 15:09:28 -0800 From: Stephen Hemminger To: Ferruh Yigit Message-ID: <20160301150928.2301e386@xeon-e3> In-Reply-To: <1456846920-28770-3-git-send-email-ferruh.yigit@intel.com> References: <1456495841-15749-1-git-send-email-ferruh.yigit@intel.com> <1456846920-28770-1-git-send-email-ferruh.yigit@intel.com> <1456846920-28770-3-git-send-email-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v4 2/4] kcp: add kernel control path kernel module X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2016 23:09:16 -0000 On Tue, 1 Mar 2016 15:41:58 +0000 Ferruh Yigit wrote: > + > +static int kcp_net_set_mac(struct net_device *dev, void *p) > +{ > + struct sockaddr *addr = p; > + int err = 0; Unnecessary assignment. > + > + if (!is_valid_ether_addr((unsigned char *)(addr->sa_data))) No cast needed: if (!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL; > + return -EADDRNOTAVAIL; > + Don't you want to validate that dev->addr_len == ETHER_ADDR_LEN? > + err = kcp_nl_exec(RTE_KCP_REQ_SET_MAC, dev, addr->sa_data, > + dev->addr_len, NULL, 0); > + if (err < 0) > + return -EADDRNOTAVAIL; > + > + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); > + > + return 0; > +} > +