mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: dhowells@redhat.com, linux-kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Blaise Boscaccy <bboscaccy@linux.microsoft.com>
Subject: Re: [PATCH] oid_registry: allow arbitrary size OIDs
Date: Tue, 25 Nov 2025 20:33:57 +0000	[thread overview]
Message-ID: <3954380.1764102837@warthog.procyon.org.uk> (raw)
In-Reply-To: <833c858cd74533203b43180208734b84f1137af0.camel@HansenPartnership.com>

James Bottomley <James.Bottomley@HansenPartnership.com> wrote:

> This isn't usually a problem
> except that it prevents us from representing the 2.25. prefix OIDs
> which are the OID representation of UUIDs and have a 128 bit number
> following the prefix.

Ewww.

> Rather than import not often used perl arithmetic modules,

Do they not work?  Or are they just not commonly installed?

> +	# Base128 encode the number
> +	my $j;
> +	my $b;
> +	for ($j = 0; $j < $tmp; $j++) {

I would do:

	for (my $j = 0; $j < $tmp; $j++) {

> +	    $b = oct("0b".substr($c, $j * 7, 7));

I would probably do "my $b = ..." here.

> +
> +	    push @octets, $b | 0x80;
>  	}
> -	push @octets, $c & 0x7f;
> +	$b = oct("0b".substr($c, $j * 7, 7));
> +	push @octets, $b;

and just combine these two lines:

	push @octets, oct("0b".substr($c, $j * 7, 7));

Using "oct("0b"...)" looks weird, but I guess it should work.

David


  parent reply	other threads:[~2025-11-25 20:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25 18:19 James Bottomley
2025-11-25 18:33 ` Andrew Morton
2025-11-25 20:33 ` David Howells [this message]
2025-11-25 22:12   ` James Bottomley
2025-11-25 20:35 ` David Howells
2025-11-25 22:03   ` James Bottomley
2025-11-26 19:22 ` [PATCH v2 1/1] " James Bottomley

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=3954380.1764102837@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=bboscaccy@linux.microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®