From patchwork Fri Oct 12 15:28:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 148789 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp868652lji; Fri, 12 Oct 2018 08:28:26 -0700 (PDT) X-Google-Smtp-Source: ACcGV62rKJVhWFDsPx5qrP3LhFL8g1OjnWfSZpNPlwswxMVKuk/WPl1dkgGL4pzoSXvr0LsueXoT X-Received: by 2002:a63:e505:: with SMTP id r5-v6mr5854116pgh.170.1539358105985; Fri, 12 Oct 2018 08:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539358105; cv=none; d=google.com; s=arc-20160816; b=U3UuS+kcb5h0w9WQ+HRwoVhczTORPDC672gFr8viUa8NIENsdu3vVYUrrpMPmUxQs+ ZU3w82PMsTnwWTTDQ6EOba6i91A+PIt5hVgcDttPjB95V7jkR6UUZ4CSRGKS7RRIhDrw 3HBy9adA0ixAzU8jWE8y3ImK68T0C8Jylj5kojGBhLNZqJHeN49sUnxtIpSD1acN6bW8 z268mX3pLoqiEo/QiUD3CGEPQ+VW2gV7ol/EKAKZxkN8qTe8tOsqRdd1gzuUB7TSiOJT tnqOP/Kayqhl7I5LY+R/0nN/k3jhQRGtlwtOQKR63TZXBewdeDUAnHCNGgl/u1JMJSXA r+cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=GFM2oP3MJfc+130hzvOJu+Jv6lZMWZtKqWiyV/fnKNk=; b=VixHTSXUtKdM1AhHBqlsEtZc2exo9HJpSaUR5Y8fzQm4pSSAUwBt3uQqukqxrRcNTj pzmjl7qBGIvVDrCjqFB6Ir4cSuq6J61JQ+ldnZbwY8mPulYw0NLb3FcCF+kvahsXiHnt Ym1XAA+h0KT0dIq/kF/IH6rtmNMz3Ng7tSW5tpl6oMfi/sunw/2K0tF/Okb5lWd1qdR/ UTBiGezPSaKDWZcmgvxbGWvyL6Fqkr2ONwUwkEvDD8VzCJkw4KeHWHKyF342Bi12BdgV eLZKsOAkas8L5pVdtR/m7o7BW/hdRPqxNU7eaCqE3mwRkvd7+moYE62Z7mPiWK6xFl8H rJKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DCbpw9Sq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4-v6si1548342pgh.563.2018.10.12.08.28.25; Fri, 12 Oct 2018 08:28:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DCbpw9Sq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729141AbeJLXBW (ORCPT + 32 others); Fri, 12 Oct 2018 19:01:22 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:38836 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729143AbeJLXBV (ORCPT ); Fri, 12 Oct 2018 19:01:21 -0400 Received: by mail-lf1-f65.google.com with SMTP id g89-v6so9620782lfl.5 for ; Fri, 12 Oct 2018 08:28:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GFM2oP3MJfc+130hzvOJu+Jv6lZMWZtKqWiyV/fnKNk=; b=DCbpw9SqEnBsxxnOjmDWA6tPBCsJEHbvE81wQAuuLOI6ABDrTHgGnE0uuaDF/wnUM5 fQswoFyMc7CB5tHUBsuyAoVusKd98O8kE9iqdgvAZuR53eExLnGd/uoEXD0gG+wbNnmg in9GtPPJdrRVZcQHD+/JM72btWSzzSTyGToaE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GFM2oP3MJfc+130hzvOJu+Jv6lZMWZtKqWiyV/fnKNk=; b=aDGwyKbLzvKvz8mydm2ZrUREUZ70ehBGiXAGIotAMbhiNjjmvihjxzQJFHlyVfV01B kWYUyoYIpf+WNt58sUB9hvMoyzVfzCxuNEMkyPzJwUCnfVAVHl9xdmewn4clCb6EMsQ6 UQvg1xmT+bdZ0zC8WqM/V8XZuzv2PoMUcDTZ8AP71e7xsBzczSUgxUHL63X2hjLZb2ud 1Fmso9if/Zf5CRcNQdq+q8THTJpQbSY1hUx+VdsFzXFtjBzv1Nezdl+yaJcNhTBzj+g7 m7xcvrc8d2yE5RqJX0VYlLAZjLr0cG4gpwi8P5g5H+r3uKqMx2tUAF+JBQy8MYCNWrXd iB7w== X-Gm-Message-State: ABuFfogsekEMNLHGz0pscEyt0XXe6Vxrsn2SXoBc+uyWc+GZcgZyrCxh DfwQ5EdAJxtzfuM1BLshgSSZMUK8/ZU= X-Received: by 2002:a19:1063:: with SMTP id f96-v6mr4115224lfi.88.1539358100626; Fri, 12 Oct 2018 08:28:20 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id a63-v6sm325923ljf.54.2018.10.12.08.28.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 08:28:19 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, davem@davemloft.net Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH 1/2] net: ethernet: ti: cpsw_ale: use const for API having pointer on mac address Date: Fri, 12 Oct 2018 18:28:14 +0300 Message-Id: <20181012152815.31320-2-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181012152815.31320-1-ivan.khoronzhuk@linaro.org> References: <20181012152815.31320-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It allows to use function under callbacks with same const qualifier of mac address for farther changes. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw_ale.c | 12 ++++++------ drivers/net/ethernet/ti/cpsw_ale.h | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c index 5766225a4ce1..798c989d5d93 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.c +++ b/drivers/net/ethernet/ti/cpsw_ale.c @@ -136,7 +136,7 @@ static inline void cpsw_ale_get_addr(u32 *ale_entry, u8 *addr) addr[i] = cpsw_ale_get_field(ale_entry, 40 - 8*i, 8); } -static inline void cpsw_ale_set_addr(u32 *ale_entry, u8 *addr) +static inline void cpsw_ale_set_addr(u32 *ale_entry, const u8 *addr) { int i; @@ -175,7 +175,7 @@ static int cpsw_ale_write(struct cpsw_ale *ale, int idx, u32 *ale_entry) return idx; } -static int cpsw_ale_match_addr(struct cpsw_ale *ale, u8 *addr, u16 vid) +static int cpsw_ale_match_addr(struct cpsw_ale *ale, const u8 *addr, u16 vid) { u32 ale_entry[ALE_ENTRY_WORDS]; int type, idx; @@ -309,7 +309,7 @@ static inline void cpsw_ale_set_vlan_entry_type(u32 *ale_entry, } } -int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port, +int cpsw_ale_add_ucast(struct cpsw_ale *ale, const u8 *addr, int port, int flags, u16 vid) { u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0}; @@ -336,7 +336,7 @@ int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port, } EXPORT_SYMBOL_GPL(cpsw_ale_add_ucast); -int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port, +int cpsw_ale_del_ucast(struct cpsw_ale *ale, const u8 *addr, int port, int flags, u16 vid) { u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0}; @@ -352,7 +352,7 @@ int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port, } EXPORT_SYMBOL_GPL(cpsw_ale_del_ucast); -int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask, +int cpsw_ale_add_mcast(struct cpsw_ale *ale, const u8 *addr, int port_mask, int flags, u16 vid, int mcast_state) { u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0}; @@ -386,7 +386,7 @@ int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask, } EXPORT_SYMBOL_GPL(cpsw_ale_add_mcast); -int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask, +int cpsw_ale_del_mcast(struct cpsw_ale *ale, const u8 *addr, int port_mask, int flags, u16 vid) { u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0}; diff --git a/drivers/net/ethernet/ti/cpsw_ale.h b/drivers/net/ethernet/ti/cpsw_ale.h index d4fe9016429b..cd07a3e96d57 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.h +++ b/drivers/net/ethernet/ti/cpsw_ale.h @@ -105,13 +105,13 @@ void cpsw_ale_start(struct cpsw_ale *ale); void cpsw_ale_stop(struct cpsw_ale *ale); int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid); -int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port, +int cpsw_ale_add_ucast(struct cpsw_ale *ale, const u8 *addr, int port, int flags, u16 vid); -int cpsw_ale_del_ucast(struct cpsw_ale *ale, u8 *addr, int port, +int cpsw_ale_del_ucast(struct cpsw_ale *ale, const u8 *addr, int port, int flags, u16 vid); -int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask, +int cpsw_ale_add_mcast(struct cpsw_ale *ale, const u8 *addr, int port_mask, int flags, u16 vid, int mcast_state); -int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask, +int cpsw_ale_del_mcast(struct cpsw_ale *ale, const u8 *addr, int port_mask, int flags, u16 vid); int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port, int untag, int reg_mcast, int unreg_mcast);