Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1270202rdb; Sat, 7 Oct 2023 23:02:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFf1zH/zfe6gfXNKbHYo6NBhvrg+LWfrruRPEnvZQ4mQKcTdWEe3t4A2a7c9FE5YhwHCug5 X-Received: by 2002:a05:6a20:7d94:b0:16b:e2e5:fe5e with SMTP id v20-20020a056a207d9400b0016be2e5fe5emr6950588pzj.31.1696744953915; Sat, 07 Oct 2023 23:02:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696744953; cv=none; d=google.com; s=arc-20160816; b=AEa1cqY/efkKckt8JFaFfW93xQnE8MJByFqrONql+ICDCvulSVOdbkhsVdklIJEl+L hh/fZwRVxkZYkJAQuZIoHnQsOFZlFVwxwfEQHzIUm13tHnxXbhqUqjGxk8u7JY5yAr3S j//qzKQ7iCb329Pj/AooffRFd8n1d4cRs5djN5aR+CkqHB0+kHw68lNfvdbtrSr98hPy hUb0Xf2S6/Tz/MYuVkwIosZttGthbXxLtyy0Evd4267y8agEhXlKy4ENGxiDOPUJ+ulV DnJLHRCrkzKBuCGCkcbIAh/ltlSya8TXZKl440+/9C9zo3FEzaE+zdRXKKlmrp7LKX+R 8ymQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=qEmYvPMGJOQ0JSlCeFZoLrzezmGe6GVNGXiHbS3/gvI=; fh=qcRDIyb3il+pySrMhqH0d+7yg73DJ9bNRY9Na8xrDyY=; b=jyrhB1c9WITimB1oEbp/os5WHIHpxi45pniamW9Mr87dIESRSEvAhdTZ1tSyUvz5mN xmdqTQBeKjJpLQCzwMErOTAfQ/0Ra09hyg5ZhHmE3Pva+ENO5p5inh56ZOy2oi4yG/TM Sc8lx/j55L2ZyZk/HeiItDilKDk7UabJagwDcFWKdkeMU2+dyO54Zj4JrALr65o7Oum+ VIfv5Lf80vddqsy9AkgbP6UyVbFbmyoMsc1ZrvUeaTGzY7WwXEYOZaSAdcwaFjBmAe7w rPbbLNcfY4O+S6dBrbHv/r90Jh/BjAk13K4Xr3PmD9ccjP3Bn7I2ik/9kwt3CTiUO6Mh t7xQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k4-20020a056a00168400b00690fc88e4acsi5244480pfc.228.2023.10.07.23.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 23:02:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7C1D9803B2CF; Sat, 7 Oct 2023 23:02:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344414AbjJHGCB (ORCPT + 99 others); Sun, 8 Oct 2023 02:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344363AbjJHGCA (ORCPT ); Sun, 8 Oct 2023 02:02:00 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 04D08BD; Sat, 7 Oct 2023 23:01:58 -0700 (PDT) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 11702604A87F2; Sun, 8 Oct 2023 14:01:48 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org, linux_oss@crudebyte.com Cc: Su Hui , v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] fs/9p/xattr.c: avoid format-overflow warning Date: Sun, 8 Oct 2023 14:01:39 +0800 Message-Id: <20231008060138.517057-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sat, 07 Oct 2023 23:02:31 -0700 (PDT) X-Spam-Level: ** with gcc and W=1 option, there's a warning like this: In file included from fs/9p/xattr.c:12: In function ‘v9fs_xattr_get’, inlined from ‘v9fs_listxattr’ at fs/9p/xattr.c:142:9: include/net/9p/9p.h:55:2: error: ‘%s’ directive argument is null [-Werror=format-overflow=] 55 | _p9_debug(level, __func__, fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ use "" replace NULL to silence this warning. Signed-off-by: Su Hui --- fs/9p/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c index e00cf8109b3f..d995ee080835 100644 --- a/fs/9p/xattr.c +++ b/fs/9p/xattr.c @@ -139,7 +139,7 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name, ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) { - return v9fs_xattr_get(dentry, NULL, buffer, buffer_size); + return v9fs_xattr_get(dentry, "", buffer, buffer_size); } static int v9fs_xattr_handler_get(const struct xattr_handler *handler, -- 2.30.2