From patchwork Fri Oct 2 01:32:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 7312501 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 A6F0D9F1D5 for ; Fri, 2 Oct 2015 01:33:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CFF6C207A8 for ; Fri, 2 Oct 2015 01:33:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07C3F207D5 for ; Fri, 2 Oct 2015 01:33:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751222AbbJBBdB (ORCPT ); Thu, 1 Oct 2015 21:33:01 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33473 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbbJBBdA (ORCPT ); Thu, 1 Oct 2015 21:33:00 -0400 Received: by pacex6 with SMTP id ex6so91335442pac.0 for ; Thu, 01 Oct 2015 18:33:00 -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=6hz28lSO0TmgdEXdoQYtxs5T495Bobf3p3+KmpzjD4k=; b=XaGQvdlghJU/o+DkGr9S7V684xZLswgJOijbDNovG9Hf19xrWD3QCsp1b71JW8JETN rtx6H7si1TkXHeLdtCn3gPJ7pcwdKwHz2SIc3jFF2S1UTTZZtJnUUXxKVryc5QCtvvqz rJD9pdIrXHq0gruPfYdpbZak/ndb2i4Ve0RRY= 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=6hz28lSO0TmgdEXdoQYtxs5T495Bobf3p3+KmpzjD4k=; b=mDtbEC4LuL/lXG+zeJeF8iRCejNzrT65CtWlOqDpy9anGZVMD0HPzHmf2IRqtumnJL GxGRYPPjCILbFEoS+VVenDCvs1tgxamDMC4xdmwbPsxBxhH17vdkKB9iPpMNEpW7CnDa r+4IUylS8dnvmGSl57jfvQJxHO0qapc31ySzNj/NGxRpI9ZDBgl81/prElw2W8jEOR29 3ejUejYaCAB/G4O0q0oOysS8gWH3db1dXx3w6zpLWo8vlKTqXqCvDVo28vOQDW0qLF9o g/8NERwG6YabrRlURa5eRbIuuqG3Hm18zfXmOROhs1zDhhWyKWs4xZJ0HLAkuozvxQpV 9Qpw== X-Gm-Message-State: ALoCoQmRswIXslyUPPaDuRvxUVFIYw+fEpRqUEUiuvFsNvH6ke5HEZYwDPfwqlPt+lp4b/QKv93x X-Received: by 10.68.57.175 with SMTP id j15mr16245012pbq.34.1443749580158; Thu, 01 Oct 2015 18:33:00 -0700 (PDT) Received: from icarus.au.ibm.com ([103.232.208.206]) by smtp.gmail.com with ESMTPSA id w9sm9124180pbt.29.2015.10.01.18.32.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Oct 2015 18:32:59 -0700 (PDT) From: Joel Stanley To: jthumshirn@suse.de, jayamohan.kallickal@avagotech.com, JBottomley@odin.com Cc: linux-scsi@vger.kernel.org Subject: [PATCH v2] be2iscsi: Fix bad WARN_ON Date: Fri, 2 Oct 2015 11:02:45 +0930 Message-Id: <1443749565-8438-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); ^ Check that length is not zero (and not less than zero, but it's unsigned, so that will always be satisfied). Signed-off-by: Joel Stanley Reviewed-by: Johannes Thumshirn --- v2: invert the check to lose the ! as suggested by Johannes 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..c6110cb 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;