Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp978429lqs; Wed, 6 Mar 2024 02:36:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWzwHVUnfZzy287RC+09cRisBTv/Z2Wz6Icckq3gDTLtulmRuCc81YzTfTx+BkoR65DSsfhI13V8K8h9GQCpW8QS3os8e96ouQ2wO2IkQ== X-Google-Smtp-Source: AGHT+IE8AxwgfctjhwGFIMUoYQCxPb/CyEYPRBCwm488SBYH2H3XRKPmcMN0KA5BiTAYy22wwAAd X-Received: by 2002:ad4:5106:0:b0:690:9a8a:8558 with SMTP id g6-20020ad45106000000b006909a8a8558mr115410qvp.18.1709721400788; Wed, 06 Mar 2024 02:36:40 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i15-20020ad45c6f000000b0068f74977034si14140691qvh.493.2024.03.06.02.36.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 02:36:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93773-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-93773-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93773-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6124B1C23538 for ; Wed, 6 Mar 2024 10:36:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF26660894; Wed, 6 Mar 2024 10:35:23 +0000 (UTC) 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: 8bit 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 prototype for ‘foo’ [-Wmissing-prototypes] arch/um/os-Linux/main.c:187:7: warning: no previous prototype for ‘__wrap_malloc’ [-Wmissing-prototypes] arch/um/os-Linux/main.c:208:7: warning: no previous prototype for ‘__wrap_calloc’ [-Wmissing-prototypes] arch/um/os-Linux/main.c:222:6: warning: no previous prototype for ‘__wrap_free’ [-Wmissing-prototypes] arch/x86/um/user-offsets.c:17:6: warning: no previous prototype for ‘foo’ [-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) extern void *__real_malloc(int); +/* 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/shared/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 +/* 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)) +/* workaround for a warning with -Wmissing-prototypes */ +void foo(void); + void foo(void) { #ifdef __i386__ -- 2.34.1