From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751202AbdEPB2h (ORCPT ); Mon, 15 May 2017 21:28:37 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33776 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750757AbdEPB2g (ORCPT ); Mon, 15 May 2017 21:28:36 -0400 Date: Tue, 16 May 2017 10:28:29 +0900 From: Joonsoo Kim To: Andrew Morton Cc: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , kernel-team@lge.com Subject: [PATCH(RE-RESEND) v1 01/11] mm/kasan: rename _is_zero to _is_nonzero Message-ID: <20170516012827.GB16015@js1304-desktop> References: <1494897409-14408-1-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1494897409-14408-1-git-send-email-iamjoonsoo.kim@lge.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry for a noise. Failure is due to suspicious subject. Change it and resend. ---------------------->8------------------- >>From 989d7b079c1fd0b934d98d738cbecf7a56f8c6e6 Mon Sep 17 00:00:00 2001 From: Joonsoo Kim Date: Fri, 3 Feb 2017 12:52:13 +0900 Subject: [PATCH v1 01/11] mm/kasan: rename _is_zero to _is_nonzero They return positive value, that is, true, if non-zero value is found. Rename them to reduce confusion. Signed-off-by: Joonsoo Kim --- mm/kasan/kasan.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index c81549d..85ee45b0 100644 --- a/mm/kasan/kasan.c +++ b/mm/kasan/kasan.c @@ -224,7 +224,7 @@ static __always_inline bool memory_is_poisoned_16(unsigned long addr) return false; } -static __always_inline unsigned long bytes_is_zero(const u8 *start, +static __always_inline unsigned long bytes_is_nonzero(const u8 *start, size_t size) { while (size) { @@ -237,7 +237,7 @@ static __always_inline unsigned long bytes_is_zero(const u8 *start, return 0; } -static __always_inline unsigned long memory_is_zero(const void *start, +static __always_inline unsigned long memory_is_nonzero(const void *start, const void *end) { unsigned int words; @@ -245,11 +245,11 @@ static __always_inline unsigned long memory_is_zero(const void *start, unsigned int prefix = (unsigned long)start % 8; if (end - start <= 16) - return bytes_is_zero(start, end - start); + return bytes_is_nonzero(start, end - start); if (prefix) { prefix = 8 - prefix; - ret = bytes_is_zero(start, prefix); + ret = bytes_is_nonzero(start, prefix); if (unlikely(ret)) return ret; start += prefix; @@ -258,12 +258,12 @@ static __always_inline unsigned long memory_is_zero(const void *start, words = (end - start) / 8; while (words) { if (unlikely(*(u64 *)start)) - return bytes_is_zero(start, 8); + return bytes_is_nonzero(start, 8); start += 8; words--; } - return bytes_is_zero(start, (end - start) % 8); + return bytes_is_nonzero(start, (end - start) % 8); } static __always_inline bool memory_is_poisoned_n(unsigned long addr, @@ -271,7 +271,7 @@ static __always_inline bool memory_is_poisoned_n(unsigned long addr, { unsigned long ret; - ret = memory_is_zero(kasan_mem_to_shadow((void *)addr), + ret = memory_is_nonzero(kasan_mem_to_shadow((void *)addr), kasan_mem_to_shadow((void *)addr + size - 1) + 1); if (unlikely(ret)) { -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f69.google.com (mail-pg0-f69.google.com [74.125.83.69]) by kanga.kvack.org (Postfix) with ESMTP id 6F1B06B02EE for ; Mon, 15 May 2017 21:28:36 -0400 (EDT) Received: by mail-pg0-f69.google.com with SMTP id o25so125434384pgc.1 for ; Mon, 15 May 2017 18:28:36 -0700 (PDT) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com. [2607:f8b0:400e:c00::244]) by mx.google.com with ESMTPS id t76si12221192pgc.115.2017.05.15.18.28.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 May 2017 18:28:35 -0700 (PDT) Received: by mail-pf0-x244.google.com with SMTP id f27so7540817pfe.0 for ; Mon, 15 May 2017 18:28:35 -0700 (PDT) Date: Tue, 16 May 2017 10:28:29 +0900 From: Joonsoo Kim Subject: [PATCH(RE-RESEND) v1 01/11] mm/kasan: rename _is_zero to _is_nonzero Message-ID: <20170516012827.GB16015@js1304-desktop> References: <1494897409-14408-1-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1494897409-14408-1-git-send-email-iamjoonsoo.kim@lge.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , kernel-team@lge.com Sorry for a noise. Failure is due to suspicious subject. Change it and resend. ---------------------->8-------------------