From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by sourceware.org (Postfix) with ESMTPS id 303333969023 for ; Tue, 4 May 2021 16:06:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 303333969023 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB4E2611AC; Tue, 4 May 2021 16:06:28 +0000 (UTC) Date: Tue, 4 May 2021 18:06:26 +0200 From: Greg KH To: "Alejandro Colomar (man-pages)" Cc: Alexei Starovoitov , "Michael Kerrisk (man-pages)" , linux-man , LKML , glibc , GCC , bpf , David Laight , Zack Weinberg , Joseph Myers Subject: Re: [RFC v2] bpf.2: Use standard types and attributes Message-ID: References: <20210423230609.13519-1-alx.manpages@gmail.com> <20210504110519.16097-1-alx.manpages@gmail.com> <69fb22e0-84bd-47fb-35b5-537a7d39c692@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69fb22e0-84bd-47fb-35b5-537a7d39c692@gmail.com> X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 May 2021 16:06:40 -0000 On Tue, May 04, 2021 at 05:53:29PM +0200, Alejandro Colomar (man-pages) wrote: > Hi Greg and Alexei, > > > On Tue, May 04, 2021 at 07:12:01AM -0700, Alexei Starovoitov wrote: > > > For the same reasons as explained earlier: > > > Nacked-by: Alexei Starovoitov > > Okay, I'll add that. > > > On 5/4/21 4:24 PM, Greg KH wrote:> I agree, the two are not the same type at > all, this change should not be > > accepted. > > I get that in the kernel you don't use the standard fixed-width types (with > some exceptions), probably not to mess with code that relies on > not being included (I hope there's not much code that relies on this in > 2021, but who knows). > > But, there is zero difference between these types, from the point of view of > the compiler. There's 100% compatibility between those types, and you're > able to mix'n'match them. See some example below. > > Could you please explain why the documentation, which supposedly only > documents the API and not the internal implementation, should not use > standard naming conventions? The standard is much easier to read for > userspace programmers, which might ignore why the kernel does some things in > some specific ways. > > BTW, just to clarify, bpf.2 is just a small sample to get reviews; the > original intention was to replace __uNN by uintNN_t in all of the manual > pages. There's a very old post from Linus where he describes the difference between things like __u32 and uint32_t. They are not the same, they live in different namespaces, and worlds, and can not always be swapped out for each other on all arches. Dig it up if you are curious, but for user/kernel apis you HAVE to use the __uNN and can not use uintNN_t variants, so don't try to mix/match them, it's good to just follow the kernel standard please. So consider this my: Nacked-by: Greg Kroah-Hartman as well. thanks, greg k-h