{"id":2219621,"url":"http://patchwork.ozlabs.org/api/patches/2219621/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260403153852.582746-1-zhang.guodong@linux.dev/","project":{"id":12,"url":"http://patchwork.ozlabs.org/api/projects/12/?format=json","name":"Linux CIFS Client","link_name":"linux-cifs-client","list_id":"linux-cifs.vger.kernel.org","list_email":"linux-cifs@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260403153852.582746-1-zhang.guodong@linux.dev>","list_archive_url":null,"date":"2026-04-03T15:38:52","name":"smb/client: move smb2maperror declarations to smb2proto.h","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"9bc98376c5c54f92db166348c8ea2305f5f4705f","submitter":{"id":92649,"url":"http://patchwork.ozlabs.org/api/people/92649/?format=json","name":"ZhangGuoDong","email":"zhang.guodong@linux.dev"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260403153852.582746-1-zhang.guodong@linux.dev/mbox/","series":[{"id":498647,"url":"http://patchwork.ozlabs.org/api/series/498647/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=498647","date":"2026-04-03T15:38:52","name":"smb/client: move smb2maperror declarations to smb2proto.h","version":1,"mbox":"http://patchwork.ozlabs.org/series/498647/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2219621/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2219621/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-cifs+bounces-10656-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-cifs@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256\n header.s=key1 header.b=wLNw/h6U;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10656-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev\n header.b=\"wLNw/h6U\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=91.218.175.188","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.dev","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.dev"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fnNJh3YLNz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 04 Apr 2026 02:42:28 +1100 (AEDT)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 0BFD1305BFC6\n\tfor <incoming@patchwork.ozlabs.org>; Fri,  3 Apr 2026 15:40:14 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7A0303612EF;\n\tFri,  3 Apr 2026 15:40:11 +0000 (UTC)","from out-188.mta0.migadu.com (out-188.mta0.migadu.com\n [91.218.175.188])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A7E3371D1E\n\tfor <linux-cifs@vger.kernel.org>; Fri,  3 Apr 2026 15:40:09 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1775230811; cv=none;\n b=DkHBKNPpvz6BkrUNTEUxAQyNCbq9N2wQMYhuuY/WuF6voC6UoJc4clUOJ5HBieF9Xwxx7Njh9LLm/+zWqPGYyZtx1PVaQNh2FpFA0iGRe/abO+FZpmZpAZL4wLE6DpgKHoARkTsl09qcKRyrIVTtzse/c+x7SD4hncKNgXJSEi4=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1775230811; c=relaxed/simple;\n\tbh=mY4T69LK6XlZiH2/gE6TC1WoD0Voh24gR6YaIziiKM0=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=LfArfFySzD4/APKnFOYi1R65mv6QcTE6egIX4oJxdOQgR6amVAni1XIWqCfISoXc9BDR9ky3YgsXK4O1Y2CuoNENcXEcze/yE0aF5K2o8ddqssmRghlieN/oribaVu5lZE8OI222Eo1CyRczrIuV9dosWE59BaIZ+shCKLgh6RM=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.dev;\n spf=pass smtp.mailfrom=linux.dev;\n dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev\n header.b=wLNw/h6U; arc=none smtp.client-ip=91.218.175.188","X-Report-Abuse":"Please report any abuse attempt to abuse@migadu.com and\n include these headers.","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;\n\tt=1775230807;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\t to:to:cc:cc:mime-version:mime-version:\n\t content-transfer-encoding:content-transfer-encoding;\n\tbh=IpPwIcJP0yJkhcSNe4ogC9wyhAsPbDr2I0yKy8q5TVo=;\n\tb=wLNw/h6UkMfT0F+ueifRVqyvg9/S+DObwMe+lV+6/RUEQozD23IkJcESE/R1I+runwwNxk\n\tL5Q1c3UCkLIcV/VmzGtODzkxY+STXkcab6dxj66EhxflIQxD7D7MvSgPSp97lK3SAngeFw\n\tTUUEt298KFmZRyKXqZZmGSqanFkwPqQ=","From":"zhang.guodong@linux.dev","To":"smfrench@gmail.com,\n\tchenxiaosong@chenxiaosong.com","Cc":"linux-cifs@vger.kernel.org,\n\tZhangGuoDong <zhangguodong@kylinos.cn>,\n\tChenXiaoSong <chenxiaosong@kylinos.cn>","Subject":"[PATCH] smb/client: move smb2maperror declarations to smb2proto.h","Date":"Fri,  3 Apr 2026 15:38:52 +0000","Message-ID":"<20260403153852.582746-1-zhang.guodong@linux.dev>","Precedence":"bulk","X-Mailing-List":"linux-cifs@vger.kernel.org","List-Id":"<linux-cifs.vger.kernel.org>","List-Subscribe":"<mailto:linux-cifs+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-cifs+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Migadu-Flow":"FLOW_OUT"},"content":"From: ZhangGuoDong <zhangguodong@kylinos.cn>\n\nFor `smb2_error_map_table_test` and `smb2_error_map_num`, if their types\nare changed in `smb2maperror.c` but the corresponding extern declarations\nin `smb2maperror_test.c` are not updated, the compiler will not report an\nerror. Moving them to a common header file allows the compiler to catch\ntype mismatches.\n\nSigned-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>\nReviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>\n---\n fs/smb/client/smb2maperror.c      | 3 ---\n fs/smb/client/smb2maperror_test.c | 6 ++----\n fs/smb/client/smb2proto.h         | 7 ++++++-\n 3 files changed, 8 insertions(+), 8 deletions(-)","diff":"diff --git a/fs/smb/client/smb2maperror.c b/fs/smb/client/smb2maperror.c\nindex 2b8782c4f684..9ed21f7b618c 100644\n--- a/fs/smb/client/smb2maperror.c\n+++ b/fs/smb/client/smb2maperror.c\n@@ -112,9 +112,6 @@ int __init smb2_init_maperror(void)\n #define EXPORT_SYMBOL_FOR_SMB_TEST(sym) \\\n \tEXPORT_SYMBOL_FOR_MODULES(sym, \"smb2maperror_test\")\n \n-/* Previous prototype for eliminating the build warning. */\n-const struct status_to_posix_error *smb2_get_err_map_test(__u32 smb2_status);\n-\n const struct status_to_posix_error *smb2_get_err_map_test(__u32 smb2_status)\n {\n \treturn smb2_get_err_map(smb2_status);\ndiff --git a/fs/smb/client/smb2maperror_test.c b/fs/smb/client/smb2maperror_test.c\nindex 8c47dea7a2c1..f2dce23daa3d 100644\n--- a/fs/smb/client/smb2maperror_test.c\n+++ b/fs/smb/client/smb2maperror_test.c\n@@ -9,11 +9,9 @@\n  */\n \n #include <kunit/test.h>\n+#include \"cifsglob.h\"\n #include \"smb2glob.h\"\n-\n-const struct status_to_posix_error *smb2_get_err_map_test(__u32 smb2_status);\n-extern const struct status_to_posix_error *smb2_error_map_table_test;\n-extern unsigned int smb2_error_map_num;\n+#include \"smb2proto.h\"\n \n static void\n test_cmp_map(struct kunit *test, const struct status_to_posix_error *expect)\ndiff --git a/fs/smb/client/smb2proto.h b/fs/smb/client/smb2proto.h\nindex 230bb1e9f4e1..5f74475ba9d1 100644\n--- a/fs/smb/client/smb2proto.h\n+++ b/fs/smb/client/smb2proto.h\n@@ -14,7 +14,6 @@\n #include <linux/key-type.h>\n #include \"cached_dir.h\"\n \n-struct statfs;\n struct smb_rqst;\n \n /*\n@@ -24,6 +23,12 @@ struct smb_rqst;\n  */\n int map_smb2_to_linux_error(char *buf, bool log_err);\n int smb2_init_maperror(void);\n+#if IS_ENABLED(CONFIG_SMB_KUNIT_TESTS)\n+const struct status_to_posix_error *smb2_get_err_map_test(__u32 smb2_status);\n+extern const struct status_to_posix_error *smb2_error_map_table_test;\n+extern unsigned int smb2_error_map_num;\n+#endif\n+\n int smb2_check_message(char *buf, unsigned int pdu_len, unsigned int len,\n \t\t       struct TCP_Server_Info *server);\n unsigned int smb2_calc_size(void *buf);\n","prefixes":[]}