From patchwork Thu Nov 12 18:58:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 7604931 X-Patchwork-Delegate: axboe@kernel.dk Return-Path: X-Original-To: patchwork-linux-block@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 31AA09F1D3 for ; Thu, 12 Nov 2015 18:58:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 66BFF207F8 for ; Thu, 12 Nov 2015 18:58:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 96A43203E6 for ; Thu, 12 Nov 2015 18:58:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752213AbbKLS6d (ORCPT ); Thu, 12 Nov 2015 13:58:33 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:32906 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbbKLS6c (ORCPT ); Thu, 12 Nov 2015 13:58:32 -0500 Received: by wmec201 with SMTP id c201so48236047wme.0 for ; Thu, 12 Nov 2015 10:58:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=BtTtlnoclax8N4+w2DUOMATkbn2dCtdmJuEV08aY4Vk=; b=IBkSdiT0oID+i5X1Db3SuerlhThLUbsHkKBV6UB5yfc78GxNMN9hgfRZMio/Teme/V yPF6eo9gp5ewdrx+4mJJuT+Hw8JVQyRGnWR6ssSsqe6bvy4KHdqpEcaqgYZeoIigOXcE IPaIF70RhJmfeYzURsdAyw8OVK1nC8KMEncUg= 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=BtTtlnoclax8N4+w2DUOMATkbn2dCtdmJuEV08aY4Vk=; b=glXxmL+2cJFn2jC0UBOF/ohJf1GKtvd6xlebWnETUnB8ii6kXZMsmOe8oF8dtteo23 y33ETk5tpTP5nI3Rf3dydAcEfHzoMZuRvQ8ofMY4Dda8o1Uc2FUHnvn1NyjbSXa55uik v6YD0fOZv1HJd1cR28CXGTzbxcDqUnEssqnK4fmYoP/6282pL0SvMXXafq1NEN73Onto 0UVJGbFpiJBoZnvyd33uMy8VuwL9NMJX5bFAd8xZrEkyqGJpwM6HyoW0VvqYs53ByMjQ KFFnMZT9BZlggV2X7Bz5tDQamqeoPxitQR36v25+BzLyCkeBiveOo5hCfij5zVYnVsg0 KHPA== X-Gm-Message-State: ALoCoQk0MZUS26LRGSuXLTPJDoeDI571vjleKBGccx0okBLTgwC7SCD6SndZz/AJkf+KRZ1t+oMh X-Received: by 10.28.146.136 with SMTP id u130mr20008877wmd.91.1447354711616; Thu, 12 Nov 2015 10:58:31 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id i18sm16459894wmf.6.2015.11.12.10.58.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Nov 2015 10:58:30 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: axboe@fb.com, geert@linux-m68k.org, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH v2] lightnvm: change max_phys_sect to ushort Date: Thu, 12 Nov 2015 19:58:13 +0100 Message-Id: <1447354693-27785-1-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 The max_phys_sect variable is defined as a char. We do a boundary check to maximally allow 256 physical page descriptors per command. As we are not indexing from zero. This expression is always in false. Bump the max_phys_sect to an unsigned short to support the range chech. Signed-off-by: Matias Bjørling Reported-by: Geert Uytterhoeven --- include/linux/lightnvm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index 69c9057..e8bc52a 100644 --- a/include/linux/lightnvm.h +++ b/include/linux/lightnvm.h @@ -220,7 +220,7 @@ struct nvm_dev_ops { nvm_dev_dma_alloc_fn *dev_dma_alloc; nvm_dev_dma_free_fn *dev_dma_free; - uint8_t max_phys_sect; + unsigned short max_phys_sect; }; struct nvm_lun {