Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp448571rwe; Wed, 19 Apr 2023 00:55:11 -0700 (PDT) X-Google-Smtp-Source: AKy350aVTJenBp2KTD4KbQegJX2+0uPJbjoZ88CjV4TiiDYLNE6tfdGnqs6QrqxrZbNij8AsrJZo X-Received: by 2002:a05:6870:d5a6:b0:184:4117:4bc6 with SMTP id u38-20020a056870d5a600b0018441174bc6mr3053086oao.30.1681890911091; Wed, 19 Apr 2023 00:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681890911; cv=none; d=google.com; s=arc-20160816; b=Vca1e8sfVNnaPH9PnCYYO5toYrOIn3mbq2naopx+X9Y9dXBu1XxBaX/SDo/IIGGu+x 8GiCpT2cpQPR3I17lXyXWI/Q4VNx1hZLLOZiz/yE+s+yvNTjkDBQ9bIciRws+b1RvYnm HvDdF7AlAP/O4kaFpP2m+GGWlXgT7+ULj7o9zOQCaPNU6ZUViUezVZmVTMbWkQbivpPb 6OjNBCXguN2yzoT+Ts6iIXj03NvXMP/o9Jt5InHodawbQ7JUBH/IyO7HnRkLPu+fnMNZ uRr0IxWSs4IZs5v866yqPULmfs1O78EmgVMuVL2alkkoA9lVbLXftZQuKYG1z+jU30rg SArA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kv41-20020a056870fba900b001879f69a472si54177oab.331.2023.04.19.00.54.59; Wed, 19 Apr 2023 00:55:11 -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 S232172AbjDSHu4 (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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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?Thomas_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 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 -- 2.40.0