Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp390544rdb; Thu, 21 Dec 2023 12:08:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNzn9/xzIb4nUIZNzQY4/Z7WdqydR5phKS2g8TOA2hBgXMH1ZEqvnEidHSKPQEDpFpMybI X-Received: by 2002:a05:6a00:1389:b0:6d9:2e7c:9c76 with SMTP id t9-20020a056a00138900b006d92e7c9c76mr205880pfg.42.1703189301562; Thu, 21 Dec 2023 12:08:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703189301; cv=none; d=google.com; s=arc-20160816; b=HRDml59pOmUvCmDxKMTFEDbpkEt8o6bmnJnC1xmQU+Y6Onn8qXTb1TTMQ4YfkTjHbG 5pPpO/UL3JxT3zYMvq0Pq0bxdxSaMCP6fyXsJmEUheqJ7+/vnRidRH7cMH6gDsm7rkCB rB4s8nZOvs8YL2NkEa7EuiXfE3rvuWThCm4E5ZQLx785aZY1+WLEqfu9+yUaYbLbdEHH L9Qfei8Bmx4E3BxI1QaLtp46+SCoyUm6MRRD7KtPlElcp75LDWIagcHkQQmlmsEbRNu8 MumikAjlEVMnHFqVXLFHTf/EM91/lwz2/6+6oFoHjhHNsR1hbQVS7GtCVsCE/HGpiOVI SMXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=utqNK2Z5ebr5Ah9is9CZfM+/3gvjCU4Z0H/FEO7/fZM=; fh=e5eZVnhbMlEPt4JP0wU6P3zVPlTs314xtHxa2009KGw=; b=GarzAaS59DpxGEZQTBD2o5tTa4xyX9SjaXHw55j9DMEZHRyLU3eFwPpC6v5is7xHo0 yMqkeM/l9wlZp8k6LeBBhHmIgW6TqTBuP6pO3mggEjTzbkbBT4uWLoLeubtVUWVfH03d otor/Ha+qj3uYA0XDS8BkpBiNhZj52NQjSpR0aI1wBQlwQkhOsHnktiRa/P96TxF9+6y JTnsAG8uIaI9RwDhqliI0XUXH2rBl2KwBdv6+z3c/g4pCJ6vXVeptRFHho0mbu/fkXX5 Mwqr9e7UxgPQn7u0raWh6sbqXlLlwjnGbjwlX8qW5cYmpc3G73AQcjsf/7w2lyeZVWN7 Ky7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=IewbGzjc; spf=pass (google.com: domain of linux-kernel+bounces-9031-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9031-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o13-20020a62cd0d000000b006d9847ec3afsi7870pfg.316.2023.12.21.12.08.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 12:08:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9031-linux.lists.archive=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=@google.com header.s=20230601 header.b=IewbGzjc; spf=pass (google.com: domain of linux-kernel+bounces-9031-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9031-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 79AB6287502 for ; Thu, 21 Dec 2023 20:08:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32EB37319B; Thu, 21 Dec 2023 20:08:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="IewbGzjc" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B2DE6EB7D for ; Thu, 21 Dec 2023 20:07:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-203ae9903a6so719308fac.0 for ; Thu, 21 Dec 2023 12:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703189277; x=1703794077; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=utqNK2Z5ebr5Ah9is9CZfM+/3gvjCU4Z0H/FEO7/fZM=; b=IewbGzjcrcEfRLswxcZBbtsCm901klEClFCHlEl9pi5TZTG9p043elx66D313jg37+ gQDRYPDjbPyJBAyteDfUa0+OfJww2mrbVT5QsXZ3+t7ynVwlYslDSoKIoKZXAMFZvoc1 fGmNzbG8sCH5/6/ijNx4S7ic9MphJzUlhNuCw6a3kXn5muG4B1zRcyjrQ5c8FtIO/sa3 NnEdjxHe7ju1FCtQyKOEWvVI2V7H8DTC4YKPphD4/Sv9/tmaBl471VjLsDlj97FyjYpw ylL066KoCjrG6cKYysPgNSxMXpbtSqI0I2vdCZyz06z03foGkIi/ERvCzCnMSuXrg+sE 6DFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703189277; x=1703794077; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=utqNK2Z5ebr5Ah9is9CZfM+/3gvjCU4Z0H/FEO7/fZM=; b=I4TpiipqFRGP7z4vNfhn7oTbVmoEw3/wdiwISqhPAIU2bOy/WqKGMNiWv07g3X4F2Y +4g73jGgXNiyQj6o5WSvHOSngrTtGwRS/XC2u7jIFqk3nU0bOGvdM2YYZ5jMKjsIxWQ1 XS2n+ZprZxr3IKk9l/wvwRVhbpsaENk50YOhni+15kqgwkHihoh/wHlAi/FOCMN6pmuD PgR9I6lfTl3pFKx+pzpvkmC1l9Zq+g4DuvqVYqkPVp5MRLenx7UoLgzdREchvAH/yv8h vRvsFFebok0RLmrOGGI1x2wtIg+MpfDv8dtJ34S3jGoYoYuXaVRcI20o0J8SethRBOZx khQQ== X-Gm-Message-State: AOJu0Yz/SH6TSm6w3eodIpCtfvVkZIXYdjbXx9Mnjo83ZCm7582IbNsb 4wWzx1c3CaZMQuVbcLw8pffGa4QBR9UPlgWOjTtyYLK/g99o X-Received: by 2002:a05:6870:a192:b0:203:7cb2:35 with SMTP id a18-20020a056870a19200b002037cb20035mr406025oaf.60.1703189276982; Thu, 21 Dec 2023 12:07:56 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231221180042.104694-1-andrey.konovalov@linux.dev> In-Reply-To: <20231221180042.104694-1-andrey.konovalov@linux.dev> From: Marco Elver Date: Thu, 21 Dec 2023 21:07:20 +0100 Message-ID: Subject: Re: [PATCH mm] kasan: Mark unpoison_slab_object() as static To: andrey.konovalov@linux.dev Cc: Andrew Morton , Andrey Konovalov , 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 Content-Type: text/plain; charset="UTF-8" On Thu, 21 Dec 2023 at 19:00, wrote: > > 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, > -- > 2.25.1 >