From patchwork Thu Oct 1 08:02:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 7306051 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D4ED99F1D5 for ; Thu, 1 Oct 2015 08:04:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 00E0B20819 for ; Thu, 1 Oct 2015 08:04:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB2AE20815 for ; Thu, 1 Oct 2015 08:04:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755989AbbJAID7 (ORCPT ); Thu, 1 Oct 2015 04:03:59 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:33679 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755937AbbJAID5 (ORCPT ); Thu, 1 Oct 2015 04:03:57 -0400 Received: by pacex6 with SMTP id ex6so67423749pac.0 for ; Thu, 01 Oct 2015 01:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=Y0oiGGU782VKzbanli0YJgDyaN5qPBGIhNbKhb7YOQY=; b=T/7KW7sLPeyYBSLvvoqgFlqpm7lnj/BAPf7N2rjvAgbe4ORCNKEVDv4025Oy+cMbBK Q5p6saHA9yOH+3sY5SyA8lKsdeHLHwY0M3OtXPIY512KWFf/I1F6/+x508FeHlUeLfkh sEwhnwuxri0t7CJ0dnX//HgFjLbx0mstbqpkA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=Y0oiGGU782VKzbanli0YJgDyaN5qPBGIhNbKhb7YOQY=; b=cuzQP4VuE8aZPO3HVRoexsU2iLL5mFw23CI3saBdjF9GSk4K3NgPvmCXKon3sq9sPA QfX87qFoHu6Obx+BdJVEvUyVI8MhDLw0zUzfv77iXRV9GbCPoJ2CBlrEhXsYcroWZzku mcmAAbiCo2qn0jJUUpsnU2lDrLFMUtRyyZBYfsk1aCVigZ3tkQmPr/gFr6Zc0a0hzeQF 7yXB/uBK3FBaJ0Ma/AF6Mw7W2EX/7cPPR19WB5h+F0R0+2NvGKIhrfT0K1c74BFaUIQs o8Vn6vWVBrIvPmfH/sp0pwIE4/JB8JWC6kUc6jDkVKvUNdk74XUR63cnqk05Gzj2XPKG dCPg== X-Gm-Message-State: ALoCoQlLO62snEl8O9HCUJEZsFu276GQI211/YUBXgK6NFKz4ykCsD4tbNn4g5lFeDLbkmbLF4mV X-Received: by 10.66.139.165 with SMTP id qz5mr10457467pab.92.1443686636484; Thu, 01 Oct 2015 01:03:56 -0700 (PDT) Received: from icarus.jms.id.au (ip9.cor1.adl1.base64.com.au. [203.0.153.9]) by smtp.gmail.com with ESMTPSA id ya10sm4896825pbc.69.2015.10.01.01.03.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Oct 2015 01:03:55 -0700 (PDT) Received: by icarus.jms.id.au (Postfix, from userid 1000) id 767BA10020C; Thu, 1 Oct 2015 17:33:49 +0930 (ACST) From: Joel Stanley To: jayamohan.kallickal@avagotech.com, minh.tran@avagotech.com, sony.john-n@avagotech.com Cc: JBottomley@odin.com, linux-scsi@vger.kernel.org Subject: [PATCH] be2iscsi: Fix bad WARN_ON Date: Thu, 1 Oct 2015 17:32:58 +0930 Message-Id: <1443686578-13030-1-git-send-email-joel@jms.id.au> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP GCC 5 helpfully warns us that the WARN_ON check may be buggy: drivers/scsi/be2iscsi/be_main.c: In function ‘be_sgl_create_contiguous’: drivers/scsi/be2iscsi/be_main.c:3187:18: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] WARN_ON(!length > 0); ^ Add the brackets that the check was was looking for. Signed-off-by: Joel Stanley --- drivers/scsi/be2iscsi/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 7a6dbfb..0b87abb 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -3184,7 +3184,7 @@ be_sgl_create_contiguous(void *virtual_address, { WARN_ON(!virtual_address); WARN_ON(!physical_address); - WARN_ON(!length > 0); + WARN_ON(!(length > 0)); WARN_ON(!sgl); sgl->va = virtual_address;