Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22295083rwd; Fri, 30 Jun 2023 06:25:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlExDjnGPTni9ZMZdl88tHGEqHISE8C1Id/gAXoqDYsuh/XqPIxyBukSTjwIGedXB/TdxZPA X-Received: by 2002:a17:902:cecf:b0:1b2:1942:9106 with SMTP id d15-20020a170902cecf00b001b219429106mr2061524plg.64.1688131543220; Fri, 30 Jun 2023 06:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688131543; cv=none; d=google.com; s=arc-20160816; b=Boa1TmnJ+8ZCiYs2Rb55vWM6XNZi/FE/MTNvEcj7LFvjPB1C+hczUt4J3I5BiGJ5u2 SBFGsMw296h7Kyqr7s6SPto9350wqnpDUU4pdipCOKIaZJAhDv8ATF70pRzaKFDZo5Q8 60A1BVOV8ofMhQ+kJayANEJ95vGEkOMNcXotHC/xd3K+o7vWlr8OhyPe3Llf6Xk8fX97 Ou8cJwlBweV8+e5DkvGAROx/TpvVk2T732NiP8twdyonsHaRRuUo1O6MDCTlo7hlKTE2 Wbimq9+ZBtafZ0LAbHo93tphWs9+128TBpm3YIif5uy3DIXfJXXY8lzbV5PWV6qhVTKP YxIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KLhUpgg0oSdKFOaPuh0oQaqDOSqWOFH68YOUwSBIBWA=; fh=YuUi/s+pfNJzb/IdZ/FCQWiE+vdO9XpxuY7TxLfnjTM=; b=wkwP/2ZNnlQtuItuwdRemyRvP18kYwtre2+bmC5ifHuu1hFjX+KGhgr9mxEvLEJTcf rHWZs+B5DvP4LsAG1DNqGAvE/j4iKa2ncx9YGWhHk9LPoI0p6ZpzN1/rfbZuO2kcTl+G +KhQZCQrGeSKmaSpx+CRqljouE3OnUVA+7KJtBaR8JBbTYCgCIV28Xy+mOaCsVy57srL YHTcxQMstO7ajsd0FXwojaW7fQm+b1xuRnouEloZJW2bwa4B1DZxObkJogWK44tyhReG uOHxhamSbSiEfNElhmBzbk6Mhpe/rJvsy/V/lssIAEHhZIMbAzqpYSU6V97VMgA8EDi+ cBAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=laEWgJY3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a170903230b00b001ae8b0f8491si8649415plh.454.2023.06.30.06.25.28; Fri, 30 Jun 2023 06:25:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=laEWgJY3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231724AbjF3MxU (ORCPT + 99 others); Fri, 30 Jun 2023 08:53:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbjF3MxT (ORCPT ); Fri, 30 Jun 2023 08:53:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D49AA2D50 for ; Fri, 30 Jun 2023 05:53:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5A74A61755 for ; Fri, 30 Jun 2023 12:53:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6138CC433C0; Fri, 30 Jun 2023 12:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1688129596; bh=55u5k1dErSnZCei8mhss24XJu4njQWqMm1vg6jlV0No=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=laEWgJY3k614Kl7YH0YATMV93wCrI08RBTC0wZEx29uED3DjkTlILrpv/nETuuqpK UJU+YHDATJsMTPgPAEzrniqSz6aHmFOnER+MTXGjl+YIl3bPfYfIfyci8y0MaF7E44 YA+ncvlsUQWgjOJlVScpBZ+HXXUQO6c3qbjb462Y= Date: Fri, 30 Jun 2023 14:53:14 +0200 From: Greg Kroah-Hartman To: Rodolfo Giometti Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] include/uapi pps.h: drop not needed PPS_MAX_SOURCES define Message-ID: <2023063015-immerse-broadside-3dab@gregkh> References: <20230630071826.105501-1-giometti@enneenne.com> <20230630071826.105501-2-giometti@enneenne.com> <2023063017-traverse-accustom-97f4@gregkh> <56e461b4-2cd8-ec89-86b2-68544826cf73@enneenne.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56e461b4-2cd8-ec89-86b2-68544826cf73@enneenne.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 30, 2023 at 09:50:33AM +0200, Rodolfo Giometti wrote: > On 30/06/23 09:31, Greg Kroah-Hartman wrote: > > On Fri, Jun 30, 2023 at 09:18:26AM +0200, Rodolfo Giometti wrote: > > > Userspace PPS clients should not known about how many PPS sources can > > > be defined within the system (nor the rfc2783 say so), so we can > > > safely drop this define since is not used anymore in the kernel too. > > > > > > Signed-off-by: Rodolfo Giometti > > > --- > > > drivers/pps/pps.c | 6 +++--- > > > include/uapi/linux/pps.h | 1 - > > > 2 files changed, 3 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c > > > index 5d19baae6a38..1a6131608036 100644 > > > --- a/drivers/pps/pps.c > > > +++ b/drivers/pps/pps.c > > > @@ -354,7 +354,7 @@ int pps_register_cdev(struct pps_device *pps) > > > * Get new ID for the new PPS source. After idr_alloc() calling > > > * the new source will be freely available into the kernel. > > > */ > > > - err = idr_alloc(&pps_idr, pps, 0, PPS_MAX_SOURCES, GFP_KERNEL); > > > + err = idr_alloc(&pps_idr, pps, 0, MINORMASK, GFP_KERNEL); > > > if (err < 0) { > > > if (err == -ENOSPC) { > > > pr_err("%s: too many PPS sources in the system\n", > > > @@ -449,7 +449,7 @@ EXPORT_SYMBOL(pps_lookup_dev); > > > static void __exit pps_exit(void) > > > { > > > class_destroy(pps_class); > > > - unregister_chrdev_region(pps_devt, PPS_MAX_SOURCES); > > > + unregister_chrdev_region(pps_devt, MINORMASK); > > > } > > > static int __init pps_init(void) > > > @@ -463,7 +463,7 @@ static int __init pps_init(void) > > > } > > > pps_class->dev_groups = pps_groups; > > > - err = alloc_chrdev_region(&pps_devt, 0, PPS_MAX_SOURCES, "pps"); > > > + err = alloc_chrdev_region(&pps_devt, 0, MINORMASK, "pps"); > > > if (err < 0) { > > > pr_err("failed to allocate char device region\n"); > > > goto remove_class; > > > diff --git a/include/uapi/linux/pps.h b/include/uapi/linux/pps.h > > > index 90f2e86020ba..8a4096f18af1 100644 > > > --- a/include/uapi/linux/pps.h > > > +++ b/include/uapi/linux/pps.h > > > @@ -26,7 +26,6 @@ > > > #include > > > #define PPS_VERSION "5.3.6" > > > -#define PPS_MAX_SOURCES MINORMASK > > > > Why change this in patch 1, and then delete this here? > > > > That makes no sense. > > I did it in two steps to be clear that the first step is about a better > redefinition of the PPS_MAX_SOURCES define, while the second step is about > the fact it's now that define is useless. Better to just convert everything in patch one, and then in patch 2 delete the .h #define. That way, when userspace breaks, you can revert just the last patch :) > > And if this is exported to userspace, removing it should break things, > > right? If not, why was it there in the first place? > > In reality such define is not stated within the PPS RFC2783, so userspace > programs whose relies on such define are broken. RFC's do not document Linux kernel apis. So if any userspace code breaks, you have to put this back, sorry. thanks, greg k-h