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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76211C433FE for ; Mon, 6 Dec 2021 20:02:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348646AbhLFUF6 (ORCPT ); Mon, 6 Dec 2021 15:05:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345361AbhLFUF5 (ORCPT ); Mon, 6 Dec 2021 15:05:57 -0500 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7655DC061359 for ; Mon, 6 Dec 2021 12:02:28 -0800 (PST) Received: by mail-lf1-x12f.google.com with SMTP id l22so28092244lfg.7 for ; Mon, 06 Dec 2021 12:02:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MV8pLjJcbpCes0pPCBGkkCU9j3+hlAKLtwDB7sdc260=; b=sCGw2x5S42H1flR6yrgcbJpyVrLbZUlciC9ASPGwv3wYl3856XM/1BT/dlnIOOipX0 /Wk9opckSY26KJkY9ZtMGmJr8inxYkxXVBzcsiqKcjXyX4lhaWz4QnbEEUu1pka4vIwy pcjb5bITAc3PFc8s0rtAG7kIaLA0rY3drMijWI8B62v3+7KeR9uX4ExME7ytmC9M0aYG dj59o5pKJfO8MMfd20UY11q5+nuc1zRTTHv9YecvUKWvrnz9elLYcrHKhqWTgsaNG1u6 rrFWo51ilAqPhd8qX/BDvckrV4CzujP0/WMk8S2XukyU0KqDLMv7YoauNnc4oI3By9AB rnsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MV8pLjJcbpCes0pPCBGkkCU9j3+hlAKLtwDB7sdc260=; b=yzTcKLPDzEQ7xVdt+qPtFi+NOPhYUyezc/FHUgD1gmcQZkRfLa2S32v2CR7WvxQZNZ 6GxWE8jUQwSK+iR2G+bfh6aDg32gkyr4AcEtuonMrKIDxxZ8OUj2YkK3bvYV2uwGkyRH 1fulexQeO+KTVLPWaQ7Z8Ns1iXS3zKHHdvDSBwvfHevM4w84tME8lOoznJmmEAX6RsqF 6a/W94yfp/fzoyc5rC+Vi+8SknwgfJcunqlYCS98TuWBXXXNg3b1eZSeXi178w3Wxwu1 ynHUBoqEOoEGW2ipqqdH2xzdf82pih1a7wegZ8qM3aFPaAy/s85B+i9h5APaCvzZn09+ d0qA== X-Gm-Message-State: AOAM5322PTzbOgr+QC8yqAGvu2HXoFTz34sfuT+sUx6/Pj7uHrhK1DXa Q8bzkvVXl2GpPPgIlVjyeUn3x85oBsNkjgh+PlJ9Nw== X-Google-Smtp-Source: ABdhPJxJDec6abMrza4P+4CkbJYlI0Co3O5gNnso2xGk+rWgq2NQ2ix/cTg0La8jfc1KUCsLK5zNdfA/opdTXeGwa/w= X-Received: by 2002:ac2:4d19:: with SMTP id r25mr35689585lfi.82.1638820945720; Mon, 06 Dec 2021 12:02:25 -0800 (PST) MIME-Version: 1.0 References: <20211206140313.5653-1-ojeda@kernel.org> <20211206140313.5653-12-ojeda@kernel.org> In-Reply-To: From: Nick Desaulniers Date: Mon, 6 Dec 2021 12:02:14 -0800 Message-ID: Subject: Re: [PATCH 11/19] vsprintf: add new `%pA` format specifier To: Matthew Wilcox Cc: Greg Kroah-Hartman , Miguel Ojeda , Miguel Ojeda , Linus Torvalds , rust-for-linux , Linux Kbuild mailing list , Linux Doc Mailing List , linux-kernel , Gary Guo , Alex Gaynor , Wedson Almeida Filho Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: rust-for-linux@vger.kernel.org On Mon, Dec 6, 2021 at 11:55 AM Matthew Wilcox wrote: > > On Mon, Dec 06, 2021 at 11:52:09AM -0800, Nick Desaulniers wrote: > > On Mon, Dec 6, 2021 at 8:14 AM Greg Kroah-Hartman > > wrote: > > > > > > On Mon, Dec 06, 2021 at 04:56:32PM +0100, Miguel Ojeda wrote: > > > > On Mon, Dec 6, 2021 at 4:46 PM Greg Kroah-Hartman > > > > wrote: > > > > > > > > > > That should be in a .h file somewhere. Remember, don't put #ifdef in .c > > > > > files please. > > > > Why not put #ifdef in .c files? > > > > > > Will do, thanks for reviewing! > > > > > > > > > Same here, this should not be needed if you put it in a .h file > > > > > correctly. > > > > I guess IS_ENABLED could be used in the .c code, but I don't see how > > they could move the dispatch to rust_fmt_argument to a header without > > moving the definition of pointer() to a header, which they probably > > _cant_ do because it's noinline_for_stack. > > In the header file, you put: > > #ifdef CONFIG_FOO > int foo(void); > #else > static inline int foo(void) { } > #endif > > and then in your .c file, you call foo() unconditionally, and everything > works beautifully. > Ah, that is nice, thanks! -- Thanks, ~Nick Desaulniers