From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D072C433E0 for ; Fri, 19 Feb 2021 22:50:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0FC3664EB2 for ; Fri, 19 Feb 2021 22:50:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FC3664EB2 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8594F6B0005; Fri, 19 Feb 2021 17:50:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 80B816B006E; Fri, 19 Feb 2021 17:50:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 720E96B0070; Fri, 19 Feb 2021 17:50:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0157.hostedemail.com [216.40.44.157]) by kanga.kvack.org (Postfix) with ESMTP id 5B4336B0005 for ; Fri, 19 Feb 2021 17:50:12 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 163131E0E for ; Fri, 19 Feb 2021 22:50:12 +0000 (UTC) X-FDA: 77836512264.11.EB18F84 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by imf24.hostedemail.com (Postfix) with ESMTP id E6DA2A0009C5 for ; Fri, 19 Feb 2021 22:50:07 +0000 (UTC) Received: by mail-lj1-f176.google.com with SMTP id a17so30232304ljq.2 for ; Fri, 19 Feb 2021 14:50:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oyson8qnHukkq90OL0eTHX8FyQF7k/QZ/j/OxDJwbX8=; b=HMLSUQGE1noKO0TjDvn/+zx6NNWMmvNoCyCRfq9etnhYgE1JOEgj54blv6y03T8Jq0 zO0kMImJdEYzm1MVceC4I8TnZ6K1AOc5II1lZVsmoQ0OaUBa0J8Q9IJGcdO+t/UMoWl9 kPA+1XSQduaCiIqYk+dMPyA/n0gmWu6cY8hZhoTqS7Sm5EVmQ2kfZVnCsqzaq3JTFoMa KpETlK3IpMcpZZGox8nPJC9bndAhD6NI/v6ruyqYCUNip1kTM9AnN8iNzn+W4pidpK/G owYoINz7A5fIucnaem3exQMwU05TKZ0ggTlQ9zTsUB+SQOkc6dLB7BprzdcclvHTteB8 bRLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oyson8qnHukkq90OL0eTHX8FyQF7k/QZ/j/OxDJwbX8=; b=CVSSEz7WjIB1/FoDU/LK40BtQADEm8/uAneeFHJ5MrBQJO65chgWzW74v76EFydaJL nKrKNBFDPszWRFPou7rdZYdxlWUv9tPJVC1ILaP2k5eKlvGogr/konqcas7+vsNdbe19 /3puhbOaG9AuDGyoziTzUZ1jHbv5tB+XumGDAjFfGYApQQcs1pGNXtykQZ/nyiIm0UU2 5n0hSOH0Ag3BmGzCEOlftk7gOgifkPlcRIPYWeQo+opaOKBdqpY/dlucVIoHXc3Asf95 q5M3JOBCD8B8vSBooxAUjGBm8vEYSVVhAaybgM5PyDhKDWXcCxKXYzND9mLtUrdEISyQ IJPQ== X-Gm-Message-State: AOAM531Ro/jIv2f+tn8mXGWcs8PF2/b+xGBDqScvrwjXz1N+b680VRlq BHEqBSgzsNR9NpO8rVz1OWdezv98m+IBwXmnj1/kkw== X-Google-Smtp-Source: ABdhPJwtKO/iGPaaI3PFGUP+qxuum8CD0rVZhT/u6cg+cUk9QV3aV7kQ++MiDwLyWTCpaWiusUrvyNEBaXk7L29lru4= X-Received: by 2002:a19:f11d:: with SMTP id p29mr2304784lfh.547.1613775009472; Fri, 19 Feb 2021 14:50:09 -0800 (PST) MIME-Version: 1.0 References: <20210215204909.3824509-1-willy@infradead.org> <20210219195509.GA59987@24bbad8f3778> <20210219205403.GX2858050@casper.infradead.org> In-Reply-To: From: Nick Desaulniers Date: Fri, 19 Feb 2021 14:49:58 -0800 Message-ID: Subject: Re: [PATCH] mm/gfp: Add kernel-doc for gfp_t To: Miguel Ojeda Cc: Matthew Wilcox , Nathan Chancellor , Andrew Morton , Linux Memory Management List , Mike Rapoport , clang-built-linux Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: zzspf6t1pwmym8myw6gc3reizda3ptw1 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E6DA2A0009C5 Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=mail-lj1-f176.google.com; client-ip=209.85.208.176 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613775007-902873 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Feb 19, 2021 at 2:15 PM Miguel Ojeda wrote: > > On Fri, Feb 19, 2021 at 10:45 PM 'Nick Desaulniers' via Clang Built > Linux wrote: > > > > That said, I'm fine disabling this warning; there's a separate error > > for redefining a typedef to a different underlying type. That's > > what's useful IMO, this one really is not. > > > > This warning doesn't really provide any value to us in the kernel; I > > would guess the intent was to be helpful to code expected to be > > portable across different -std=* > > It seems it would also be useful to sport unintended cases, e.g.: > > - Collisions on short identifiers (that by chance typedef to the same type). > - Copy-pasting and forgetting to remove the original definition > (i.e. it should have be cut-pasting instead). > - Double inclusion of headers (with missing or broken #ifdef guards). (There is a separate warning flag for broken header guards, -Wheader-guard: https://github.com/ClangBuiltLinux/linux/issues?q=is%3Aissue+label%3A-Wheader-guard+is%3Aclosed) What happens should the kernel move to gnu11, as discussed once GCC 5.1+ becomes the minimum supported version for all arches? https://lore.kernel.org/lkml/CAHk-=whnKkj5CSbj-uG_MVVUsPZ6ppd_MFhZf_kpXDkh2MAVRA@mail.gmail.com/ Then the warning will not fire, since it's only really meant to help C code be portable between -std=c11. (Another change to clang could be to move this flag into the -Wpedantic group, which is only really meant for from guarding against the use of non-ISO C functionality, but that still would require disabling the warning for older but supported versions of clang). > > Those may be providing value in the kernel. In particular, if we don't > see any warning at the moment, it means those cases are not happening > now anywhere, so we would be weakening things. > > Having said that, I don't see the original patch, so perhaps I am > missing something. https://lore.kernel.org/linux-mm/20210215204909.3824509-1-willy@infradead.org/ -- Thanks, ~Nick Desaulniers