Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp449108rwe; Wed, 19 Apr 2023 00:55:49 -0700 (PDT) X-Google-Smtp-Source: AKy350Y9rgivv9DnwbuXGOR8r5xgpHwlXvuJpQYtuO+QZdH5yLR+VtMBKxKhK1oxKfXTxG8T3fkA X-Received: by 2002:a17:903:1250:b0:1a6:46e0:6a15 with SMTP id u16-20020a170903125000b001a646e06a15mr5450027plh.44.1681890949685; Wed, 19 Apr 2023 00:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681890949; cv=none; d=google.com; s=arc-20160816; b=w6iOVvXFGbTsBG2z2sqEGd37EiipCy0QBwj3a/DBn1Wh+IfRfABLTa7sjPWbo2Da0j 3ocGb1Xr2WUSZa1eWSxYl/stGQKRxfN/R3g9/2HbhQRoiHXs/kj10op0Uo9nH1Us4KTs jsgTL0IwhpuHHYyww+l0OvEShjK1P3GqdYqemsgd7i+rYlS7F48TO2Gvg6zAbIk2N4MH MkCq0V0/I6gg1ou6wArrCxapgzFvb29Z3HNFTtfWTEJsHrhNQMe+zn/9J6QP+B/NwX5a yApCwipIUp7AAZLZlzB983UlzmgvKNrJqiHu2uaZ4tx479MUI3omTfyljESNJCUfdex6 6sxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:dkim-signature :from; bh=spjWCkZgovn8f7hT6CEa8lme4RAyN9AYxiFAG+qXGgg=; b=UUxV0uCACOiyYYBSw5yd1bauB+ugwrzeSBmcT52Rul4ZGb6V9vZ5xcInBpEgNqAMuz MAGk0mHazrpp/aIWUjxRKPRSyejSM9RmPiIIKzK4lnVvCsIMiZLBTifyN+RoUKiosHxV 0H2nOyuxpkP7c53f/YBhy8+3ZRNcgb1UkfyBhwLIXAdqGrVgo+SjjPSvAcNfUalaS7Zm 9YYX+cE6k87RklHBF5+2+AL5IhU4cBCHnfsAdUYfuhCUOQhqt67m6w7s8YbVT4Q8thTH +0j2weenLZfi6lbk+HvE+8DkPZYcFV096aHDEIGIjUcS0Mug63eGTOSEqamTQC0adAxt iRcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=g8M6e0S0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id me6-20020a17090b17c600b00247303bfcd6si1280658pjb.168.2023.04.19.00.55.38; Wed, 19 Apr 2023 00:55:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=g8M6e0S0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232673AbjDSHvK (ORCPT + 99 others); Wed, 19 Apr 2023 03:51:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232468AbjDSHuj (ORCPT ); Wed, 19 Apr 2023 03:50:39 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC828AF35; Wed, 19 Apr 2023 00:50:09 -0700 (PDT) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1681890606; bh=PhuKSVM+kLkzr4vVCFko648fBsxNsNBCoE+R9yckFfk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=g8M6e0S0q91u4AQ+9aU5tjzS+twC2zUotiDRCFi4HscFAA1cEXUHMYBWgfosZNu47 SK8r0RvA8AzhmKIkejOWNSxJD8nJI4zVVzfHpR5K9F9b4QOfPxytmKi2yYHLw1PQYW SS3SMB9h43XXOxEKIDqLzkaWON/J4KE5fDACtx7g= Date: Wed, 19 Apr 2023 09:50:02 +0200 Subject: [PATCH 2/4] block: constify struct part_type part_type MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230419-const-partition-v1-2-2d66f2d83873@weissschuh.net> References: <20230419-const-partition-v1-0-2d66f2d83873@weissschuh.net> In-Reply-To: <20230419-const-partition-v1-0-2d66f2d83873@weissschuh.net> To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681890605; l=1158; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=PhuKSVM+kLkzr4vVCFko648fBsxNsNBCoE+R9yckFfk=; b=bM12H6NWeGSf35qtpumgJNsGsDZvkNlMhGe1dE92A+yhS7RAAbo1knoQIpfAJJIF4KoDRplPq VoqD3UbC4PiAhaBbkpAfBbLtYk6cW6L0MLvdkNOgt97sLlfGDr26cD/ X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The struct is never modified so it can be const. Signed-off-by: Thomas Weißschuh --- block/partitions/core.c | 2 +- include/linux/blkdev.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 667f3dcebd59..812407ea38e9 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -264,7 +264,7 @@ static int part_uevent(const struct device *dev, struct kobj_uevent_env *env) return 0; } -struct device_type part_type = { +const struct device_type part_type = { .name = "partition", .groups = part_attr_groups, .release = part_release, diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 941304f17492..de783481ec71 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -41,7 +41,7 @@ struct blk_stat_callback; struct blk_crypto_profile; extern const struct device_type disk_type; -extern struct device_type part_type; +extern const struct device_type part_type; extern struct class block_class; /* Must be consistent with blk_mq_poll_stats_bkt() */ -- 2.40.0