From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH 3/6] tracing: Wrap section comparison in tracer_alloc_buffers with COMPARE_SECTIONS Date: Wed, 19 Feb 2020 15:54:24 -0400 Message-ID: <20200219195424.GW31668@ziepe.ca> References: <20200219045423.54190-1-natechancellor@gmail.com> <20200219045423.54190-4-natechancellor@gmail.com> <20200219093445.386f1c09@gandalf.local.home> <20200219181619.GV31668@ziepe.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kbuild-owner@vger.kernel.org To: Nick Desaulniers 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 List-Id: linux-arch.vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 19 Feb 2020 15:54:24 -0400 From: Jason Gunthorpe Subject: Re: [PATCH 3/6] tracing: Wrap section comparison in tracer_alloc_buffers with COMPARE_SECTIONS Message-ID: <20200219195424.GW31668@ziepe.ca> References: <20200219045423.54190-1-natechancellor@gmail.com> <20200219045423.54190-4-natechancellor@gmail.com> <20200219093445.386f1c09@gandalf.local.home> <20200219181619.GV31668@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org To: Nick Desaulniers 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 List-ID: Message-ID: <20200219195424.oljxqPeeSmOIZxyG1YbOBBhmiv7PygWK1CWd0hdaL2k@z> 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