From patchwork Wed Oct 24 13:42:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1638461 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2EDAFDF2AB for ; Wed, 24 Oct 2012 13:42:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934820Ab2JXNmG (ORCPT ); Wed, 24 Oct 2012 09:42:06 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:55408 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934675Ab2JXNmF (ORCPT ); Wed, 24 Oct 2012 09:42:05 -0400 Received: by mail-bk0-f46.google.com with SMTP id jk13so257190bkc.19 for ; Wed, 24 Oct 2012 06:42:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=Lz2KiPuaomUvku48UjdxCaFXfwNH0nJReOAMIJdakuQ=; b=ObZUXViBnaOnMHiHyZ55PJJZvB/jSjXj1rIKCR7t7PdUj85Rttt75NLRhcQJ401ZoZ bLgb4Qbmw1TpffOy0+5amopxE8gYp1uDOijOvZ/rCzWpKTNfF04IINtFa8KOdgMbeESk P8PT/NrmyAdPd2l/XUR7yEqoM+FFVAI/44gotud5532SkyxnZJzC4NTxsJz1wHE08w9M /syFZozBc7Xk3KEcwt87ayjo6ZKyXXagpuVvF//HJdOIAtPvpbN0QCgMwrsGNCxJ0fRD yP7OmwjEGVu+KLHKplPRdtR75ZvOowCP6NgwKcAYc6P36vs/3bk/x2Q3VtBA5bKKOHP0 zmLA== Received: by 10.204.148.89 with SMTP id o25mr4835374bkv.11.1351086124255; Wed, 24 Oct 2012 06:42:04 -0700 (PDT) Received: from [192.168.1.102] (c-71-192-10-85.hsd1.ma.comcast.net. [71.192.10.85]) by mx.google.com with ESMTPS id z22sm8152979bkw.2.2012.10.24.06.42.02 (version=SSLv3 cipher=OTHER); Wed, 24 Oct 2012 06:42:03 -0700 (PDT) Message-ID: <5087F029.7070200@dev.mellanox.co.il> Date: Wed, 24 Oct 2012 09:42:01 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH] opensm/complib/cl_atomic_osd.h: Fix long standing bug in cl_atomic_sub X-Gm-Message-State: ALoCoQk0aQRzkdHyxRLPhSpreUQeAPoaWuUIEe/rc00+BxR3O/ymDMaVycrhsEWdgMH3Ag9a4f4Y Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Should subtract rather than add decrement Routine was same as cl_atomic_add other than parameter name being decrement instead of increment so assume this is cut 'n paste error Nothing in opensm used this routine up to now Signed-off-by: Hal Rosenstock --- include/complib/cl_atomic_osd.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/complib/cl_atomic_osd.h b/include/complib/cl_atomic_osd.h index 4df9618..822c19d 100644 --- a/include/complib/cl_atomic_osd.h +++ b/include/complib/cl_atomic_osd.h @@ -96,7 +96,7 @@ cl_atomic_sub(IN atomic32_t * const p_value, IN const int32_t decrement) int32_t new_val; cl_spinlock_acquire(&cl_atomic_spinlock); - new_val = *p_value + decrement; + new_val = *p_value - decrement; *p_value = new_val; cl_spinlock_release(&cl_atomic_spinlock); return (new_val);