From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77F6CC3DA79 for ; Mon, 26 Dec 2022 15:08:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231904AbiLZPH7 (ORCPT ); Mon, 26 Dec 2022 10:07:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiLZPHy (ORCPT ); Mon, 26 Dec 2022 10:07:54 -0500 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAA61C04; Mon, 26 Dec 2022 07:07:53 -0800 (PST) Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 6A75B1B7; Mon, 26 Dec 2022 15:04:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1672067062; bh=b1y7zXkinhxvot9jeetf8cDO0mX7qUONskkFtfjYn9M=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=bmGO0e+PcHHy/MZcIUThzTX+m8GtUlc4/5m6aSlVDWGSgWPweaVF1Nf2kxvc9HdGn 8L8gJ7zy5uTPEoBUSOIbtKjlnVoQNCRY853bV8eXAr514L5uy2tI0i0DW1fs8OhrH9 lhHPrvbT7E1CCUPVCB7VBIddsjqLg12jTDfoPFUc= Received: from [192.168.211.153] (192.168.211.153) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 26 Dec 2022 18:07:51 +0300 Message-ID: <9e11da02-80f1-55f3-8bb5-28c3508e5396@paragon-software.com> Date: Mon, 26 Dec 2022 19:07:50 +0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] fs/ntfs3: fix wrong cast in xattr.c Content-Language: en-US To: Daniel Pinto , kernel test robot CC: , , Linux Kernel Mailing List , , Linux Memory Management List References: From: Konstantin Komarov In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.211.153] X-ClientProxiedBy: vobn-exch-01.paragon-software.com (172.30.72.13) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15.11.2022 12:17, Daniel Pinto wrote: > cpu_to_be32 and be32_to_cpu respectively return and receive > __be32, change the cast to the correct types. > > Fixes the following sparse warnings: > fs/ntfs3/xattr.c:811:48: sparse: sparse: incorrect type in > assignment (different base types) > fs/ntfs3/xattr.c:901:34: sparse: sparse: cast to restricted __be32 > > Reported-by: kernel test robot > Signed-off-by: Daniel Pinto > --- > fs/ntfs3/xattr.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c > index 8620a7b4b3e6..6056ecbe8e4f 100644 > --- a/fs/ntfs3/xattr.c > +++ b/fs/ntfs3/xattr.c > @@ -808,7 +808,7 @@ static int ntfs_getxattr(const struct xattr_handler *handler, struct dentry *de, > err = sizeof(u32); > *(u32 *)buffer = le32_to_cpu(ni->std_fa); > if (!strcmp(name, SYSTEM_NTFS_ATTRIB_BE)) > - *(u32 *)buffer = cpu_to_be32(*(u32 *)buffer); > + *(__be32 *)buffer = cpu_to_be32(*(u32 *)buffer); > } > goto out; > } > @@ -898,7 +898,7 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler, > if (size != sizeof(u32)) > goto out; > if (!strcmp(name, SYSTEM_NTFS_ATTRIB_BE)) > - new_fa = cpu_to_le32(be32_to_cpu(*(u32 *)value)); > + new_fa = cpu_to_le32(be32_to_cpu(*(__be32 *)value)); > else > new_fa = cpu_to_le32(*(u32 *)value); Thank you for your work, applied!