Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp330210lqs; Tue, 5 Mar 2024 03:28:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXZPM9aAjgquL88XopfWnzhFLae6aCzB6PrjImXNNDmOggHEDyxQzHkV/+356RLbi/8JbLw7oLZVoOOTjH3FWG2f7vEGjTGau74rWPg+Q== X-Google-Smtp-Source: AGHT+IGcBccqd0Wx8HPLS2y3Px5ZpyQo5SvxNeudSAjqacr3yDvtv8Fxn22/mkZtUKkE29hh5hRG X-Received: by 2002:a81:7208:0:b0:608:b523:c410 with SMTP id n8-20020a817208000000b00608b523c410mr9098569ywc.41.1709638132433; Tue, 05 Mar 2024 03:28:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709638132; cv=pass; d=google.com; s=arc-20160816; b=T8arRZ0+sHhzle7SllWXswpKJiJ7PFuI+a/XOgW//fhARTcJd08iYTnIN0ET5QW/qH T6qwlbPaOeJCe1D7mP3l3sBbkDq3B0EJM/YrDLBsvGnQ9GyYu9pdhvWC0AXkBV2ZMZAM vXX86MQI184M21IqBSqXjxobdnIM7LEKOnRJ8FqPhnAP4sPBqpdlBn7kg/cVKRjoz+vV c/JxjMII7Qox0Fi0ch5rI+M0oL4JwigReI2Ikp5N9jE+UvoU7aBs6vN/IQFHBUg+Zgah KjZJtLRVk7WC6vVM9w+pn6uJPta7l/0Mnmx1LG7CqR4uG21Fm1F3gO6o3ECs1HxCuPRH 5lQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:dkim-signature:from; bh=WOWeUV5eu7K7ADBYbYMGJ4edFmuHXtVaBUr5dj3jp4s=; fh=Piw1h0BsumAD1kdUYuWPctst3Z+ilYPXg1RAsx6YKnc=; b=weh6s+uVkWZvc3/cRFUz0TYa1XWhSeWh73D+qRMKPgmlNnZW7G3BYe61vx93BX+QnG Cj7504N6v/FuxxQCk5iKDIzE5EqKlBiQUlzlFp2dqrYl1UC5SSnII5JD0gD/07rSiMBd 9INekPp2Y7hw6Q23GubblRJHIXwarceV3b6IeytVMiqqRxE/Ge0Mrz+pN5D1H9BpPq3z w765dBQQSxPd2G2eliS1ElwmDjqjciba5ratkFDKxtKB5ejxUroAQALsYNib7tVYbi4g MgR2QLqHhaj5oyfti7f/jRpQbiGvb19RtMFzm+7bvy35AwXEKKATK4+4yz24MG8hGLkD j4sg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=dk9g9bQl; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-92264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w4-20020a05622a134400b0042ef371e0desi4224607qtk.432.2024.03.05.03.28.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 03:28:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=dk9g9bQl; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-92264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C9CF81C2350F for ; Tue, 5 Mar 2024 11:28:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0505C5C5EB; Tue, 5 Mar 2024 11:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="dk9g9bQl" Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 781F75BAE1; Tue, 5 Mar 2024 11:25:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709637942; cv=none; b=uZGW60l9taysni5r9c+uO5xeyOCXXYJmyu68wuxmF99Bvgg4tzD1U60RcIVrFH2TW2algAF46azA1mwpsNV/k1+YH2x1pFEP2bbBlYR9KWjdwUimcpiF9T9TrqVBnfTOnjfTmJOFaKrGgNzWvjFKQ7zEBAwGVHyIFO7Tb9ODTqg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709637942; c=relaxed/simple; bh=5q6fWGzJDF4Cr+t+Q4ZtDga0mNsyD0fKUCudKOgxwSg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oBu6DAyk4YyN29tSkb2KMxId/L6PfcocYJchHpZjmfNfiVCh6kKSb9xVRrVQcPRbhgLGk67jGRdTN14hpWRP0raJnE1WxINMO5NwPL/OJxHyxUg2xalkpIJkBFnLsLNE8XMBprqno9SZHrxQneObc0DiTkocTjxEtkr8C4GmW6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b=dk9g9bQl; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1dca160163dso53284525ad.3; Tue, 05 Mar 2024 03:25:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709637940; x=1710242740; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=WOWeUV5eu7K7ADBYbYMGJ4edFmuHXtVaBUr5dj3jp4s=; b=NxiwUKhvqkatFH5KmljfWAnTtF2L+PlYf5q91Dq5SJCCL0Imx6HD0kn2jEcpHH2xE3 PRuAaTxYIVUzCGR4MhnrcI9tpQBVtEPY9LzetoqMfz3M+hkVqKEJigKYCpmbvxV4XGih mmc+/G1KUxlOokBLYRaIuj9kjzn3+E4Njc2ASQ6K7XxZeSfA/1xj/Bk8GjQBOXJ9Ywnc DI0N7mMvPKMCnF4fYD4mm58sRMFVVBMLYeBl6NC/gY6HHrndFojr2uh4qCWLC12gYX3q 1G3hqFru0xZiPFnkd74fzMUIw1DCINwv/K5OlhRSPbC+YffPHyBrYHsmirIavW0SIDqO p52A== X-Forwarded-Encrypted: i=1; AJvYcCW/Acg0/VBXYSxsA5XEH0TUpq1VFrm1YmEWMCf9DlacguT/cylfwLanwFiWnM0zFRg7c77bYbU7B+lytt/iQHW/aL221mhlOic5+Oxb X-Gm-Message-State: AOJu0YzCjaVh31uSBRkG1YQuqxOiocc7WgakrxGaDnjAu5+XnUKbCmeE Vz1PaHe+j8LJsSSk8f3QbcO8c1iTaQEAdV4sl20P/Hxsle6W6IUM X-Received: by 2002:a17:902:bb8a:b0:1dc:d515:79c8 with SMTP id m10-20020a170902bb8a00b001dcd51579c8mr1263539pls.23.1709637939866; Tue, 05 Mar 2024 03:25:39 -0800 (PST) Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id ld4-20020a170902fac400b001db5b39635dsm10339272plb.277.2024.03.05.03.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 03:25:39 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1709637938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WOWeUV5eu7K7ADBYbYMGJ4edFmuHXtVaBUr5dj3jp4s=; b=dk9g9bQlFxSqOkU79It4v/sOubmLOtz/PRhwBH3x9RKev0kHkvhGDVTq1NuUAUMhlDDGpt KRxNl+b81YXfPXpNOWs3NuyUiBUSUFmlQiJjMMxbCoB4KlWfBDxXgufsprzp6mNu55IBSN HRueo18gcK8gHB4IOjTtZj4WVVEaSqjG4WyJyt75D/ZfrS2ajIiL7PixzgVVahv03qNqK6 9qnY6iYi4faPe7iIDd14yzIRGi4IHYqclPaMJd25GV4Qy8XTYonJ9w4YV4vkurIw8qXlbN D8inmjE3tM88xt/V6qfpt0msqeiRsMl9bVNm1bBxZoTeo8Rf4EaYe9Z++hmm3Q== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Tue, 05 Mar 2024 08:25:21 -0300 Subject: [PATCH 3/6] s390: vmlogrdr: make vmlogrdr_class constant 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: <20240305-class_cleanup-s390-v1-3-c4ff1ec49ffd@marliere.net> References: <20240305-class_cleanup-s390-v1-0-c4ff1ec49ffd@marliere.net> In-Reply-To: <20240305-class_cleanup-s390-v1-0-c4ff1ec49ffd@marliere.net> To: Harald Freudenberger , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, "Ricardo B. Marliere" , Greg Kroah-Hartman X-Developer-Signature: v=1; a=openpgp-sha256; l=2522; i=ricardo@marliere.net; h=from:subject:message-id; bh=5q6fWGzJDF4Cr+t+Q4ZtDga0mNsyD0fKUCudKOgxwSg=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBl5wEgkKSV6XKyqjkv7lQOi6TINRqNdWkXRt6xY KBRZVz9tU6JAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZecBIAAKCRDJC4p8Y4ZY pqiaD/4zbHEgwAVb8nVChiUJIYPSKp8ahQvpA1GNWHYfftzq+PQI6R0lS0v1i0T3GlEuiRXGkbw 1ewhimZ5uflRulGmJRe4znpwaDKL9S8siL04TUPnuHLsLxPxLRbaFKbNEDbD3KgoJb3QX6qdgpz 2xuRYJWIiygGlg1atZehftU2gudqDS4pAEb8JSQUT+Ydgz+e3TIcIBdy2U3O7h7Z92P2I6K5yeY TOr00+Ky2XZjQvqph6fiiWpvrCHJIPHr3IoVGPGJGoyMfVolN8pjvv5Bwv4MYz5pDHKgc+Y/bXw RIVHGG7KDxox/He8MhyzWNhq8+/fDiZ2l30xlFtEo1CRxU1ljS71/y0N45moNt9SpULhMnc4pQc Sx71nKJ0RDzhvouOlmZYkjh8OZwEj7N3xtl0w0knTdin7Hi+/lbWe7SsQ8fhAGAFt04oF+7s29h Clrjr271vQXdd2rVveNTBVYQuo9xoOpw8pYUdG4DJE0q5HUAcELyoQxwzkpAEF3EUWfDt2WWZWT Q9H4/OjMMdbjBluSS3GejgtS6ELzq4nMEm4iGzT5iewvDXdaNJ2ZWzqlC+bKoEnddmITSE6HTWJ adYchmfBk6hfNi9r+OmH5YG2EUKSf14OZZVv1H2iDLAlLnq5d+VKY0qTCFCDtC1VOcuunUS3jQo 5rWtFf//xy6aKiw== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 Since commit 43a7206b0963 ("driver core: class: make class_register() take a const *"), the driver core allows for struct class to be in read-only memory, so move the vmlogrdr_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Greg Kroah-Hartman Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere --- drivers/s390/char/vmlogrdr.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index 6946ba9a9de2..063d8f3565c9 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c @@ -679,7 +679,9 @@ static const struct attribute_group *vmlogrdr_attr_groups[] = { NULL, }; -static struct class *vmlogrdr_class; +static const struct class vmlogrdr_class = { + .name = "vmlogrdr_class", +}; static struct device_driver vmlogrdr_driver = { .name = "vmlogrdr", .bus = &iucv_bus, @@ -699,12 +701,10 @@ static int vmlogrdr_register_driver(void) if (ret) goto out_iucv; - vmlogrdr_class = class_create("vmlogrdr"); - if (IS_ERR(vmlogrdr_class)) { - ret = PTR_ERR(vmlogrdr_class); - vmlogrdr_class = NULL; + ret = class_register(&vmlogrdr_class); + if (ret) goto out_driver; - } + return 0; out_driver: @@ -718,8 +718,7 @@ static int vmlogrdr_register_driver(void) static void vmlogrdr_unregister_driver(void) { - class_destroy(vmlogrdr_class); - vmlogrdr_class = NULL; + class_unregister(&vmlogrdr_class); driver_unregister(&vmlogrdr_driver); iucv_unregister(&vmlogrdr_iucv_handler, 1); } @@ -754,7 +753,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) return ret; } - priv->class_device = device_create(vmlogrdr_class, dev, + priv->class_device = device_create(&vmlogrdr_class, dev, MKDEV(vmlogrdr_major, priv->minor_num), priv, "%s", dev_name(dev)); @@ -771,7 +770,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) static int vmlogrdr_unregister_device(struct vmlogrdr_priv_t *priv) { - device_destroy(vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num)); + device_destroy(&vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num)); if (priv->device != NULL) { device_unregister(priv->device); priv->device=NULL; -- 2.43.0