public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Michael Schmitz <schmitzmic@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-block@vger.kernel.org, axboe@kernel.dk,
	linux-m68k@vger.kernel.org, martin@lichtvoll.de,
	fthain@linux-m68k.org, stable@vger.kernel.org
Subject: Re: [PATCH v10 2/3] block: change annotation of rdb_CylBlocks in affs_hardblocks.h
Date: Fri, 16 Jun 2023 09:25:55 +0200	[thread overview]
Message-ID: <20230616072554.GA30156@lst.de> (raw)
In-Reply-To: <80ffb46c-b560-7c4e-0200-f9a91350c000@gmail.com>

On Fri, Jun 16, 2023 at 07:20:52PM +1200, Michael Schmitz wrote:
> Am 16.06.2023 um 17:48 schrieb Christoph Hellwig:
>> On Fri, Jun 16, 2023 at 07:53:11AM +1200, Michael Schmitz wrote:
>>> Thanks - now there's two __s32 fields in that header - one checksum each
>>> for RDB and PB. No one has so far seen the need for a 'signed big endian 32
>>> bit' type, and I'd rather avoid adding one to types.h. I'll leave those as
>>> they are (with the tacit understanding that they are equally meant to be
>>> big endian).
>>
>> We have those in a few other pleases and store them as __be32 as well.  The
>> (implicit) cast to s32 will make them signed again.
>
> Where's that cast to s32 hidden? I've only seen
>
> #define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
>
> which would make the checksums unsigned if __be32 was used.
>
> Whether the checksum code uses signed or unsigned math would require 
> inspection of the Amiga partitioning tool source which I don't have, so 
> I've kept __s32 to be safe.

Well, the return value of be32_to_cpu is going to be a assigned to a,
presumably signed, variable.  With that you get an implicit cast.

  reply	other threads:[~2023-06-16  7:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230615030837.8518-1-schmitzmic@gmail.com>
2023-06-15  3:08 ` [PATCH v10 1/3] block: fix signed int overflow in Amiga partition support Michael Schmitz
2023-06-15  3:08 ` [PATCH v10 2/3] block: change annotation of rdb_CylBlocks in affs_hardblocks.h Michael Schmitz
2023-06-15  4:17   ` Christoph Hellwig
2023-06-15  4:50     ` Michael Schmitz
2023-06-15  5:53       ` Christoph Hellwig
2023-06-15  7:09         ` Michael Schmitz
2023-06-15  7:21         ` Geert Uytterhoeven
2023-06-15 19:53           ` Michael Schmitz
2023-06-16  5:48             ` Christoph Hellwig
2023-06-16  7:20               ` Michael Schmitz
2023-06-16  7:25                 ` Christoph Hellwig [this message]
2023-06-16  7:51                   ` Michael Schmitz
2023-06-16  7:28                 ` Geert Uytterhoeven
2023-06-16  7:45                   ` Michael Schmitz
2023-06-15  3:08 ` [PATCH v10 3/3] block: add overflow checks for Amiga partition support Michael Schmitz

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=20230616072554.GA30156@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=fthain@linux-m68k.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=martin@lichtvoll.de \
    --cc=schmitzmic@gmail.com \
    --cc=stable@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