Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1221490ybp; Wed, 9 Oct 2019 10:34:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqysOEyxHaLn+lYsQeyxhH4KFfWexZ6+xIwGCBIm/Z0BuDq8P6Zl+seBJfd3Yl/v7NpP4Dfo X-Received: by 2002:a17:906:553:: with SMTP id k19mr3965382eja.102.1570642465167; Wed, 09 Oct 2019 10:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570642465; cv=none; d=google.com; s=arc-20160816; b=gEHDUhkq2rBE94TVD2iEnxQTQBXiRDlkFxtn2Gs8LGWO1u2W7aTjsM9yTItAle1Cmc wudKJ+BB3XmvE6WjZtQ1DcXhaXT57z+33GbgdEoiLhlrMmdnP5jOZBpS5RkjFUX/HZjo oyCjugrscroteL3+xkYO0stzhBxKa/R3ekkGmci9RzhcuyLCo7qXcKr+Kh3NpaSt4OGs by5IWLXxI5rf/nIv2rdgeZudhPWdLYOb2UZXUC3Z7xt0z6Uf6ruFo3IgigYAGWMss81U ssHAs2r9raloAFrj3kt5NlTOiABEwhKc2vJFS2DFub5TYH/CX6DDwd7aS2pwv3YS/SVw lRWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=64S7upTOSmWG0FCz/0I/kvz+kUrhwKMMzAjL3YUfyOs=; b=ovABWmRlI3VySczkgnSroF+hRYzSVyWSQH34PbFXYGLeCB7D8V1j21WmKVohCy5vpr +AjMUrfiJAjpxfKbCgvzmYil0EmUKVGMzmHbv9ym+2HAhWU2ddOc2W3Mext7JZPMVOfj YobFjV6KMpJdPr/CNm5dGHZtRsZnB/F00XeDzpjdyFfTZ5Go40O/1i3jnvRVMysG5WUC D/pOcjZGA0eaEdnENU3uUXB6Zx1Vp2h9gryEhie22kec/zSMVfNmW4gc03n6rokX45iQ g8oy07sPXRvumbP5Tn8rP1sFE0lxx1ZK9JH50gCPFbRR8yaSO6CnFmDuJHdnl7ZCHMzR 2YUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DSdoE+uZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h48si1835873ede.31.2019.10.09.10.34.01; Wed, 09 Oct 2019 10:34:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=DSdoE+uZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732132AbfJIRd6 (ORCPT + 99 others); Wed, 9 Oct 2019 13:33:58 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:40639 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731922AbfJIRd6 (ORCPT ); Wed, 9 Oct 2019 13:33:58 -0400 Received: by mail-pg1-f194.google.com with SMTP id d26so1847989pgl.7 for ; Wed, 09 Oct 2019 10:33:57 -0700 (PDT) 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:content-transfer-encoding; bh=64S7upTOSmWG0FCz/0I/kvz+kUrhwKMMzAjL3YUfyOs=; b=DSdoE+uZ8L84E0Kcmx2jHsU0q/gI//xKqNOllvCfYRUntJA+pUlFzfJtSXTEcLXyX4 j1EwkWD7j+gFVNlodHVCQYxqxjmF3q7orwFpAqRUEkSd4pdrjK798MkkMZX1wNZGUH9/ Pw7IIbBkSkicTTKgr/5eE51cPxnC6i1khe24LxPRdLtgbzTjKL0eKDsEENONEeDCwTTr ZnTicT40oNjua9Qf63YTQTeTC0i45A8GkMa6t0POwzb+Q/e55Ghn8KzmzDWFWgIz4fk3 3nZ9muHXPRbMvDgmr1Esod5fKkg/MiCLzRcsnSGTXsI4nTX3CU0vbpb+Y0o5ur5f+k1O VWiw== 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:content-transfer-encoding; bh=64S7upTOSmWG0FCz/0I/kvz+kUrhwKMMzAjL3YUfyOs=; b=pBKqikx/imtTBKR/R8LrwHDrwGaasF4cCWfEms0TeIXl2Wm5EeIWKUzGdzWPdXCwC3 ELGZ/Xe4HATYg2Tg4TfQ8/3yJ8BDPG+s5qs6dFR6FrMaDw65LNyIZRv1p3UkPxE/EITX qoBf0+CVlBJ+TtTMA09Uj76nnMudE6O4edv2BIUlHtoq7ddIfjA8sysxB2rnN1G+HSXh s4sHfRi/Eyj0NW61XO5dmVsJgoXXRYaryH/ggSEBLh8x/RM2m/yI8xVNxxabriBaY3Ks 9dEpOMqio4jzvwetevny+qyaDL0ynJtSRMmZAVPpaQ2HiRoWskLUMHp4vshQ9/nTVSYH PATA== X-Gm-Message-State: APjAAAVaQgqeNLl8yW8EN69ddfJ84xJFhTPHuECQI8+pkbmlbeCJSiLI 2qWxJLd1vG4zX7UVcol9aQkkyeCzCOkmE+bXpmyDvgsl6tE= X-Received: by 2002:a17:90a:aa81:: with SMTP id l1mr1002058pjq.73.1570642436661; Wed, 09 Oct 2019 10:33:56 -0700 (PDT) MIME-Version: 1.0 References: <75f70e5e-9ece-d6d1-a2c5-2f3ad79b9ccb@web.de> <20191009110943.7ff3a08a@gandalf.local.home> <4d890cae9cbbd873096cb1fadb477cf4632ddb9a.camel@perches.com> In-Reply-To: <4d890cae9cbbd873096cb1fadb477cf4632ddb9a.camel@perches.com> From: Nick Desaulniers Date: Wed, 9 Oct 2019 10:33:45 -0700 Message-ID: Subject: Re: [PATCH] string.h: Mark 34 functions with __must_check To: Joe Perches Cc: Steven Rostedt , Markus Elfring , kernel-janitors@vger.kernel.org, Alexander Shishkin , Andrew Morton , Andy Shevchenko , Kees Cook , LKML , Miguel Ojeda Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 9, 2019 at 9:38 AM Joe Perches wrote: > > On Wed, 2019-10-09 at 09:13 -0700, Nick Desaulniers wrote: > > On Wed, Oct 9, 2019 at 8:09 AM Steven Rostedt wro= te: > > > On Wed, 9 Oct 2019 14:14:28 +0200 Markus Elfring wrote: > [] > > > > Several functions return values with which useful data processing > > > > should be performed. These values must not be ignored then. > > > > Thus use the annotation =E2=80=9C__must_check=E2=80=9D in the shown= function declarations. > [] > > > I'm curious. How many warnings showed up when you applied this patch? > > > > I got zero for x86_64 and arm64 defconfig builds of linux-next with > > this applied. Hopefully that's not an argument against the more > > liberal application of it? I view __must_check as a good thing, and > > encourage its application, unless someone can show that a certain > > function would be useful to call without it. > > stylistic trivia, neither agreeing nor disagreeing with the patch > as I generally avoid reading Markus' patches. > > I believe __must_check is best placed before the return type as > that makes grep for function return type easier to parse. > > i.e. prefer > [static inline] __must_check (); > over > [static inline] __must_check (); > + Miguel So I just checked `__cold`, and `__cold` is all over the board in style. I see it: 1. before anything fs/btrfs/super.c#L101 2. after static before return type (what you recommend) fs/btrfs/super.c#L2= 318 3. after return type fs/btrfs/inode.c#L9426 Can we pick a style and enforce it via checkpatch? (It's probably not fun to check for each function attribute in include/linux/compiler_attributes.h). --=20 Thanks, ~Nick Desaulniers