From patchwork Fri Aug 27 03:49:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 62823 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 761FCB70E4 for ; Fri, 27 Aug 2010 13:49:15 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753017Ab0H0DtK (ORCPT ); Thu, 26 Aug 2010 23:49:10 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:39403 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752887Ab0H0DtJ (ORCPT ); Thu, 26 Aug 2010 23:49:09 -0400 Received: by wwb28 with SMTP id 28so2671992wwb.1 for ; Thu, 26 Aug 2010 20:49:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=NQZj64SqjTKBCsGOivw/7Pqvgnofr2d9AL7TEA+qyCg=; b=b5l33ra/t7FXAz1Lc3PiK66KemV9J1LXRWTjsJlIAI1gMd7UDg3KgADFi0/cn8IOcp iY/Idi3cpfJ6KAuT6KNHuLpXyHv8OWGEkqfSe2JHwAFb9ynh0halHXozC3Dgar2eZXI+ CzX/RdmHzMRlOJzcaG6HW71sthg15CiSUlS0s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=nQXZjjCDMfJxZdD6rWaqTR5KUwpnI5w2c5n/H2xMYjEBTMkjMbdImAqHkqe/JkyzMF ZnkkB2jE8pUMPG2FonJBgFC0M3q1LIgQX2fko66Pdh2pusxToBKi41wmrvx4LuBABNoO obLaAcCNXofTesscuFGJ+U+B2ma4WjAvJfp94= Received: by 10.227.134.210 with SMTP id k18mr117842wbt.160.1282880948080; Thu, 26 Aug 2010 20:49:08 -0700 (PDT) Received: from [127.0.0.1] ([85.17.35.125]) by mx.google.com with ESMTPS id e31sm2945329wbe.17.2010.08.26.20.49.06 (version=SSLv3 cipher=RC4-MD5); Thu, 26 Aug 2010 20:49:07 -0700 (PDT) Subject: [PATCH] bnx2x: fix wrong return from bnx2x_trylock_hw_lock From: Eric Dumazet To: David Miller Cc: netdev , Vladislav Zolotarov , Eilon Greenstein Date: Fri, 27 Aug 2010 05:49:03 +0200 Message-ID: <1282880943.2501.13.camel@edumazet-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org bnx2x_trylock_hw_lock() returns a bool : true if succeeded to acquire the lock. false in case of error. -EINVAL is not an acceptable value, since its promoted to true. Signed-off-by: Eric Dumazet Acked-by: Eilon Greenstein --- Cosmetic patch, since compiler probably omits the code anyway. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index f8c3f08..86cc4b0 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c @@ -781,7 +781,7 @@ static bool bnx2x_trylock_hw_lock(struct bnx2x *bp, u32 resource) DP(NETIF_MSG_HW, "resource(0x%x) > HW_LOCK_MAX_RESOURCE_VALUE(0x%x)\n", resource, HW_LOCK_MAX_RESOURCE_VALUE); - return -EINVAL; + return false; } if (func <= 5)