All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: "Thomas Weißschuh" <linux@weissschuh.net>,
	"Jens Axboe" <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] blk-crypto: make blk_crypto_attr instances const
Date: Tue, 17 Mar 2026 16:30:31 +0000	[thread overview]
Message-ID: <2d4116da-eeef-49f6-bd75-5ea424a36da2@oracle.com> (raw)
In-Reply-To: <20260316-b4-sysfs-const-attr-block-v1-3-a35d73b986b0@weissschuh.net>

On 16/03/2026 22:43, Thomas Weißschuh wrote:
> The blk_crypto_attrs structures are never modified, mark them as const.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

With reservations, below:
Reviewed-by: John Garry <john.g.garry@oracle.com>>
>   static struct blk_crypto_profile *kobj_to_crypto_profile(struct kobject *kobj)
> @@ -26,39 +26,39 @@ static struct blk_crypto_profile *kobj_to_crypto_profile(struct kobject *kobj)
>   	return container_of(kobj, struct blk_crypto_kobj, kobj)->profile;
>   }
>   
> -static struct blk_crypto_attr *attr_to_crypto_attr(struct attribute *attr)
> +static const struct blk_crypto_attr *attr_to_crypto_attr(const struct attribute *attr)

 > 80 again, FWIW

And this code is becoming very "wordy" now. Maybe someone would think 
that the following is better:

#define attr_to_crypto_attr(attr) \
	container_of_const(attr, struct blk_crypto_attr, attr)

>   {
> -	return container_of(attr, struct blk_crypto_attr, attr);
> +	return container_of_const(attr, struct blk_crypto_attr, attr);
>   }

  reply	other threads:[~2026-03-17 16:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 22:43 [PATCH 0/4] block: make some sysfs attribute instances const Thomas Weißschuh
2026-03-16 22:43 ` [PATCH 1/4] block: make queue_sysfs_entry " Thomas Weißschuh
2026-03-17 16:18   ` John Garry
2026-03-16 22:43 ` [PATCH 2/4] block: ia-ranges: make blk_ia_range_sysfs_entry " Thomas Weißschuh
2026-03-17 16:19   ` John Garry
2026-03-16 22:43 ` [PATCH 3/4] blk-crypto: make blk_crypto_attr " Thomas Weißschuh
2026-03-17 16:30   ` John Garry [this message]
2026-03-16 22:43 ` [PATCH 4/4] blk-mq: make blk_mq_hw_ctx_sysfs_entry " Thomas Weißschuh
2026-03-17 16:31   ` John Garry
2026-03-18  1:32 ` [PATCH 0/4] block: make some sysfs attribute " Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d4116da-eeef-49f6-bd75-5ea424a36da2@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.