From patchwork Wed Apr 19 07:50:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 85244 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp198943vqo; Wed, 19 Apr 2023 01:01:35 -0700 (PDT) X-Google-Smtp-Source: AKy350Y7Oxe5j1G6edB2S28XHS50jO2rFHV1SJHmPS62nD6GyrQoe0UO53eFk7yZkusnwDygY2o0 X-Received: by 2002:a05:6870:c1cf:b0:177:ab68:aa9a with SMTP id i15-20020a056870c1cf00b00177ab68aa9amr3031921oad.1.1681891294925; Wed, 19 Apr 2023 01:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681891294; cv=none; d=google.com; s=arc-20160816; b=TQ7DVM5FENq/pcxsCEr170shcRL0DbpD+ahGH6A5X3eA6vszG4oxB5hKvY3L2gmCtC jqjiyHN7K7guRCxSSmlKhHPw9BSogjMesij5YqeGW4cc2bT+40ZHcHurhta14MxKqCnR dNm80JDpnOJgb5TdZwS0ZpDs8kXah+32Fpi/tG03Zpo+ZOREjjGm+nPcswRgJ2AqiOKv z87tDP3c+99TOf+uvRmyZjPpixw7j1t80EJ0Nb7oq8pfsIe7CTT+Mg6CTojhLzYJF6DA e1sel2iVeY8s0FNbjc9JwEib1TIvFA65bN4/kD7t3NmK2agLdiIRWhEtuNNqB5X5QgTc NAaw== 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=aVc0DWJRFn7SfpDsP60uvX1ez+3koVzjxEn5Aj3R67E=; b=SjYLre0wzGBmUsKAy87uOeCb3Jc8yq5ZHOJ3etssaCqQAnkHTyUj4Kos39rRYS3sFs zpVeD1XQhvyPVeses3VpPh6Ydy4rmj/DAo1AuDgfH3O0PPyQJpH+Y0Dq/+/Z3WUqI4un RCdyRDGJSpwk/OQwswMXnsk2I44tIcM7WWH340FxWwuV/SUSSiG3a8YbsE6lG+5nL86f wqf4kQBeFjg2bvBai6PhNmeNbF4Okck0OJ/IYRL+0HXJMfzuehOR9JASFcfrcvW47U/p hi8l+GONbxsbGjaILAsmpN6Ui5JxwreXPMlMDFDL06Z1X8uFss85iFr9XgY4XZAlzlZH NvvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=l8DYAJVt; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i21-20020a056870891500b001765d22796asi14472994oao.165.2023.04.19.01.01.21; Wed, 19 Apr 2023 01:01:34 -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=l8DYAJVt; 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 S232471AbjDSHvC (ORCPT + 99 others); Wed, 19 Apr 2023 03:51:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232398AbjDSHuj (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 E1749C175; 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=kSlTxie2Ksev8vTGCDWHXnNc4gL+EGM1NG1+H1a+m6E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=l8DYAJVtorw7L4oqC+eL7xArCxF0pNZgDiJh5GTlfkWKPhqU3+9dyZEB5ePCv4+VD Rl0xSBuODwChxCxKuoWOWqxnzlPqZD5y44QD/iH97YYQOfZBaAQCVCMfpwcNpiAzna YgEb+VMGmvp69gQCYdFJMZt8IhD8ozmqO6boHrfw= Date: Wed, 19 Apr 2023 09:50:01 +0200 Subject: [PATCH 1/4] block: constify partition prober array MIME-Version: 1.0 Message-Id: <20230419-const-partition-v1-1-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?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681890605; l=698; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=kSlTxie2Ksev8vTGCDWHXnNc4gL+EGM1NG1+H1a+m6E=; b=DjdLzIs3C9Vi612gPssij7yXcJOt4k/kQJmuexW0wQ7fSreII52rD8l2eI00RFP7uk3Udg0Tq joRXaGTK8QDAKCsrAasX3qd78urpEuX/9fQCfnv/27kCSKmCm7m3uym 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763590846648371443?= X-GMAIL-MSGID: =?utf-8?q?1763590846648371443?= The array is never modified so it can be const. Signed-off-by: Thomas Weißschuh --- block/partitions/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 7b8ef6296abd..667f3dcebd59 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -12,7 +12,7 @@ #include #include "check.h" -static int (*check_part[])(struct parsed_partitions *) = { +static const int (*check_part[])(struct parsed_partitions *) = { /* * Probe partition formats with tables at disk address 0 * that also have an ADFS boot block at 0xdc0. From patchwork Wed Apr 19 07:50:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 85245 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp201610vqo; Wed, 19 Apr 2023 01:05:54 -0700 (PDT) X-Google-Smtp-Source: AKy350aVgnNk1mnOyXdmOAZBC6iuyLjyIEWnuasZANAvdqXuc/Uks7wXDByvvjA9dDj1PUSy7MK1 X-Received: by 2002:a05:6102:7d9:b0:42e:6ac2:b19b with SMTP id y25-20020a05610207d900b0042e6ac2b19bmr4546989vsg.0.1681891554523; Wed, 19 Apr 2023 01:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681891554; cv=none; d=google.com; s=arc-20160816; b=R1W7frQKZH//WwFA64kKNlE6585MUU07gaJv4MYdnq9XvllVfpbXXgJqGadY4r/Tob Rex0OR2krfR38MnaKBYB16JyofKHTHlX83B+h7fjl5Oem+Vli9z8CqDdszHgyRH2cyZs DBVYLJYmOXXYRePPYWq2meZnwoegUg50GFmV3Wna36lfTTxlbiW67II7RS3NKvPfuNyx KILHaQ+fnu1hD++6bK8wgEvxCjwjhQiBY4+FiIPsZaEyI/+Zc+kkRLe7NvXXoxdva+Mj dC2BU6OVKeVUZ7j1MBideaGrgtgUy9fRxdO50dFzD1RxbS3j35ZpE9dXksJAsTKk04nE WNMA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e22-20020a05610211f600b0042c8d5be087si1629117vsg.455.2023.04.19.01.05.40; Wed, 19 Apr 2023 01:05:54 -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 S232674AbjDSHvL (ORCPT + 99 others); Wed, 19 Apr 2023 03:51:11 -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 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?Tho?= =?utf-8?q?mas_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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763591118833540709?= X-GMAIL-MSGID: =?utf-8?q?1763591118833540709?= 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() */ From patchwork Wed Apr 19 07:50:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 85243 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp198288vqo; Wed, 19 Apr 2023 01:00:48 -0700 (PDT) X-Google-Smtp-Source: AKy350Ztp0PiXf9Ey5wuUWRneYcL4OQotyCLpDfJAw719Zxs+8ccqpnnz9aGqy2W5m8ANOrOVsqG X-Received: by 2002:a05:6870:3516:b0:184:2bd0:7300 with SMTP id k22-20020a056870351600b001842bd07300mr3075707oah.36.1681891248743; Wed, 19 Apr 2023 01:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681891248; cv=none; d=google.com; s=arc-20160816; b=xjiuYTsbFIIzFFSgWHLF4HdAGJBGEkPAnMx4ETNWtM2j9NkIBtUk1rJhfe//kkhJt5 PydGE45CFtr0LpEyjeWLsmZgrfhwNdO7wJpbuB/ZitoODheBhcSp7oHhb0zsCNkyyo1S C9wGN4LoCuuNtAexmEWJF7FyTN5lKxb99Op0f2MLPxfNuuhrGBaz6TIE4I8CnNI7JnP7 xJg43jokgY+6DNRqBnLX7RlmpoSIqExQa+tEGSRIcZVl2KTocI4Zfl9BcnzqisMJpv11 X/KQY6WhsPqhYBKct4T6g0wAWlMjBqZV45zOoWEz3hWWv+LEU3M0Z82UZBWW7yBMRpe8 HkcA== 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=aT4aHUxRkvngYHd8ykWh8GXz9FiRWTlfn8sLvdMRLz4=; b=aHSfizRwHGgrYLJbXifuqQ4CYfqvsmKEkhOZGufgfZHBCG3sVrPSnIyjQIqBFS3AbE sD9yg339M3s4S1LmpZ1rYHVaBcKL6YfPGExqQW3bz7GSaB1vO2720mGm21cW6E0Bl3rz RR0A+GP3bOBdTPk/d6kBrMdmMesaq542L8i7ssBEbKa21RQxWs0/LYYouhQZE0wMHt+H 17Tl53EDXmc/0ebd/l3N6CcM4DFDLC4x2UFm1VpOojnVxPU3pByvBcOpaukwOQ0Mtf9a xZ41cTtUpD6FQ57m56FpM/ZOddmgAkxKLr5NI3Jrdnf2ui7XouZg6FZsc3Bn5Ju75PVX rf+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=NyyuVOq0; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a056871058900b00184667e01a2si15058675oan.185.2023.04.19.01.00.34; Wed, 19 Apr 2023 01:00:48 -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=NyyuVOq0; 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 S232661AbjDSHvE (ORCPT + 99 others); Wed, 19 Apr 2023 03:51:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232480AbjDSHuj (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 13D6AC661; 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=+BWDSAdjFIxcN4cSYW2nKSzd7xdEBdtngZoCQpaUs9w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NyyuVOq0wU0MqJDnYPJa5VSqrfwPaWKLJpYHbP92zONHYlxLMpK1CBm2WXHkx5H7F Jlyp6HyboCrYmp238RVTZTIqD3mrPefNIEvw1GlIOlwGLC/DI5zLjyGG7uDBwG0FRU sUDOKZd0HT5Mh0QrwY5ynKcDxIVJMes1ZGlN6ZYU= Date: Wed, 19 Apr 2023 09:50:03 +0200 Subject: [PATCH 3/4] block: constify struct part_attr_group MIME-Version: 1.0 Message-Id: <20230419-const-partition-v1-3-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?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681890605; l=600; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=+BWDSAdjFIxcN4cSYW2nKSzd7xdEBdtngZoCQpaUs9w=; b=s7SU+6Q3vLf9/5zFRUxMbk2GkvuT/h+4uDo7UJ/0fT30OjxJdFEV0JZkGR8VXzZScEVeCnbi8 7Q2n3iAfQX4BuRsBtnY97fCWHLSAJOJmWKzAfFgWcd+YIqLuMvAV11y 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763590798463151316?= X-GMAIL-MSGID: =?utf-8?q?1763590798463151316?= The struct is never modified so it can be const. Signed-off-by: Thomas Weißschuh --- block/partitions/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 812407ea38e9..032e415618cb 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -236,7 +236,7 @@ static struct attribute *part_attrs[] = { NULL }; -static struct attribute_group part_attr_group = { +static const struct attribute_group part_attr_group = { .attrs = part_attrs, }; From patchwork Wed Apr 19 07:50:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 85242 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp195494vqo; Wed, 19 Apr 2023 00:55:49 -0700 (PDT) X-Google-Smtp-Source: AKy350ajQhapL5gc28uLc3VHHHur2ysZtXJnDqKq4hmiERN1WQnQB/AGYZvvjSI/9fWxRRTbWST9 X-Received: by 2002:a05:6870:829e:b0:187:9bd7:26c3 with SMTP id q30-20020a056870829e00b001879bd726c3mr2977671oae.23.1681890949475; 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=qTh+47AFJckickSapJC4SDJe6UHx9Z5/3gjJJwkxkL/s6N9YJOyXqT/64NHcotGRR1 VT/HAdnmmvFSml516Edlj4eVu2DUB2uhDvhgP7ZMohWi6+OFbvXyz8gOKh0WczsJ00WC Pv2oDRnOTspNyJ5seAG3RmWHWbBwkzcej42MjZ9rsroKGhHfX21vMYZc7HIAytDMf3FE Mdk72bg+UlYQ1sbQnRqeMolT04lMc/t+IiV9KgFZy1omOeq41x/JeQTMrrmWlndUXJdx j/vAl12NdLNXDCvrJtdJxkOjjgjaAL4s+Irgh8bCHTUDWpXcAs2W8Etn3iCQkUhmX8+5 TMzA== 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=vTKhu9GvzYVoAVfL/ML+ydf9kR3vouqSPKAjt6TUxrc=; b=0eBPxMJNtYv3kvn3YCZu39VX40tLwNZKm+FhevZl37yvJvDPJzcyweMRkWhGYEleUy vl+F5Mxu8rPW/HDNzdOSTSmIB1RFKNYPNRCz9eM+Q46Fbtf8e6pl6u0OOt95OhA+4zWa /O/t8SXhzYtQk1n169zZZilG+QGvMKWvjSKcLuYpvilf+ACPJIh6TuxTVzngSsgniEZi jirv28DXINNrWeS6KAqyGanPaRt9929375CZqOhN5o2D8dxm73dP5IjMEjerHM25OVJY JHXtYYcPhYzYI6KshyS+cQldp/7Uzu2jPQ9WemvMpAwo5Ukaz9dNNH19kuGaxUV4ZBVG FpJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=nn0r6mzA; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m5-20020a056870888500b0017e47db105dsi14093181oam.4.2023.04.19.00.55.36; 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=nn0r6mzA; 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 S232645AbjDSHu4 (ORCPT + 99 others); Wed, 19 Apr 2023 03:50:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232473AbjDSHuh (ORCPT ); Wed, 19 Apr 2023 03:50:37 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39793CC3C; 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=30iMUBbhKpHPLuoBNwmZAzJbN0IHFShaDIG5piBY4Cs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nn0r6mzAaqoEhS1It3ZDwNC6g7FSCjF4ccKeZ3RmCUEo51z5AaiFxTsC+u9XTYjp7 0XW3dazWJD4KDekWdHlKj1UkaeiTmqYe0SA44fMRABXngrzHnz6RJjo8IvYEmuTs4Q n0bYXh4cRg9bDizZT4iLDEdraieeNgmc9pLZigeg= Date: Wed, 19 Apr 2023 09:50:04 +0200 Subject: [PATCH 4/4] block: constify the whole_disk device_attribute MIME-Version: 1.0 Message-Id: <20230419-const-partition-v1-4-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?Tho?= =?utf-8?q?mas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1681890605; l=692; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=30iMUBbhKpHPLuoBNwmZAzJbN0IHFShaDIG5piBY4Cs=; b=hJFtQ8W2Kh0rQjAo0WwaHkKqDSvau9GymVQLfCCajbra4SOHaHwn2zHmFK3Jbzdf4zc+XQ4QO c/wCqiTrp1XA3gwuAv8Urx33x+/WMk/DYURZKsmlLmU8ePigUJp/oQq 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763590484388011800?= X-GMAIL-MSGID: =?utf-8?q?1763590484388011800?= The struct is never modified so it can be const. Signed-off-by: Thomas Weißschuh --- block/partitions/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/partitions/core.c b/block/partitions/core.c index 032e415618cb..8efadc694e41 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -296,7 +296,7 @@ static ssize_t whole_disk_show(struct device *dev, { return 0; } -static DEVICE_ATTR(whole_disk, 0444, whole_disk_show, NULL); +static const DEVICE_ATTR(whole_disk, 0444, whole_disk_show, NULL); /* * Must be called either with open_mutex held, before a disk can be opened or