All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arnd Bergmann" <arnd@kernel.org>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH 2/2] mmc: convert sg_miter user to SG_MITER_LOCAL
Date: Wed, 02 Dec 2026 15:30:03 +0000	[thread overview]
Message-ID: <sashiko-outbox-246105@kernel.org> (raw)
In-Reply-To: <20261202152437.664948-2-arnd@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] mmc: mxcmmc: operator precedence bug in
  mxcmci_transfer_data() flags
--

commit a258d24bc3cd5f55b4dfadc025c7f77a315cd363
Author: Arnd Bergmann <arnd@arndb.de>

mmc: convert sg_miter user to SG_MITER_LOCAL

This commit converts several MMC host drivers to pass SG_MITER_LOCAL to
sg_miter_start() so they use kmap_local_page() instead of kmap().

> diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
> index 16d3b91fd4725..4487e3a8e9ccc 100644
> --- a/drivers/mmc/host/mxcmmc.c
> +++ b/drivers/mmc/host/mxcmmc.c
[ ... ]
> @@ -597,7 +597,7 @@ static int mxcmci_transfer_data(struct mxcmci_host *host)
>  
>  	host->data = data;
>  	host->datasize = 0;
> -	sg_miter_start(&sgm, data->sg, data->sg_len,
> +	sg_miter_start(&sgm, data->sg, data->sg_len, SG_MITER_LOCAL |
>  		       (data->flags & MMC_DATA_READ) ? SG_MITER_TO_SG : SG_MITER_FROM_SG);
>  
>  	if (data->flags & MMC_DATA_READ) {

[Severity: Medium]
Does the flags expression here need parentheses around the ternary
operator?  Because '|' has higher precedence than '?:', the condition is
evaluated as (SG_MITER_LOCAL | (data->flags & MMC_DATA_READ)), which is
always true and passes only SG_MITER_TO_SG to sg_miter_start() (dropping
SG_MITER_LOCAL and using SG_MITER_TO_SG even on PIO writes).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202152437.664948-1-arnd@kernel.org?part=2

  reply	other threads:[~2026-12-02 15:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 15:23 [PATCH 1/2] mmc: sh_mmcif: fix error handling Arnd Bergmann
2026-12-02 15:23 ` [PATCH 2/2] mmc: convert sg_miter user to SG_MITER_LOCAL Arnd Bergmann
2026-12-02 15:30   ` sashiko-bot [this message]
2026-12-02 15:46     ` Arnd Bergmann

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=sashiko-outbox-246105@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=arnd@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.