From patchwork Mon Oct 16 19:28:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christos Gkekas X-Patchwork-Id: 10009749 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0AE8F60230 for ; Mon, 16 Oct 2017 19:28:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F08FC286B5 for ; Mon, 16 Oct 2017 19:28:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E50A2286B7; Mon, 16 Oct 2017 19:28:24 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 B01DD286B5 for ; Mon, 16 Oct 2017 19:28:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755309AbdJPT2L (ORCPT ); Mon, 16 Oct 2017 15:28:11 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:50911 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754670AbdJPT2K (ORCPT ); Mon, 16 Oct 2017 15:28:10 -0400 Received: by mail-wr0-f195.google.com with SMTP id q42so4017245wrb.7; Mon, 16 Oct 2017 12:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fA0tnhr7PL0oX4syuxjCbnKEfuEY2B6aSA8V06oVW4g=; b=Tt51cwWmuH5Qoc2TjQTgLdFfBuwyeJaXG/ZsgCW95cvuRkbHCqP6shXstcp7WkIA3Q AQz/10NLf8tec9t+Z1YVHt9kQyS4UF0YgU+Q8FleIqxwkPR+eRFjWlg9cNBaM1+5fV3l 6Hst8RVg6SJCfnulJJ/FSMFrka/pInqebj7rX4mxR6hIjpNgjGrPlkccDtDISIWBgo1Z vsBKlRB1FR4M/tNMHkN0bLFNpgLdfjV+93t79ADBgIBlrl1EyxGaVVGw/Nc98mF/kHyq mVmLfnNsg97B4dtRl6V6+xN5+e6bwiJHpbQaQ2qwuTJq1OZMZ/KC/83MTk1Augr9lVNe pTYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fA0tnhr7PL0oX4syuxjCbnKEfuEY2B6aSA8V06oVW4g=; b=GsDFFPY/oDNUxnnPl4a7UAsGyiHxwk88dllN1XHmTedR4aUSXD2paGPafVzst097JT gDoGAevSXPhTBzt34Plci/CoAkTGEQCYsPabOzVXe9De4IruuL1QjDGjDoB0awou3zef Y3Jmyf6Ddp5ImqNKGZ9509rhXdLpRYujNkgaPs3soV3WRlgYz72o53JTKGQ02Fneulgz Qg10ZXgyim1QDxaBiJowIMHPb0h9TjGC0j/LKHCN6I4Km0JyPjE/RlJuUtw9Xvt4Kkvl Ls5MSwA4lFetLxU9AlF+1SjmGsv9DyjXgCZcXxzPpXV9yAIX7TK8c8b4d2VmDWN0lt+6 emkA== X-Gm-Message-State: AMCzsaUjVbyN4ndtOgj1BvGJzIgLx398LrcFc/bpLdu6241+xaQjSorg KxwRWELeQo4C115RV4+YJj8= X-Google-Smtp-Source: ABhQp+TzEnsDzs6Vje1c46Cfl/cQ/Cnbz/Qh1xZ4LS/AgSHRoTfNjTS2yliOTKGQci2qJfrNUmUWYQ== X-Received: by 10.223.142.248 with SMTP id q111mr1481552wrb.40.1508182089467; Mon, 16 Oct 2017 12:28:09 -0700 (PDT) Received: from inspiron ([2a02:c7d:5e0c:c300:c479:4970:110f:15fc]) by smtp.gmail.com with ESMTPSA id d82sm5448770wmd.14.2017.10.16.12.28.08 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Oct 2017 12:28:08 -0700 (PDT) From: Christos Gkekas To: Don Brace , "James E.J. Bottomley" , "Martin K. Petersen" , esc.storagedev@microsemi.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christos Gkekas Subject: [PATCH] =?UTF-8?q?csi:=20hpsa:=20Fix=20configured=5Flogical=5Fdri?= =?UTF-8?q?ve=5Fcount=C2=B7check?= Date: Mon, 16 Oct 2017 20:28:02 +0100 Message-Id: <1508182082-11828-1-git-send-email-chris.gekas@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check whether configured_logical_drive_count is less than 255. Previous check was always evaluating to true as this variable is defined as u8. Signed-off-by: Christos Gkekas --- drivers/scsi/hpsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 9abe810..4ed3d26 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -4091,7 +4091,7 @@ static int hpsa_set_local_logical_count(struct ctlr_info *h, memset(id_ctlr, 0, sizeof(*id_ctlr)); rc = hpsa_bmic_id_controller(h, id_ctlr, sizeof(*id_ctlr)); if (!rc) - if (id_ctlr->configured_logical_drive_count < 256) + if (id_ctlr->configured_logical_drive_count < 255) *nlocals = id_ctlr->configured_logical_drive_count; else *nlocals = le16_to_cpu(