From patchwork Thu Dec 21 18:00:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 182372 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp585366dyi; Thu, 21 Dec 2023 10:01:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IHo46pJdIjQa1wNhbWbAHDUCkG2vfzYuAJWcDxlaDoDrmVqELMMLFrBwJebIK/LUi4lfNGu X-Received: by 2002:a17:902:d507:b0:1d3:adee:1136 with SMTP id b7-20020a170902d50700b001d3adee1136mr10541plg.54.1703181670432; Thu, 21 Dec 2023 10:01:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703181670; cv=none; d=google.com; s=arc-20160816; b=nY5oKIolh96UAHMRRTuoVgiVh8sXKsENXm4Yp/rU27kRze8eXL8Q1wRLca+LmLmH6e j5ZyLdMSma/4BdzQSf0zRVANusnXpWz7zE7UjWscFtjPeYIBquhL6kaHRv84Tz20NttV ULMXv+Sybe7ZcUrZnDvaCxqSPZR1ZF515q7j+KO662UgMwUulR3hcztwTb+lph3vVWNZ ZosoAb09ceC1IqR+hOK2LRpUSr+vYpRenpSfEhEnDM/9sUmoRrR0Qsm+mT3drqpt0ous hcozRb6njfCpmNNwvYoExiIWftHREJhQaFnic6xBeoxcdOdsrJ4nAYF5X9D2FLMDQGkC GN2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ztPTKR8sr9h6D18SGkQNBYXp/fqVZdKTe5VGqgvKvQk=; fh=rrYYxR7rPrfZ9oPDzrWqTdscfrSKKogWCwrUGRk3Wag=; b=ueLlOi61DMfWN3l3ftpazcgBnELyEPHS9+qjJiJsF86CAwrNg86rd0ZkNNIShOYpcs bc5WzAVGtS4gyS1O25fgENztr0mmf1oteI+gr86QbTYFWTCl25eTSDUQHWIePBqjODev m+cy7S6DHQvFwmYM2/7tYGCh8ke9nka3FePgaMDVZtRx2+gAATLuRFBhw0Xcoh2TEMl8 UvGRqPW07ox82hCcVaTtdr9eif4xcAegupg1+Dd/U/qkJQC2zWDdWqzCsP6apGVOpzMw sIPqJkwsTfPmHaMJc+iflBHvhT4lUuImgBiPXKymEi6nZxyoipZwgIfQLKKlNrIVzQph bJfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ea6gr3dH; spf=pass (google.com: domain of linux-kernel+bounces-8884-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8884-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id jv20-20020a170903059400b001d3f285561asi1811199plb.29.2023.12.21.10.01.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 10:01:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8884-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=ea6gr3dH; spf=pass (google.com: domain of linux-kernel+bounces-8884-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8884-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E3F8B289138 for ; Thu, 21 Dec 2023 18:01:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 123AA63514; Thu, 21 Dec 2023 18:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ea6gr3dH" X-Original-To: linux-kernel@vger.kernel.org Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 822A55990A for ; Thu, 21 Dec 2023 18:00:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1703181649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ztPTKR8sr9h6D18SGkQNBYXp/fqVZdKTe5VGqgvKvQk=; b=ea6gr3dHoZVnBVxsz7Lv0gahIQ7R6TjWF+UWkxyDh6aRnEKLyT6WCUetH/UFbxrfUHM2nX ZiHFFaywum9XP//SPR5kuQLc5lxkrbC/ghAWwN1WS77TNJMUlFfKUnMlhUuaLnC/sPcJ4Y ZLmtpE2KnHgmrE0amIm/az1Ms2e+PQo= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Nathan Chancellor , Tetsuo Handa , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm] kasan: Mark unpoison_slab_object() as static Date: Thu, 21 Dec 2023 19:00:42 +0100 Message-Id: <20231221180042.104694-1-andrey.konovalov@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785915423534183898 X-GMAIL-MSGID: 1785915423534183898 From: Nathan Chancellor With -Wmissing-prototypes enabled, there is a warning that unpoison_slab_object() has no prototype, breaking the build with CONFIG_WERROR=y: mm/kasan/common.c:271:6: error: no previous prototype for 'unpoison_slab_object' [-Werror=missing-prototypes] 271 | void unpoison_slab_object(struct kmem_cache *cache, void *object, gfp_t flags, | ^~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Mark the function as static, as it is not used outside of this translation unit, clearing up the warning. Fixes: 3f38c3c5bc40 ("kasan: save alloc stack traces for mempool") Signed-off-by: Nathan Chancellor Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver --- Changes v1->v2: - Mark as "static inline" instead of just "static". --- mm/kasan/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/kasan/common.c b/mm/kasan/common.c index ebb1b23d6480..f4255e807b74 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -277,8 +277,8 @@ void __kasan_kfree_large(void *ptr, unsigned long ip) /* The object will be poisoned by kasan_poison_pages(). */ } -void unpoison_slab_object(struct kmem_cache *cache, void *object, gfp_t flags, - bool init) +static inline void unpoison_slab_object(struct kmem_cache *cache, void *object, + gfp_t flags, bool init) { /* * Unpoison the whole object. For kmalloc() allocations,