From nobody Wed Dec 24 23:51:05 2025 Received: from out0-208.mail.aliyun.com (out0-208.mail.aliyun.com [140.205.0.208]) (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 2FF88605BD for ; Wed, 6 Mar 2024 10:35:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.208 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709721323; cv=none; b=PVbBdqt0e0eDHb1EIVrBk7fGmPMlUcVjiN9vi9l7eju7GcYLmF+ztOcjmrVXqUT1nHhxQu2/BxEiqZ7u9MDlcO1z9hj8eZFXYp9ZN5xYsT0meSDSBfkd3rRWgn79fKcxc48JpkjHYNs3dxx8PRSjwMKL1RKLnUDn2hDWCgYFYxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709721323; c=relaxed/simple; bh=zBjAivud5mTNfsW4xRhvWvtLToxsTYEYwBbFkqAQ+MM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=R5GqYu9yBqQcYElHzg5woCsuSwWikOosGot0t00zU2y6VVjvy9YDytA35mBEGZHW6fTYK29/hU/vetImVq9ZTD9XGChM5pTWl4bAW7rz6MYxKIMubS8WH4/eLRoRU4izNH4125LOLUOfoBhdqKqeHOExK4wDVEz2o6XRwpjHp2o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; arc=none smtp.client-ip=140.205.0.208 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047205;MF=tiwei.btw@antgroup.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---.Wgbn-K9_1709720384; Received: from ubuntu..(mailfrom:tiwei.btw@antgroup.com fp:SMTPD_---.Wgbn-K9_1709720384) by smtp.aliyun-inc.com; Wed, 06 Mar 2024 18:19:44 +0800 From: "Tiwei Bie" To: richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: , , , , "Tiwei Bie" Subject: [PATCH v3 9/9] um: Fix -Wmissing-prototypes warnings for __warp_* and foo Date: Wed, 06 Mar 2024 18:19:25 +0800 Message-Id: <20240306101925.1088870-10-tiwei.btw@antgroup.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240306101925.1088870-1-tiwei.btw@antgroup.com> References: <20240306101925.1088870-1-tiwei.btw@antgroup.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable These functions are not called explicitly. Let's just workaround the -Wmissing-prototypes warnings by declaring them locally similar to what was done in arch/x86/kernel/asm-offsets_32.c. This will address below -Wmissing-prototypes warnings: ./arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prot= otype for =E2=80=98foo=E2=80=99 [-Wmissing-prototypes] arch/um/os-Linux/main.c:187:7: warning: no previous prototype for =E2=80=98= __wrap_malloc=E2=80=99 [-Wmissing-prototypes] arch/um/os-Linux/main.c:208:7: warning: no previous prototype for =E2=80=98= __wrap_calloc=E2=80=99 [-Wmissing-prototypes] arch/um/os-Linux/main.c:222:6: warning: no previous prototype for =E2=80=98= __wrap_free=E2=80=99 [-Wmissing-prototypes] arch/x86/um/user-offsets.c:17:6: warning: no previous prototype for =E2=80= =98foo=E2=80=99 [-Wmissing-prototypes] Signed-off-by: Tiwei Bie --- arch/um/os-Linux/main.c | 5 +++++ arch/x86/um/shared/sysdep/kernel-offsets.h | 3 +++ arch/x86/um/user-offsets.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index c8a42ecbd7a2..e82164f90288 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -184,6 +184,11 @@ int __init main(int argc, char **argv, char **envp) =20 extern void *__real_malloc(int); =20 +/* workaround for -Wmissing-prototypes warnings */ +void *__wrap_malloc(int size); +void *__wrap_calloc(int n, int size); +void __wrap_free(void *ptr); + void *__wrap_malloc(int size) { void *ret; diff --git a/arch/x86/um/shared/sysdep/kernel-offsets.h b/arch/x86/um/share= d/sysdep/kernel-offsets.h index a004bffb7b8d..48de3a71f845 100644 --- a/arch/x86/um/shared/sysdep/kernel-offsets.h +++ b/arch/x86/um/shared/sysdep/kernel-offsets.h @@ -6,6 +6,9 @@ #include #include =20 +/* workaround for a warning with -Wmissing-prototypes */ +void foo(void); + void foo(void) { #include diff --git a/arch/x86/um/user-offsets.c b/arch/x86/um/user-offsets.c index e54a9814ccf1..1c77d9946199 100644 --- a/arch/x86/um/user-offsets.c +++ b/arch/x86/um/user-offsets.c @@ -14,6 +14,9 @@ COMMENT(#val " / sizeof(unsigned long)"); \ DEFINE(sym, val / sizeof(unsigned long)) =20 +/* workaround for a warning with -Wmissing-prototypes */ +void foo(void); + void foo(void) { #ifdef __i386__ --=20 2.34.1