From patchwork Sun Apr 29 15:56:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Ricardo Leitner X-Patchwork-Id: 906379 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Kua39/qJ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40YtX265yDz9s08 for ; Mon, 30 Apr 2018 02:33:22 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754029AbeD2QdU (ORCPT ); Sun, 29 Apr 2018 12:33:20 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:44361 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753849AbeD2QdR (ORCPT ); Sun, 29 Apr 2018 12:33:17 -0400 Received: by mail-qt0-f194.google.com with SMTP id d3-v6so8333247qtp.11; Sun, 29 Apr 2018 09:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Oay+HvKJ0DiXcF/KpUkqCO/rN892QOEt4Wg8lGS5PD4=; b=Kua39/qJzeblub0HJBnP/P0AAHpkXBAvE3ln8CuFzezZ68GgH5oXQzjHV9iHhS0smS P1Jww+w6SV/nhEUKRdKJ7nyqi75dlw53nxrGl4MoSfJtAn6Tu1HbKBcPYtTh2d3P6+QY Ad5OT/EtlNgwtwcqOEhCA1T1xpUGWwaP2xnox3JYYAB+7INYW3q1zYd4mC7o49ildCH0 kHszJYUA3Gq3r58IT7shoO1HQyLoHLuoezUTAoGVOCeN2eW+XwtNtb/0BtbzI1YEhmEa 1tsXGD3yFnNgBeXe8UEVvntDFihdD0xIioOUydezsAT+wykmIK9BcwHof4akn084YHuo gKlQ== 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; bh=Oay+HvKJ0DiXcF/KpUkqCO/rN892QOEt4Wg8lGS5PD4=; b=KxsE1mvOhl8TZmrHNeWCGnzPaOhFJVVNlnKXM3FlxNbo+jPk/Yh1UF2u/p03IBAUu+ onQ4hHBung4lwIUVfIbZXSmw8Ib4vg5oqOklJE70fPNF5tJPU9YX8K5vTFMH396jp8FE qo0pe1JBZddaUJyLKkR8YuFGp4s6SNFtDmVp+TmdkRbeQQYHS2/XvX8Qss1fzKaZ3qes 9F93lyD+pevvzJaDQTzoZD1ANXJb1guoUEiaWj+yy1A/wP7gUWauGERfV8FE95t7lAK+ u/QJhGbypXQFKhGrq1ulZCWr2/7uR201XzY4Xq6GMw12BXnRe025Mqv3pXXZXnGveM8R BsoQ== X-Gm-Message-State: ALQs6tA9MXlfdvFS3nDeBdgzCqoghAEn1u+ICyIJxZZY7uiPwvwwRBY+ azvdd/ZcP5GXK3pC03eBMSA= X-Google-Smtp-Source: AB8JxZrOtpynA8bK0iqO9OuqWMQjtFgGZkPyEgI/2UPMNPsTg6uDU+TLAy+bDyyTNtY7irpC7PGQ8w== X-Received: by 2002:a0c:ac83:: with SMTP id m3-v6mr8886666qvc.12.1525019596623; Sun, 29 Apr 2018 09:33:16 -0700 (PDT) Received: from localhost.localdomain ([177.10.56.95]) by smtp.gmail.com with ESMTPSA id 96sm5238227qkx.71.2018.04.29.09.33.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Apr 2018 09:33:16 -0700 (PDT) Received: by localhost.localdomain (Postfix, from userid 89) id 997CB180FB4; Sun, 29 Apr 2018 13:35:35 -0300 (-03) Received: by localhost.localdomain (Postfix, from userid 89) id 9C10F181009; Sun, 29 Apr 2018 13:25:30 -0300 (-03) Received: by localhost.localdomain (Postfix, from userid 89) id 9D52E180FB4; Sun, 29 Apr 2018 13:01:57 -0300 (-03) Received: by localhost.localdomain (Postfix, from userid 1000) id B5539180916; Sun, 29 Apr 2018 12:56:37 -0300 (-03) From: Marcelo Ricardo Leitner To: netdev@vger.kernel.org Cc: linux-sctp@vger.kernel.org, Vlad Yasevich , Neil Horman , Xin Long Subject: [PATCH net-next 0/2] sctp: unify sctp_make_op_error_fixed and sctp_make_op_error_space Date: Sun, 29 Apr 2018 12:56:30 -0300 Message-Id: X-Mailer: git-send-email 2.14.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org These two variants are very close to each other and can be merged to avoid code duplication. That's what this patchset does. First, we allow sctp_init_cause to return errors, which then allow us to add sctp_make_op_error_limited that handles both situations. Marcelo Ricardo Leitner (2): sctp: allow sctp_init_cause to return errors sctp: add sctp_make_op_error_limited and reuse inner functions include/net/sctp/sm.h | 2 +- net/sctp/sm_make_chunk.c | 134 ++++++++++++++++++----------------------------- 2 files changed, 52 insertions(+), 84 deletions(-) --- 2.14.3