Received: by 2002:ab2:1c04:0:b0:1f7:53ba:1ebe with SMTP id f4csp42015lqg; Fri, 26 Apr 2024 08:16:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU8mzKMOcd1k6q6RoJD52WESjl781Mty+c4dTPO4/cs4KOq2Ihh5vBb/Vv2flOtls35nuYASLMn+5iv2HX7iLyQlCigm+GQ1idfyksXVg== X-Google-Smtp-Source: AGHT+IHuqL+oEsaqIAAwFwNbhLrswPEtiXZf0XW1cW7hHH4HY5JwvXNTGxiyCpn2oAYL0+Df+5SX X-Received: by 2002:a17:906:492:b0:a52:5df2:ab4c with SMTP id f18-20020a170906049200b00a525df2ab4cmr2075751eja.16.1714144600918; Fri, 26 Apr 2024 08:16:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714144600; cv=pass; d=google.com; s=arc-20160816; b=hiE01B5aIRjUNPlodKu6o0CjRbzG+Gk0RXKYhzZ4nE9XeU5Nt58Crv+a822vJ2iOiF ij6AEOfiEoxSUxAGEC+05Rs85TnepCb+rVOoz1foCyjyQ3am9VeK2Qi4IPLSpzKxjbUK JvrOjZcJPjLGsvo56OSP5dYD5n+R1TXXfuxlJ7doO2biiSlmLmzBxl1pYBHKCYgtE2Bd WrvMDi48nQ+8Y9kOnaWFRO5muoAURixAtTpke6wbw3t1lfpcC7/NkAKrWWbHA7b/Pwub gTgvTRgmu2gC1lfjb+yZCVoM86p3+X8cJgeI+dA6iovBT82dLnBo5Ciacgz3/Ecs3n1U fYQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=mHPO0dyii//4VMknkH2zHuAlnk3c2MXp7y0cZ4fRp1g=; fh=Vo4MxA0u7CmSKYL/GjcyKHwusyvU+nKR43bqJem+vcY=; b=L2Tr8CTLEw/WlhduiP+6D4bUDxQkKR4YQtLoxeD+cSbeaWl1Xe7cf4NNz8DFvun3Tv C1H9LUohRFbhLIeHe5SEyfbc/xcNMOT5vOTVuNvdjtDJrWODwGtCNN9efUNp33c2wpvF l81XDATK1kOMtb5y0yiSj/2352Q5QFXYRQEjBRS8WX4+dDQyHxVjCsPhCzXb0qgfFteS te8L5PDKmGP/ocyiiPMt1xrHf7+gfRKXMZ3ZrntVeJX/416QWucJusX9yFAGyIJdRinu XPLp4GrRGx+thHOnEv6F6rpSw3Bn4o1clTldvlmQFscn9FVScrk+gTO7apWpLjepbSqz FU/Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-160249-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qf12-20020a1709077f0c00b00a55b3327e3bsi6963129ejc.944.2024.04.26.08.16.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 08:16:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160249-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-160249-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 90AB11F27DC6 for ; Fri, 26 Apr 2024 15:16:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 066E8173333; Fri, 26 Apr 2024 15:10:52 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47B9D148FF6 for ; Fri, 26 Apr 2024 15:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714144251; cv=none; b=MvvogvSIN15dSlFg3i/0NcRIyr9nS/XoP4VhhB7VCOdfC/mRmBLg4N4Ik0NZ8eLwak8q4139gtiZwEheCGtaBNHRyoTFdie4ac6ab2pSSk0hTIw6lOeVz/h6Y7Kpny50935/eVqzw5iitu1tOLkBmFqODfz2Fhp4WdavkJRGb3k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714144251; c=relaxed/simple; bh=DNQBOpOSOn3QTnTEG5GsWSOwJfjR4rA2vSKIl4S1DsM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DoOftOmZvmdRYBD651FLspJjR/bKL1ScN69begRKAJJISFKPX72CgOB0ebNUzH5ilTpTz+Ye7mhCR4YbRPlJCihT1ZOjLKa/GboEnAPpEp5z0kARi3shkF8lpm1OoTj/prumePiJN3hNq8sLF5qbByxEY9FpPg3ztKXitAQAfdI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A35241007; Fri, 26 Apr 2024 08:11:17 -0700 (PDT) Received: from e133380.cambridge.arm.com (e133380.arm.com [10.1.197.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6DA3C3F73F; Fri, 26 Apr 2024 08:10:46 -0700 (PDT) From: Dave Martin To: x86@kernel.org, linux-kernel@vger.kernel.org Cc: James Morse , Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, "Shaopeng Tan (Fujitsu)" , baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , Peter Newman , dfustini@baylibre.com, amitsinght@marvell.com, David Hildenbrand , Rex Nie Subject: [PATCH v2 31/35] x86/resctrl: Prefer alloc(sizeof(*foo)) idiom in rdt_init_fs_context() Date: Fri, 26 Apr 2024 16:09:00 +0100 Message-Id: <20240426150904.8854-31-Dave.Martin@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240426150904.8854-1-Dave.Martin@arm.com> References: <20240426150537.8094-1-Dave.Martin@arm.com> <20240426150904.8854-1-Dave.Martin@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit rdt_init_fs_context() sizes a typed allocation using an explicit sizeof(type) expression, which checkpatch.pl complains about. Since this code is about to be factored out and made generic, this is a good opportunity to fix the code to size the allocation based on the target pointer instead, to reduce the chance of future mis- maintenance. Fix it. No functional change. Signed-off-by: Dave Martin --- Changes in v2: * New patch. --- arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c index 5cb0d6f805bd..b797dc4804d3 100644 --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c @@ -2860,7 +2860,7 @@ static int rdt_init_fs_context(struct fs_context *fc) { struct rdt_fs_context *ctx; - ctx = kzalloc(sizeof(struct rdt_fs_context), GFP_KERNEL); + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; -- 2.34.1