All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qinglang Miao <miaoqinglang@huawei.com>
To: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH -next] hpfs: convert to use le32_add_cpu()
Date: Sat, 25 Jul 2020 16:56:13 +0800	[thread overview]
Message-ID: <20200725085613.98222-1-miaoqinglang@huawei.com> (raw)

Convert cpu_to_le16(le16_to_cpu(E1) + E2) to use le16_add_cpu().

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 fs/hpfs/dnode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/hpfs/dnode.c b/fs/hpfs/dnode.c
index 4ada525c5..76f539601 100644
--- a/fs/hpfs/dnode.c
+++ b/fs/hpfs/dnode.c
@@ -208,7 +208,7 @@ static void hpfs_delete_de(struct super_block *s, struct dnode *d,
 		hpfs_error(s, "attempt to delete last dirent in dnode %08x", le32_to_cpu(d->self));
 		return;
 	}
-	d->first_free = cpu_to_le32(le32_to_cpu(d->first_free) - le16_to_cpu(de->length));
+	le32_add_cpu(&d->first_free, -le16_to_cpu(de->length));
 	memmove(de, de_next_de(de), le32_to_cpu(d->first_free) + (char *)d - (char *)de);
 }
 
-- 
2.25.1


                 reply	other threads:[~2020-07-25  8:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200725085613.98222-1-miaoqinglang@huawei.com \
    --to=miaoqinglang@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    /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.