Received: by 10.223.164.202 with SMTP id h10csp1191090wrb; Tue, 7 Nov 2017 23:48:24 -0800 (PST) X-Google-Smtp-Source: ABhQp+TD0OaoOR1MMKJN4wiR3sb1WVcOrGKNDkWMC+gnmw/KsjFx4dVSN4o/z8H+BouT5oF/j+nf X-Received: by 10.98.75.71 with SMTP id y68mr1620715pfa.45.1510127304524; Tue, 07 Nov 2017 23:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510127304; cv=none; d=google.com; s=arc-20160816; b=HPMAADFNCzp1NelkCg+gteuJy3nGdfLq7I0UkCi1RdQH0k5WKfi8TnO2iKJ55iwwIf +hJZTQMVf/zgCftV/Pq0zbW0OiNojfJb0ZGGlenfPJQc1JfJgIDy8AJaJkPURHM50LhA aqpa4mD6EbVkPiE4c2ODfj566+DRH8pOU6xLe+/5pO0ev+MTFMoQwKbWX+gsQTUhkkqT kyCVEN60U88nmcFiJCreBSc0CUMAxWSFugh6vVLejkeGpyzSDJJvLco26t5AcQXv3GoL duIfrAqzaOZ5SDD53jPBmlbtSms7VLwG6fJPMYh6gdQOtAhDsEstu0I9qM73BZq+XbNS mpjA== 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:dkim-signature :arc-authentication-results; bh=hkq8sk9+tYrJRXBQU8lmKRt1vl7x/Epdno6Dh0cHLIo=; b=WKuJDkQ/tT8pMg+ITBAz/I85rr+ukUVW9NWZXAlDlSKYZmXl/0B5go2gxgQQbPXMs7 adWUCZGl5tzJIeNo7pitN9tVTFR2x5Gbz7sABFg9Vg8cnkT5XzEi097uXAYnKxNmE7/s 1Tzgsuxlb9j+xS+c68xrbxtU3t9diCmRRBVHXd5MbmlENb8dU0gQzICruQtJIODtq9G9 DPCXFnFt9tKa1YHYA4ZUqgtWqBgR2+3E89CM5pEn2Saxc9N/oIGG7PJWGoE5uA98Yw1J cwRz42pQZ25Ud2NS/MhK0R0ejJf6eXyad+sc2HQdM25Bei0d20Y1QRGq5xqU0fYXFvHK r27w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mendozajonas.com header.s=fm1 header.b=WKNs0rxu; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=is/pUw07; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u66si3447123pfa.109.2017.11.07.23.48.11; Tue, 07 Nov 2017 23:48:24 -0800 (PST) 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=@mendozajonas.com header.s=fm1 header.b=WKNs0rxu; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=is/pUw07; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753200AbdKHFbF (ORCPT + 91 others); Wed, 8 Nov 2017 00:31:05 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:43015 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752526AbdKHFbB (ORCPT ); Wed, 8 Nov 2017 00:31:01 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id C3F5420CC1; Wed, 8 Nov 2017 00:31:00 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 08 Nov 2017 00:31:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= mendozajonas.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=hkq8sk9+tYrJRXBQU8lmKRt1vl7x/Epdno6Dh0cHLIo=; b=WKNs0rxu VtiOkBnjHfumknmJY2kjbziReJtopecvhU/Kh3r0D3W5M3kcya/kM7m7Bk1RyK3B Ofs8VVtH+qU27o7XxvGGPIx+zUuSXo1h85vXVIEJiy5P7yLgW6JlsT1zW44XVAbe U/P/6TdseAhVjYwyK1z/m/aKEJx0LqFpqXMLnvQJPsBdEp+rKUl+20czjCy94Ott LDbmXBwmyNVaxn6gIJmD0+GhWqQl64onKdL5/sJDOSwpQT6qJPFjgPNLdNvryb5M mtIRkq1qfkTbv5H9QL1hXN6q2sHktCqGe7UkhD8tKpEFQzDDnIGB5vth6I4IlZfp v3fiPIa/RqlaSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=hkq8sk9+tYrJRXBQU8lmKRt1vl7x/Epdno6Dh0cHLIo=; b=is/pUw07 WsRCLVw1D5dtM1T2dp2C0h8iAYElnuJXZ7D/DjSO/aKgg+DOiH70fkgzSRFLDa0J 01p/vAs9k4REXVsv7JxXWDKoGuZcy7P+VM/qxDljuHWzo+ER4XXw1IacD6EwFzjS zAj7xdX+1iqw39jNIARMpF/QgH6EXk8hfWOYUaytMf9Srno0jEp9AOnSp99N2Drl px8qyT6Qs+M9cdqHiZq86T2x0FgUIID//ixedurYOwEiYa6nm5XdWE56COndf3ep 0CaSlQusWoLmnxyz5HlxrdK4ndiMnsAhlKeXR0yV0qi/HWDoQPtK86XcjgQx1oEc LSWXgWPQaeCiHQ== X-ME-Sender: Received: from v4.ozlabs.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 3F86024C61; Wed, 8 Nov 2017 00:30:59 -0500 (EST) From: Samuel Mendoza-Jonas To: netdev@vger.kernel.org Cc: Samuel Mendoza-Jonas , "David S . Miller" , linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/2] net/ncsi: Don't return error on normal response Date: Wed, 8 Nov 2017 16:30:45 +1100 Message-Id: <20171108053045.1961-2-sam@mendozajonas.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171108053045.1961-1-sam@mendozajonas.com> References: <20171108053045.1961-1-sam@mendozajonas.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Several response handlers return EBUSY if the data corresponding to the command/response pair is already set. There is no reason to return an error here; the channel is advertising something as enabled because we told it to enable it, and it's possible that the feature has been enabled previously. Signed-off-by: Samuel Mendoza-Jonas --- net/ncsi/ncsi-rsp.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c index 58186c4102f0..efd933ff5570 100644 --- a/net/ncsi/ncsi-rsp.c +++ b/net/ncsi/ncsi-rsp.c @@ -146,7 +146,7 @@ static int ncsi_rsp_handler_ec(struct ncsi_request *nr) ncm = &nc->modes[NCSI_MODE_ENABLE]; if (ncm->enable) - return -EBUSY; + return 0; ncm->enable = 1; return 0; @@ -173,7 +173,7 @@ static int ncsi_rsp_handler_dc(struct ncsi_request *nr) ncm = &nc->modes[NCSI_MODE_ENABLE]; if (!ncm->enable) - return -EBUSY; + return 0; ncm->enable = 0; return 0; @@ -217,7 +217,7 @@ static int ncsi_rsp_handler_ecnt(struct ncsi_request *nr) ncm = &nc->modes[NCSI_MODE_TX_ENABLE]; if (ncm->enable) - return -EBUSY; + return 0; ncm->enable = 1; return 0; @@ -239,7 +239,7 @@ static int ncsi_rsp_handler_dcnt(struct ncsi_request *nr) ncm = &nc->modes[NCSI_MODE_TX_ENABLE]; if (!ncm->enable) - return -EBUSY; + return 0; ncm->enable = 1; return 0; @@ -263,7 +263,7 @@ static int ncsi_rsp_handler_ae(struct ncsi_request *nr) /* Check if the AEN has been enabled */ ncm = &nc->modes[NCSI_MODE_AEN]; if (ncm->enable) - return -EBUSY; + return 0; /* Update to AEN configuration */ cmd = (struct ncsi_cmd_ae_pkt *)skb_network_header(nr->cmd); @@ -382,7 +382,7 @@ static int ncsi_rsp_handler_ev(struct ncsi_request *nr) /* Check if VLAN mode has been enabled */ ncm = &nc->modes[NCSI_MODE_VLAN]; if (ncm->enable) - return -EBUSY; + return 0; /* Update to VLAN mode */ cmd = (struct ncsi_cmd_ev_pkt *)skb_network_header(nr->cmd); @@ -409,7 +409,7 @@ static int ncsi_rsp_handler_dv(struct ncsi_request *nr) /* Check if VLAN mode has been enabled */ ncm = &nc->modes[NCSI_MODE_VLAN]; if (!ncm->enable) - return -EBUSY; + return 0; /* Update to VLAN mode */ ncm->enable = 0; @@ -455,13 +455,10 @@ static int ncsi_rsp_handler_sma(struct ncsi_request *nr) bitmap = &ncf->bitmap; if (cmd->at_e & 0x1) { - if (test_and_set_bit(cmd->index, bitmap)) - return -EBUSY; + set_bit(cmd->index, bitmap); memcpy(ncf->data + 6 * cmd->index, cmd->mac, 6); } else { - if (!test_and_clear_bit(cmd->index, bitmap)) - return -EBUSY; - + clear_bit(cmd->index, bitmap); memset(ncf->data + 6 * cmd->index, 0, 6); } @@ -485,7 +482,7 @@ static int ncsi_rsp_handler_ebf(struct ncsi_request *nr) /* Check if broadcast filter has been enabled */ ncm = &nc->modes[NCSI_MODE_BC]; if (ncm->enable) - return -EBUSY; + return 0; /* Update to broadcast filter mode */ cmd = (struct ncsi_cmd_ebf_pkt *)skb_network_header(nr->cmd); @@ -511,7 +508,7 @@ static int ncsi_rsp_handler_dbf(struct ncsi_request *nr) /* Check if broadcast filter isn't enabled */ ncm = &nc->modes[NCSI_MODE_BC]; if (!ncm->enable) - return -EBUSY; + return 0; /* Update to broadcast filter mode */ ncm->enable = 0; @@ -538,7 +535,7 @@ static int ncsi_rsp_handler_egmf(struct ncsi_request *nr) /* Check if multicast filter has been enabled */ ncm = &nc->modes[NCSI_MODE_MC]; if (ncm->enable) - return -EBUSY; + return 0; /* Update to multicast filter mode */ cmd = (struct ncsi_cmd_egmf_pkt *)skb_network_header(nr->cmd); @@ -564,7 +561,7 @@ static int ncsi_rsp_handler_dgmf(struct ncsi_request *nr) /* Check if multicast filter has been enabled */ ncm = &nc->modes[NCSI_MODE_MC]; if (!ncm->enable) - return -EBUSY; + return 0; /* Update to multicast filter mode */ ncm->enable = 0; @@ -591,7 +588,7 @@ static int ncsi_rsp_handler_snfc(struct ncsi_request *nr) /* Check if flow control has been enabled */ ncm = &nc->modes[NCSI_MODE_FC]; if (ncm->enable) - return -EBUSY; + return 0; /* Update to flow control mode */ cmd = (struct ncsi_cmd_snfc_pkt *)skb_network_header(nr->cmd); -- 2.14.3 From 1583946056385162632@xxx Mon Nov 13 10:24:32 +0000 2017 X-GM-THRID: 1583796983750915074 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread