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=-8.3 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no 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 4FCF1C5ACC4 for ; Wed, 19 Feb 2020 21:32:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 03E1924670 for ; Wed, 19 Feb 2020 21:32:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="aAobjYpF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03E1924670 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 8F0306B007B; Wed, 19 Feb 2020 16:32:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A12E6B007D; Wed, 19 Feb 2020 16:32:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 790C76B007E; Wed, 19 Feb 2020 16:32:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0117.hostedemail.com [216.40.44.117]) by kanga.kvack.org (Postfix) with ESMTP id 61C786B007B for ; Wed, 19 Feb 2020 16:32:51 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 23353181AC9CB for ; Wed, 19 Feb 2020 21:32:51 +0000 (UTC) X-FDA: 76508176542.29.van55_8d45b7cb86434 X-HE-Tag: van55_8d45b7cb86434 X-Filterd-Recvd-Size: 4616 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 21:32:50 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id i19so737107pfa.2 for ; Wed, 19 Feb 2020 13:32:50 -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=EmqhwxfTOPH5Jwang1lE3QOy4zcv0gzG5lBl/plns9w=; b=aAobjYpFklyAkqlSG70awWRHMtlHSvugns/9mnKxCnZbo5CBJsQf4GsGU2DC6SwVxM PqCQwGEARKxeFBmbEdcjD4vQwtPfRz6yplo6lJvfbOvKffn7U//Av3nzUBjvTKIQA1SI 3rRlpdcbJ6/nTMZrkb86TdZfyolv0kDit/gwKe4Yw2DPTokH2zcFLvoCc46OIl/x/aHB nLS5TEWP/iXmuWbKI4NopOwy54x337xvKNUJeEV6goeSU4DERoVDEYnQ6uruiyaODWt2 KjfY0l2/gfssEmO9emTMo66m1oaAYdh6bkuZvzRLFE9ZCl2+5QErp/rw6O16d+fE/Uim MbIw== 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=EmqhwxfTOPH5Jwang1lE3QOy4zcv0gzG5lBl/plns9w=; b=OMsp5zkFcqEvvLYMfDj+zIvWYG0zRAntmuRHBH2JEF2+5rL4GrvFSnjbtZdmbwP+N0 l06e5O0LnK+7Q1+s7lNCp0p0T7u11wAi08VDS4wZrT10X0i9pFucnzGZhBs+ND3dghC9 37WgBj+j/sACo3W0Zf3s8EAVkixe89Y9eP9cED3VBeCS11ViZTTNN6rjHxlTylZg5Fs0 uI7kZ0gPtVqDf0wuuKPW9H9PSahK0mdM3xCcr5x+n9U/WBkIDBihov94vXNFE/WfNMQ5 BcFgFWJOkSG60AXqoaSgDN6KhrwEfPfI7TXAZVoRFm7jtUgtrxiX4vZRe6iJtiD9lCPA XesA== X-Gm-Message-State: APjAAAVSX2Jn9z4T5OoUNRUSkKN5qi+8AkSTpzNPLvv0eMVL20tvqSKK CzfwaxabqNl/OcCgYl0EzvS+B3Lv2fUvolWm1YBHzw== X-Google-Smtp-Source: APXvYqxQilzonYgGRhT+QA+AwfuB+IZ31TKJHQheCGHzsJIF3F3Ns2HplQu/HPC/eZCCe/ALDkwRksUMLFmdHy1Hrik= X-Received: by 2002:a63:af52:: with SMTP id s18mr30581478pgo.263.1582147969204; Wed, 19 Feb 2020 13:32:49 -0800 (PST) MIME-Version: 1.0 References: <20200219045423.54190-1-natechancellor@gmail.com> <20200219045423.54190-4-natechancellor@gmail.com> <20200219093445.386f1c09@gandalf.local.home> <20200219181619.GV31668@ziepe.ca> <20200219195424.GW31668@ziepe.ca> In-Reply-To: <20200219195424.GW31668@ziepe.ca> From: Nick Desaulniers Date: Wed, 19 Feb 2020 13:32:38 -0800 Message-ID: Subject: Re: [PATCH 3/6] tracing: Wrap section comparison in tracer_alloc_buffers with COMPARE_SECTIONS To: Jason Gunthorpe Cc: Nathan Chancellor , Steven Rostedt , Masahiro Yamada , Michal Marek , Arnd Bergmann , Ingo Molnar , Jason Baron , Catalin Marinas , Andrew Morton , LKML , Linux Kbuild mailing list , linux-arch , Linux Memory Management List , clang-built-linux Content-Type: text/plain; charset="UTF-8" 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 Wed, Feb 19, 2020 at 11:54 AM Jason Gunthorpe wrote: > > On Wed, Feb 19, 2020 at 11:11:19AM -0800, Nick Desaulniers wrote: > > > Godbolt says clang is happy if it is written as: > > > > > > if (&__stop___trace_bprintk_fmt[0] != &__start___trace_bprintk_fmt[0]) > > > > > > Which is probably the best compromise. The type here is const char > > > *[], so it would be a shame to see it go. > > > > If the "address" is never dereferenced, but only used for arithmetic > > (in a way that the the pointed to type is irrelevant), does the > > pointed to type matter? > > The type is used here: > > if (*pos < start_index) > return __start___trace_bprintk_fmt + *pos; > > The return expression should be a const char ** > > Presumably the caller of find_next derferences it. > > Jason And the callers of find_next just return the return value from find_next, but suddenly as `void*` (find_next()'s return type is `char**`). So it doesn't seem like the pointed to type matters, hence the recommendation of `void` and then address-of (&) used in comparison+arithmetic. -- Thanks, ~Nick Desaulniers