From patchwork Thu Feb 20 05:15:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11393359 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5376F159A for ; Thu, 20 Feb 2020 05:15:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1672D24654 for ; Thu, 20 Feb 2020 05:15:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xx3FHDhV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1672D24654 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 611016B0007; Thu, 20 Feb 2020 00:15:57 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5C2646B0008; Thu, 20 Feb 2020 00:15:57 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4FEDE6B000A; Thu, 20 Feb 2020 00:15:57 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0205.hostedemail.com [216.40.44.205]) by kanga.kvack.org (Postfix) with ESMTP id 35B396B0007 for ; Thu, 20 Feb 2020 00:15:57 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 050608248D7C for ; Thu, 20 Feb 2020 05:15:57 +0000 (UTC) X-FDA: 76509343512.07.cry68_6e1c164409e18 X-Spam-Summary: 2,0,0,a424dd2867008951,d41d8cd98f00b204,natechancellor@gmail.com,:catalin.marinas@arm.com:akpm@linux-foundation.org::linux-kernel@vger.kernel.org:clang-built-linux@googlegroups.com:natechancellor@gmail.com:ndesaulniers@google.com,RULES_HIT:41:355:379:541:800:960:967:973:988:989:1260:1311:1314:1345:1437:1515:1534:1541:1711:1730:1747:1777:1792:2198:2199:2393:2525:2559:2564:2682:2685:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3503:3504:3865:3866:3867:3868:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4605:5007:6119:6261:6653:7514:8957:9025:9413:10004:11026:11658:11914:12043:12294:12297:12438:12517:12519:12555:12679:12895:12986:13069:13161:13229:13311:13357:13894:13972:14096:14181:14384:14394:14687:14721:21080:21444:21451:21627:21666:21811:21939,0,RBL:209.85.167.195:@gmail.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL: 0,DNSBL: X-HE-Tag: cry68_6e1c164409e18 X-Filterd-Recvd-Size: 4359 Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Feb 2020 05:15:56 +0000 (UTC) Received: by mail-oi1-f195.google.com with SMTP id b18so26367380oie.2 for ; Wed, 19 Feb 2020 21:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vI7Ptj3tyiI6Bv9R/KxNJDPiLdqKFuHEWY4U42IkyNA=; b=Xx3FHDhVfLZEkroQaeX3VQq7Ab3/xB9qwIFvpQHqKhD3YRtcbu7ME1pEiRTe5EglhA 9+xRZuuXJjIvODxi8ljQNn7EfcpMUj5s1dfUeCNazpZEKLitPFqVOWvn8gb6GaNcNSMu g45N4HO0etsz1s+K4dIUjwy1q0KsK+pjN5hhzgJMzouDldSUT8zIH0Mv6SGVuKy+hXII 0SQWGrJ1e8m7Umil/IQLznTX5AvEwi8psnserhQMK5JfVcI1rz0+ZQ3AplZtJWAaNmYk dslrthV9NHe+qRO0LuwDJnX0uxJu8quxpjs/lzi4DX7HO+I5z7m3UxYaKJjwTEFzC2vo PF5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vI7Ptj3tyiI6Bv9R/KxNJDPiLdqKFuHEWY4U42IkyNA=; b=VUmPJxdTxPfBy3vNhIIS6+UdPoatN44F8by8d71SdR0fm4wvcpUYqV3uAhcOJVeWX7 y4Zfjhbl8APFX2dtW2yKrcP4nNb6/2P8Rfm4i5B77KhE56HkL7pSv1pIi8yYaq2KXMAy jkd83c4wWM61MCN5d/sN5hZ5hlhyWiTa7AbgCiEvGQRHzHYmJPOVrnKezGHypRt1bJQT FhgpEis4c5xLFTM0bnq++lsKCQ+kKhEtp1Zkl9DVk6teRZm2dub3Hxjw7pUtnIYhhCuh 9Tk7+8Bq+bfm8eGO2pOuPjJ/EnEpFRMs03s21+RGYytzkhPV47ESU7uytBxRf6XSs9jH JEJg== X-Gm-Message-State: APjAAAV+OgTYWwa7Y4QAId+bniA1IwFUUYoTYh79Ql/tSwOX/vvRNhX0 jYr/vBUSEfdwJR5xJtMKJNo= X-Google-Smtp-Source: APXvYqzLhYgiQPTpzyMusksg+32NvOyeip6pnteaQB8FdBhJwdu5dbcEm0EpZwfEdvYHwFQeEq5Pfw== X-Received: by 2002:aca:4b0f:: with SMTP id y15mr786374oia.153.1582175755792; Wed, 19 Feb 2020 21:15:55 -0800 (PST) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id s12sm756411oic.31.2020.02.19.21.15.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 21:15:55 -0800 (PST) From: Nathan Chancellor To: Catalin Marinas , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor , Nick Desaulniers Subject: [PATCH v2] mm: kmemleak: Use address-of operator on section symbols Date: Wed, 19 Feb 2020 22:15:51 -0700 Message-Id: <20200220051551.44000-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Patchwork-Bot: notify X-Bogosity: Ham, tests=bogofilter, spamicity=0.000008, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Clang warns: These are not true arrays, they are linker defined symbols, which are just addresses. Using the address of operator silences the warning and does not change the resulting assembly with either clang/ld.lld or gcc/ld (tested with diff + objdump -Dr). Link: https://github.com/ClangBuiltLinux/linux/issues/895 Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Acked-by: Catalin Marinas --- v1 -> v2: https://lore.kernel.org/lkml/20200219045423.54190-6-natechancellor@gmail.com/ * No longer a series because there is no prerequisite patch. * Use address-of operator instead of casting to unsigned long. mm/kmemleak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index aa6832432d6a..788dc5509539 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1952,7 +1952,7 @@ void __init kmemleak_init(void) create_object((unsigned long)__bss_start, __bss_stop - __bss_start, KMEMLEAK_GREY, GFP_ATOMIC); /* only register .data..ro_after_init if not within .data */ - if (__start_ro_after_init < _sdata || __end_ro_after_init > _edata) + if (&__start_ro_after_init < &_sdata || &__end_ro_after_init > &_edata) create_object((unsigned long)__start_ro_after_init, __end_ro_after_init - __start_ro_after_init, KMEMLEAK_GREY, GFP_ATOMIC);