From patchwork Mon Sep 14 22:50:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 7178931 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7B6D7BEEC1 for ; Mon, 14 Sep 2015 22:51:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A466320614 for ; Mon, 14 Sep 2015 22:51:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACCF620616 for ; Mon, 14 Sep 2015 22:51:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753032AbbINWvX (ORCPT ); Mon, 14 Sep 2015 18:51:23 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:35436 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752107AbbINWvS (ORCPT ); Mon, 14 Sep 2015 18:51:18 -0400 Received: by pacfv12 with SMTP id fv12so159045920pac.2 for ; Mon, 14 Sep 2015 15:51:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:to:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc :cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc :cc:cc:cc:cc:subject:date:message-id:in-reply-to:references; bh=B3+xK61I2Nh2s3v3wqxWNp//0/BsIlWxI4D9VwTPrrI=; b=GcM0Qch+uLxWGzP/EF5JWQFYsEqsHTOcoAnmsGeWEd06QbbjOQhL8vazmWakz/jC0k ovY3Cicbp/qMSKjAMDz3903mEOsFGeIuNQQ20bZNQcxu1mK4V2XlZ2hYSKjkBs9VVNaB t5lzTT1EZHO9HDOdohh6GrasM5dOCyObyJCAK7EDf+6Njd4ful0ZYIWKbsv07XTpGBpN Wbb2IUOuWGTeFBSL7yeS/fd+3aI+puQvCeDUmqqffJYbhtDPV7bQ9Ja5E6h2yOmzzI2v CYRkTB/K55fjwHLF3DHKc94sOHQ/98xB0oNX8mvfac9mSVpF8hS9afnUFhpV7uJLtKPk 9aeQ== X-Gm-Message-State: ALoCoQkwdNGZ8CtxlmBlftIfsg0x4eb698T0nLtZDx2ABxOQ7G7tK/kXUiipsHemz45KqESjWja3 X-Received: by 10.69.12.33 with SMTP id en1mr39807866pbd.97.1442271077750; Mon, 14 Sep 2015 15:51:17 -0700 (PDT) Received: from localhost (wap-cal.CS.Berkeley.EDU. [128.32.35.228]) by smtp.gmail.com with ESMTPSA id qv5sm18121871pbc.71.2015.09.14.15.51.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 15:51:17 -0700 (PDT) From: Palmer Dabbelt To: arnd@arndb.de To: dhowells@redhat.com Cc: viro@zeniv.linux.org.uk Cc: ast@plumgrid.com Cc: aishchuk@linux.vnet.ibm.com Cc: aarcange@redhat.com Cc: akpm@linux-foundation.org Cc: luto@kernel.org Cc: acme@kernel.org Cc: bhe@redhat.com Cc: 3chas3@gmail.com Cc: chris@zankel.net Cc: dave@sr71.net Cc: dyoung@redhat.com Cc: drysdale@google.com Cc: davem@davemloft.net Cc: ebiederm@xmission.com Cc: geoff@infradead.org Cc: gregkh@linuxfoundation.org Cc: hpa@zytor.com Cc: mingo@kernel.org Cc: iulia.manda21@gmail.com Cc: plagnioj@jcrosoft.com Cc: jikos@kernel.org Cc: josh@joshtriplett.org Cc: kexec@lists.infradead.org Cc: linux-api@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: mathieu.desnoyers@efficios.com Cc: jcmvbkbc@gmail.com Cc: paulmck@linux.vnet.ibm.com Cc: a.p.zijlstra@chello.nl Cc: tglx@linutronix.de Cc: tomi.valkeinen@ti.com Cc: vgoyal@redhat.com Cc: x86@kernel.org Cc: Palmer Dabbelt Subject: [PATCH 11/13] Always define MAX_RAW_MINORS as 65535 in userspace Date: Mon, 14 Sep 2015 15:50:45 -0700 Message-Id: <1442271047-4908-12-git-send-email-palmer@dabbelt.com> X-Mailer: git-send-email 2.4.6 In-Reply-To: <1442271047-4908-1-git-send-email-palmer@dabbelt.com> References: <1441832902-28993-1-git-send-email-palmer@dabbelt.com> <1442271047-4908-1-git-send-email-palmer@dabbelt.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 While I don't think this was ever meant to be exposed to userspace, if anyone is using it then this will at least provide a correct (if unlikely) definition. MAX_RAW_MINORS used to be used in the kernel, where it's been replaced with CONFIG_MAX_RAW_MINORS. Note that there's a checkpatch.pl warning about a split config string here, but I've left that alone. Signed-off-by: Palmer Dabbelt Reviewed-by: Andrew Waterman Reviewed-by: Albert Ou --- drivers/char/raw.c | 7 ++++--- include/uapi/linux/raw.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/char/raw.c b/drivers/char/raw.c index 60316fbaf295..362d7a6511b9 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c @@ -36,7 +36,7 @@ static struct raw_device_data *raw_devices; static DEFINE_MUTEX(raw_mutex); static const struct file_operations raw_ctl_fops; /* forward declaration */ -static int max_raw_minors = MAX_RAW_MINORS; +static int max_raw_minors = CONFIG_MAX_RAW_MINORS; module_param(max_raw_minors, int, 0); MODULE_PARM_DESC(max_raw_minors, "Maximum number of raw devices (1-65536)"); @@ -317,8 +317,9 @@ static int __init raw_init(void) if (max_raw_minors < 1 || max_raw_minors > 65536) { printk(KERN_WARNING "raw: invalid max_raw_minors (must be" - " between 1 and 65536), using %d\n", MAX_RAW_MINORS); - max_raw_minors = MAX_RAW_MINORS; + " between 1 and 65536), using %d\n", + CONFIG_MAX_RAW_MINORS); + max_raw_minors = CONFIG_MAX_RAW_MINORS; } raw_devices = vzalloc(sizeof(struct raw_device_data) * max_raw_minors); diff --git a/include/uapi/linux/raw.h b/include/uapi/linux/raw.h index 62d543e70603..f0390b3e8530 100644 --- a/include/uapi/linux/raw.h +++ b/include/uapi/linux/raw.h @@ -13,6 +13,6 @@ struct raw_config_request __u64 block_minor; }; -#define MAX_RAW_MINORS CONFIG_MAX_RAW_DEVS +#define MAX_RAW_MINORS 65535 #endif /* __LINUX_RAW_H */