Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp16870lqp; Tue, 11 Jun 2024 12:59:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXaJju69mapb8Hg+zxu9x0KSOoVyPAtK5Ojky1zUksLgWDtXBRhlwi0z+IlLFm5Mledc9aVwS/EieaaI5puCOKMMaIe2XDlhCdK6dW6fA== X-Google-Smtp-Source: AGHT+IH6RryyTtCZU715YGgt+dHlJgtfOBdhC35yuxiEPhnOhAKSrPGcfjXJuKkC/Tql7jbs8RpY X-Received: by 2002:a05:6e02:20e6:b0:375:a957:b27f with SMTP id e9e14a558f8ab-375a957bd66mr56635225ab.3.1718135942660; Tue, 11 Jun 2024 12:59:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718135942; cv=pass; d=google.com; s=arc-20160816; b=bOdjYhsXVX6W7N2MT6FYf57gGdATlA+kqa492e0Zu1gf6LkHVpNRrtDfK1NyqtHRP0 9kvmBRDCz37ub0Zyg0b+D5J1tOMxbf6XSe3pIStrqsaplAGTSXL5DWHFK9T7kOX4nK/m 1MJq2R+4v7qJqHC8VGGZA3W+Ldmo4zIC1CFyvhXjKwvNuEX8vPHTYM40LWAiLK2VluN/ kvVWRBetZDzMlDWoeuOM6ezQZv5NjMKnBCEVOfRnKDTHrisY3bsw4Jy5HbmD06qjmwo5 2WVZL870R+QQmoTFlYko2V4mQoT+R99WfNSutXtrhLkHPrzkkHjxlLtigyiJrM7pyWG8 NFtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=J3UtuCqDgO+FUcqbXedj2B4aQ9vmXFoB4I0RO6m6E5c=; fh=lm9zrTaM+aH3/crfIN6G0O4A9FWVmZiDVf5be2OSg1U=; b=g7WDVaFyjciq864n1vjIgBazkySNvZCqbgl3O3yKIO1JDIyNNhuNSfmm5MytX74kkr HEiINipy11V7hhWw65VA8RfFBXvLD4IklKlFSwqtkjU66SUmCxe47qBBw7OXuUB5rEMD fJqevFz3tZgYiyVncMFXiqI/YkkRoCyKrDTT57OXAgF8K/9TkRcl4MCM4/g1X5uIXHZW jWfQnpCVxH0gVRHbb17axp4UcWrX9b4zE05dvAXnkdWgSbteapXtr2zR2CvrGuHPig7i vzxLDGKtlHZOcansEKOHWWrxcHamHvbyQUnYg/d5baFqzHPyvwmMGg/6RPEJxcJBDL6C RWfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iu7Bhgpr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210548-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de2073c8fdsi10040542a12.84.2024.06.11.12.59.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 12:59:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iu7Bhgpr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210548-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210548-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 3A6B928159F for ; Tue, 11 Jun 2024 19:59:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9A29143742; Tue, 11 Jun 2024 19:58:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iu7Bhgpr" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EDE6582490 for ; Tue, 11 Jun 2024 19:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718135935; cv=none; b=FpukxAj4+v+4Fxag0yhlXr0MNmU5iN+HRLtv4QeY3gZCJZTJtUvoMYVda+Z9oHbHTFN7rnCVkkrK5GY3a3Tehg9+D9oRPMtne5uXBGav5iy0J4sxCppshp++mFEaMtM4pR74twQbAMCjm9jF3oT2IwJvk3Fp7IR6gos8wtWPqnM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718135935; c=relaxed/simple; bh=lXlj/SstpuQpKJCP8HW5gJ3hni3Cit4VvKRlRHAAa4w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=bbRBBhq0+xAdt4YQw6H+TYHKjoryGm2FGvf2syWaTs9bV0mWZ1iaghUHNW7tZxgu4U1ehy6B64irstikonj4JdvlCCg+rMWgzZmShcZe2oy1YmGPGGRlfQQZKEhgoJpx8ejI48aq79A5msBFT5M04131pEE+j8TwAbKyo3Pwb0o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iu7Bhgpr; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B3D4C2BD10; Tue, 11 Jun 2024 19:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718135934; bh=lXlj/SstpuQpKJCP8HW5gJ3hni3Cit4VvKRlRHAAa4w=; h=From:Date:Subject:To:Cc:From; b=iu7BhgprMOv8XOaBfONHSAx1MZ0tsPJvlJh0PSsKLcpKkvgMQaxkQIQ86soxxL3SQ 2LAtx8PSkRMasS+eya8sp7MhyF9H0KkMVLzX3GvYdfpkwmmbHS6cpIzhiCu/yQkJID IGf/ZY6x25hnmb7NC9gW7Vr13tdaLUxr3clTbdbicHIndhtALLVDVC8Qpa3TefzCjK 6ckg+gWMWtx2TzB3vkyqHkp/amtXkKuZGS5q96mHtJz4RXz4F+9rB++s588SWhB11h scVLUExz8DwgB6N+MwkOADpUblBoNfunvxk5lNr3WcaktmHElxEa63j74V3PcMSjGD +AYBDUEHbsrRg== From: Nathan Chancellor Date: Tue, 11 Jun 2024 12:58:41 -0700 Subject: [PATCH] hostfs: Add const qualifier to host_root in hostfs_fill_super() 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: 7bit Message-Id: <20240611-hostfs-fix-mount-api-conversion-v1-1-ef75bbc77f44@kernel.org> X-B4-Tracking: v=1; b=H4sIAHCsaGYC/x2NSwqAMAwFryJZG7BV/F1FXJSaaha20qgI4t2tL gfevLlBKDIJ9NkNkU4WDj6ByjOwi/EzIU+JQRe6KmqlcAmyO0HHF67h8DuajdEGf1L8XGxLmoz ubFM5gvSyRUrbvzCMz/MCkc5BuXEAAAA= To: Christian Brauner Cc: Hongbo Li , Richard Weinberger , Anton Ivanov , Johannes Berg , linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Nathan Chancellor X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1528; i=nathan@kernel.org; h=from:subject:message-id; bh=lXlj/SstpuQpKJCP8HW5gJ3hni3Cit4VvKRlRHAAa4w=; b=owGbwMvMwCUmm602sfCA1DTG02pJDGkZa2qXOP7YIvwhTFa/7j7T7FabE9Yrc+KesvFMm8IZr z/zu8LXjlIWBjEuBlkxRZbqx6rHDQ3nnGW8cWoSzBxWJpAhDFycAjCRakZGhuPcM21muJdM8fRa GZci717ov/I9l+LbadwzdI9NWDHvvw3DP/0Xe9pduV3ZpZM44zasq9ui6CO+2dTb3ffBDEMvQS0 ddgA= X-Developer-Key: i=nathan@kernel.org; a=openpgp; fpr=2437CB76E544CB6AB3D9DFD399739260CB6CB716 After the recent conversion to the new mount API, there is a warning when building hostfs (which may be upgraded to an error via CONFIG_WERROR=y): fs/hostfs/hostfs_kern.c: In function 'hostfs_fill_super': fs/hostfs/hostfs_kern.c:942:27: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 942 | char *host_root = fc->source; | ^~ Add the 'const' qualifier, as host_root will not be modified after its assignment. Move the assignment to keep the existing reverse Christmas tree order intact. Fixes: cd140ce9f611 ("hostfs: convert hostfs to use the new mount API") Signed-off-by: Nathan Chancellor --- fs/hostfs/hostfs_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 6ec3c368d7bf..e44747bbfe87 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -938,8 +938,8 @@ static const struct inode_operations hostfs_link_iops = { static int hostfs_fill_super(struct super_block *sb, struct fs_context *fc) { struct hostfs_fs_info *fsi = sb->s_fs_info; + const char *host_root = fc->source; struct inode *root_inode; - char *host_root = fc->source; int err; sb->s_blocksize = 1024; --- base-commit: cd140ce9f611a5e9d2a5989a282b75e55c71dab3 change-id: 20240611-hostfs-fix-mount-api-conversion-83eda29c74fe Best regards, -- Nathan Chancellor