From patchwork Fri Mar 15 14:33:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 10854877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A03D14DE for ; Fri, 15 Mar 2019 14:33:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 032CF2AA4F for ; Fri, 15 Mar 2019 14:33:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBE0D2AA5E; Fri, 15 Mar 2019 14:33:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7E912AA4F for ; Fri, 15 Mar 2019 14:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729286AbfCOOd2 (ORCPT ); Fri, 15 Mar 2019 10:33:28 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:44030 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729221AbfCOOd2 (ORCPT ); Fri, 15 Mar 2019 10:33:28 -0400 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.91) (envelope-from ) id 1h4ntm-0004kR-5m; Fri, 15 Mar 2019 16:33:26 +0200 From: Luca Coelho To: backports@vger.kernel.org Cc: Luca Coelho Date: Fri, 15 Mar 2019 16:33:15 +0200 Message-Id: <20190315143318.4714-4-luca@coelho.fi> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190315143318.4714-1-luca@coelho.fi> References: <20190315143318.4714-1-luca@coelho.fi> MIME-Version: 1.0 Subject: [PATCH 3/6] backport: add atomic_fetch_add_unless() Sender: backports-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: backports@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luca Coelho The iwlwifi driver now needs this function. Backport it. Signed-off-by: Luca Coelho --- backport/backport-include/linux/atomic.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backport/backport-include/linux/atomic.h b/backport/backport-include/linux/atomic.h index b4dd2e1d34f0..9ceb586e864a 100644 --- a/backport/backport-include/linux/atomic.h +++ b/backport/backport-include/linux/atomic.h @@ -51,4 +51,13 @@ #endif /* atomic_try_cmpxchg_acquire */ +#if LINUX_VERSION_IS_LESS(4,19,0) +#ifndef atomic_fetch_add_unless +static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u) +{ + return __atomic_add_unless(v, a, u); +} +#endif +#endif + #endif /* __BP_ATOMIC_H */