Message ID | 20240216051640.197378-2-vinicius.gomes@intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-68065-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp307948dyb; Thu, 15 Feb 2024 21:18:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWLPZdw0MxBjwMjCzMwxBISDwNbtLtcgs1l742qlTTjLAqSHrcRA83uq2oYp+EPC8zNwCki+dtc7aqzhJo9eVXZs/WOSA== X-Google-Smtp-Source: AGHT+IGzGW+1I1sbnlYgSllIecnVXNydrLL66OGIBbeWAKSWh1sIdKh1jC47AmpnuUSjOyLkyY9D X-Received: by 2002:a17:90b:ec6:b0:299:32d8:fd78 with SMTP id gz6-20020a17090b0ec600b0029932d8fd78mr1004227pjb.1.1708060738254; Thu, 15 Feb 2024 21:18:58 -0800 (PST) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z19-20020a17090ab11300b00296a76aa707si4162912pjq.185.2024.02.15.21.18.57 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 21:18:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68065-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=kKzwnVlZ; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-68065-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68065-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B15BCB23BC8 for <ouuuleilei@gmail.com>; Fri, 16 Feb 2024 05:17:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 708AE179A7; Fri, 16 Feb 2024 05:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kKzwnVlZ" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 DC1CE13AEE; Fri, 16 Feb 2024 05:16:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708060620; cv=none; b=cdUFrVABPCj7/6Y8EgKGs80BPAP1vnYDHZ9kJ7OTdpXkwGFQgZsUdOA6yCnuI1RYtu2Nof+s3AfqTYkYB1qXkU2G5e+YThtH0bxd/wCbKifAHe8ECjjfaIEcWdr69HSdwVbfzgUsWyDbdHcBCGdg/wMIad2+Db998jeiazPABYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708060620; c=relaxed/simple; bh=12AqPGeOC8NWhAo998Q7/iqcQ/iILovqoqyU9sHyqR8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Y7mXofW13G7Vz/zcgTyyI3JR6bGjnEqWBGDIQj2ahvk0xH3EDA240neBMAqOYD4Px0oKXpltYihkOHrFkq2yk85hq7MbQXmt4q0lU8PT8mvxPkML4vUaDLoAZhZBipk3c4ZHC3ff01XOsVMCJEXF/uOsKineOE4i+W6m/TcWMx0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=kKzwnVlZ; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708060619; x=1739596619; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=12AqPGeOC8NWhAo998Q7/iqcQ/iILovqoqyU9sHyqR8=; b=kKzwnVlZLD2eR+VjcIRIth3PSfNsmszRnR4kYv0YDciagzy0jc6MFj2b D0RMWpR9xeMoZW9+apfXPD9reK1W25Q1R9joNPKtJGByX3gyNTXlH6KTo F9KZlxsC8XJX+C3uOEOkZXVsWk8aM/RcHsFg2BBPqSAzV0wJSF1ggbI2b ggBmiMfD4cW1WV8jBnfMXEgwvAHg3CjKS7DQVhR6s7pZXRcWeWl93pZru gaSA9CmCoHYYpt+FwVpeEQUxiylrfshKNaDl/+2/AYIqoUfwObdFEu1F7 iM0VsdNm0DprGTLvIhU8VJPuV1JO7So4FHCFLGw2R3dywhLBkF8j4ROHD g==; X-IronPort-AV: E=McAfee;i="6600,9927,10985"; a="5149342" X-IronPort-AV: E=Sophos;i="6.06,163,1705392000"; d="scan'208";a="5149342" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2024 21:16:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,163,1705392000"; d="scan'208";a="4063885" Received: from lvngo-mobl1.amr.corp.intel.com (HELO vcostago-mobl3.intel.com) ([10.125.17.186]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2024 21:16:56 -0800 From: Vinicius Costa Gomes <vinicius.gomes@intel.com> To: brauner@kernel.org, amir73il@gmail.com, hu1.chen@intel.com Cc: miklos@szeredi.hu, malini.bhandaru@intel.com, tim.c.chen@intel.com, mikko.ylinen@intel.com, lizhen.you@intel.com, linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Vinicius Costa Gomes <vinicius.gomes@intel.com> Subject: [RFC v3 1/5] cleanup: Fix discarded const warning when defining lock guard Date: Thu, 15 Feb 2024 21:16:36 -0800 Message-ID: <20240216051640.197378-2-vinicius.gomes@intel.com> X-Mailer: git-send-email 2.43.1 In-Reply-To: <20240216051640.197378-1-vinicius.gomes@intel.com> References: <20240216051640.197378-1-vinicius.gomes@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791031496521165336 X-GMAIL-MSGID: 1791031496521165336 |
Series |
overlayfs: Optimize override/revert creds
|
|
Commit Message
Vinicius Costa Gomes
Feb. 16, 2024, 5:16 a.m. UTC
Fix the following warning when defining a cleanup guard for a "const"
pointer type:
/include/linux/cleanup.h:211:18: warning: return discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
211 | return _T->lock; \
| ~~^~~~~~
/include/linux/cleanup.h:233:1: note: in expansion of macro ‘__DEFINE_UNLOCK_GUARD’
233 | __DEFINE_UNLOCK_GUARD(_name, _type, _unlock, __VA_ARGS__) \
| ^~~~~~~~~~~~~~~~~~~~~
/include/linux/cred.h:193:1: note: in expansion of macro ‘DEFINE_LOCK_GUARD_1’
193 | DEFINE_LOCK_GUARD_1(cred, const struct cred, _T->lock = override_creds_light(_T->lock),
| ^~~~~~~~~~~~~~~~~~~
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
---
include/linux/cleanup.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/cleanup.h b/include/linux/cleanup.h index c2d09bc4f976..085482ef46c8 100644 --- a/include/linux/cleanup.h +++ b/include/linux/cleanup.h @@ -208,7 +208,7 @@ static inline void class_##_name##_destructor(class_##_name##_t *_T) \ \ static inline void *class_##_name##_lock_ptr(class_##_name##_t *_T) \ { \ - return _T->lock; \ + return (void *)_T->lock; \ }