Message ID | 20240130040632.3039911-1-dawei.li@shingroup.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-43925-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp988454dyb; Mon, 29 Jan 2024 20:08:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPFItZQ+0SM2ILxkk+iQFP88tcVtOs1ufBqVg+QhLaiqiV1nx7Cfro50AOWP10YIwrXfro X-Received: by 2002:a17:906:b350:b0:a36:af:3937 with SMTP id cd16-20020a170906b35000b00a3600af3937mr1338281ejb.18.1706587700330; Mon, 29 Jan 2024 20:08:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706587700; cv=pass; d=google.com; s=arc-20160816; b=sQeElFBrNy1TwRoCpaj9z0TcpqPlOwxKXsxVqw4OQ2YZPizjyM7GFCAqvlV3HEjA6x SppgBOt2PdzL8tJ2bmivQW5eo0sxAc36RWNZ6R2pwhZMxFJ3lf8rGisMeAoLyT1/hiCd CigPpK0r2srR7WbMWGROvnu1YCM0PmPJHV5qDb1C4oO2jZIjnwCEf5DfKj2LdlLbsSSS tZctgYyHHeJGdu5iKcF29U5koAamCza6pkRX37Hglglof1znOecar2Kvcf/8vBKW3xt3 m5So19U3xqrtwEdmoK3Yrfh7eQUJXAIAEzQPnz1OTP26t53DcVLcKeMO1jjW/ACzCfWK ED9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=QjwEs5E41CPnhStdPSd8yFAQ2SQkPDpFBVeUkTPGgBg=; fh=2VhL6TlbvylJ6OcM6NHgTIhJhmS4XsrJPCS2L2l69NQ=; b=mj4rXncverLJXaNw3KRst4eSDrFYYmE2yoE/qsG+yTlgoGKT/L3IRMHoasBsy3nwOO RyaLaeFz45cXh/xfNXN0oc5s00UgR/eMq5WqmC/sspbb1/75uX140kvihj1c5PY6jNz/ Yw4uUD2+g2Ma8+BUNqkilDPvvWodI7/cVO4EKHV5aIHNiyb9bUtPGFIMv42h6YBqazkw qNX+30CoyUOLDSoqI+GqIJvWQ72kCxOhneSsMOBeF4//IjLpW3LsGvwKol5+I/9i9sTg 7iJVaMoD/kXArIRcgBXAioUw5erPXAke0jf1ToNv2iYqckzOVKIaP5K/j7IXOMREJRKk tHRw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-43925-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43925-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dx11-20020a170906a84b00b00a35ef7f6a72si904609ejb.88.2024.01.29.20.08.20 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 20:08:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43925-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-43925-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43925-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BACCA1F22FC1 for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 04:08:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6E99381A4; Tue, 30 Jan 2024 04:08:01 +0000 (UTC) Received: from smtpbguseast3.qq.com (smtpbguseast3.qq.com [54.243.244.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C47743717A; Tue, 30 Jan 2024 04:07:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=54.243.244.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706587680; cv=none; b=WZv4wMxwfOxngEaqPBl2R0dUKx6J6OLrVPPSd2jnNrn8KmQ3lxw5HyqJropDN272A83D97ERlfsapVPyQvBv1Im0mvCyISGRbk/HHl9K9gOL5gQPyrWCiZZZUChIWsTjtXyNx6CrXxm1WIdoeWV6Jc9CPyk+4LA9+LELNt0iiPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706587680; c=relaxed/simple; bh=CM4VCRvGWmtjbdVWi7q4j8vHwcmiajkzIgD6FOZDigQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=cn6ZvS2rfxlRt2gNEbmZdQmUH4x7vQWVNVd+pWzR211cwePUDmTGUP7jC3qZgOdSEQh9F/4DRLxnmOEW5fJph8bxuey3yxAAYDhBIbWmh4eNBn4aRNF2PhNJZRHgyAOTuNeVFZ6eLiFV9wQ3iS3ukrX8nWBOGJ1ArLBYmwWiBxk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn; spf=pass smtp.mailfrom=shingroup.cn; arc=none smtp.client-ip=54.243.244.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shingroup.cn X-QQ-mid: bizesmtp78t1706587638t88qbwk5 X-QQ-Originating-IP: ADAzaR73+8nlbAs12iepXPR/+VXxF63AXCcgAOBaFro= Received: from localhost ( [183.209.108.228]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 30 Jan 2024 12:07:17 +0800 (CST) X-QQ-SSF: 01400000000000504000000A0000000 X-QQ-FEAT: 3M0okmaRx3g7Rq5OtnCnvH/JhbQHXY5LVGoXVba5MFSQasgdHc6ppT/sHZe3W qDJ0+EZs7i5Vs4EK2xdJXmWm3HswDE6loIb4qKi1pwljs04WnggjCSEhN/33W2caZ5mPiEv fgSQsXUvwaZFr7lSCOsrzg1SyUn4U2SLvLvcQCK5dZycCCi6/ICTNh1mbW9uVoKrZVd09uW 6j5YlgqgU66Gl5xSsQ3/8RJG9VkDuO9AzbSQZWp228qdxMfv725OPYK0rxBPHk4D9JX3xwz oLV7nRTdKC7qUAAD1lg1OwfW3lun6Eb2twREVR1Hd5d4KVLB4hwyKlDI3gnsu1wX+xvPl1m 7poa4TOZUepHqg9kkW5ARv2JVl1IEmfC0j1SZkC5OqXCDdqSEI/UstkCTv6nKscHBWMO3Je lEtw6dzEY0Gm1tTogd+Sdg== X-QQ-GoodBg: 2 X-BIZMAIL-ID: 18208672462172721914 From: Dawei Li <dawei.li@shingroup.cn> To: arnd@arndb.de, gregkh@linuxfoundation.org Cc: fancer.lancer@gmail.com, lkp@intel.com, linux-kernel@vger.kernel.org, set_pte_at@outlook.com, Dawei Li <dawei.li@shingroup.cn>, stable@vger.kernel.org Subject: [PATCH] misc: eeprom/idt_89hpesx: Convert data structures to LE explicitly Date: Tue, 30 Jan 2024 12:06:32 +0800 Message-Id: <20240130040632.3039911-1-dawei.li@shingroup.cn> X-Mailer: git-send-email 2.27.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:shingroup.cn:qybglogicsvrgz:qybglogicsvrgz5a-1 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789486904512811055 X-GMAIL-MSGID: 1789486904512811055 |
Series |
misc: eeprom/idt_89hpesx: Convert data structures to LE explicitly
|
|
Commit Message
Dawei Li
Jan. 30, 2024, 4:06 a.m. UTC
For data structures needs cpu_to_le* conversion, its prototype needs to
be declared with __le* explicitly.
Fixes: cfad6425382e ("eeprom: Add IDT 89HPESx EEPROM/CSR driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401261250.b07Yt30Z-lkp@intel.com/
Signed-off-by: Dawei Li <dawei.li@shingroup.cn>
Cc: <stable@vger.kernel.org>
---
drivers/misc/eeprom/idt_89hpesx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On Tue, Jan 30, 2024 at 12:06:32PM +0800, Dawei Li wrote: > For data structures needs cpu_to_le* conversion, its prototype needs to > be declared with __le* explicitly. > > Fixes: cfad6425382e ("eeprom: Add IDT 89HPESx EEPROM/CSR driver") > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202401261250.b07Yt30Z-lkp@intel.com/ > Signed-off-by: Dawei Li <dawei.li@shingroup.cn> > Cc: <stable@vger.kernel.org> Awesome! Thanks for the patch. Definitely Reviewed-by: Serge Semin <fancer.lancer@gmail.com> -Serge(y) > --- > drivers/misc/eeprom/idt_89hpesx.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/misc/eeprom/idt_89hpesx.c b/drivers/misc/eeprom/idt_89hpesx.c > index d807d08e2614..327afb866b21 100644 > --- a/drivers/misc/eeprom/idt_89hpesx.c > +++ b/drivers/misc/eeprom/idt_89hpesx.c > @@ -129,7 +129,7 @@ struct idt_smb_seq { > struct idt_eeprom_seq { > u8 cmd; > u8 eeaddr; > - u16 memaddr; > + __le16 memaddr; > u8 data; > } __packed; > > @@ -141,8 +141,8 @@ struct idt_eeprom_seq { > */ > struct idt_csr_seq { > u8 cmd; > - u16 csraddr; > - u32 data; > + __le16 csraddr; > + __le32 data; > } __packed; > > /* > -- > 2.27.0 >
On Tue, Jan 30, 2024 at 12:06:32PM +0800, Dawei Li wrote: > For data structures needs cpu_to_le* conversion, its prototype needs to > be declared with __le* explicitly. > > Fixes: cfad6425382e ("eeprom: Add IDT 89HPESx EEPROM/CSR driver") > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202401261250.b07Yt30Z-lkp@intel.com/ > Signed-off-by: Dawei Li <dawei.li@shingroup.cn> > Cc: <stable@vger.kernel.org> > --- > drivers/misc/eeprom/idt_89hpesx.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/misc/eeprom/idt_89hpesx.c b/drivers/misc/eeprom/idt_89hpesx.c > index d807d08e2614..327afb866b21 100644 > --- a/drivers/misc/eeprom/idt_89hpesx.c > +++ b/drivers/misc/eeprom/idt_89hpesx.c > @@ -129,7 +129,7 @@ struct idt_smb_seq { > struct idt_eeprom_seq { > u8 cmd; > u8 eeaddr; > - u16 memaddr; > + __le16 memaddr; > u8 data; > } __packed; > > @@ -141,8 +141,8 @@ struct idt_eeprom_seq { > */ > struct idt_csr_seq { > u8 cmd; > - u16 csraddr; > - u32 data; > + __le16 csraddr; > + __le32 data; > } __packed; > > /* Declaring them this way is nice, but this doesn't actually "fix" anything at all as no code is actually changed. So how is ths a bugfix? How does this patch do anything? confused, greg k-h
Hi Greg, Thanks for reviewing. On Tue, Jan 30, 2024 at 06:04:17AM -0800, Greg KH wrote: > On Tue, Jan 30, 2024 at 12:06:32PM +0800, Dawei Li wrote: > > For data structures needs cpu_to_le* conversion, its prototype needs to > > be declared with __le* explicitly. > > > > Fixes: cfad6425382e ("eeprom: Add IDT 89HPESx EEPROM/CSR driver") > > Reported-by: kernel test robot <lkp@intel.com> > > Closes: https://lore.kernel.org/oe-kbuild-all/202401261250.b07Yt30Z-lkp@intel.com/ > > Signed-off-by: Dawei Li <dawei.li@shingroup.cn> > > Cc: <stable@vger.kernel.org> > > --- > > drivers/misc/eeprom/idt_89hpesx.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/misc/eeprom/idt_89hpesx.c b/drivers/misc/eeprom/idt_89hpesx.c > > index d807d08e2614..327afb866b21 100644 > > --- a/drivers/misc/eeprom/idt_89hpesx.c > > +++ b/drivers/misc/eeprom/idt_89hpesx.c > > @@ -129,7 +129,7 @@ struct idt_smb_seq { > > struct idt_eeprom_seq { > > u8 cmd; > > u8 eeaddr; > > - u16 memaddr; > > + __le16 memaddr; > > u8 data; > > } __packed; > > > > @@ -141,8 +141,8 @@ struct idt_eeprom_seq { > > */ > > struct idt_csr_seq { > > u8 cmd; > > - u16 csraddr; > > - u32 data; > > + __le16 csraddr; > > + __le32 data; > > } __packed; > > > > /* > > Declaring them this way is nice, but this doesn't actually "fix" > anything at all as no code is actually changed. > > So how is ths a bugfix? How does this patch do anything? > > confused, Sorry for the confuson. This commit is to address the issue reported by kernel test rebot[1]. Partially quoted from it: sparse warnings: (new ones prefixed by >>) >> drivers/misc/eeprom/idt_89hpesx.c:599:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] memaddr @@ got restricted __le16 [usertype] @@ drivers/misc/eeprom/idt_89hpesx.c:599:31: sparse: expected unsigned short [addressable] [assigned] [usertype] memaddr drivers/misc/eeprom/idt_89hpesx.c:599:31: sparse: got restricted __le16 [usertype] drivers/misc/eeprom/idt_89hpesx.c:671:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] memaddr @@ got restricted __le16 [usertype] @@ drivers/misc/eeprom/idt_89hpesx.c:671:31: sparse: expected unsigned short [addressable] [assigned] [usertype] memaddr drivers/misc/eeprom/idt_89hpesx.c:671:31: sparse: got restricted __le16 [usertype] >> drivers/misc/eeprom/idt_89hpesx.c:769:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] csraddr @@ got restricted __le16 [usertype] @@ drivers/misc/eeprom/idt_89hpesx.c:769:24: sparse: expected unsigned short [addressable] [assigned] [usertype] csraddr drivers/misc/eeprom/idt_89hpesx.c:769:24: sparse: got restricted __le16 [usertype] >> drivers/misc/eeprom/idt_89hpesx.c:770:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [addressable] [assigned] [usertype] data @@ got restricted __le32 [usertype] @@ drivers/misc/eeprom/idt_89hpesx.c:770:21: sparse: expected unsigned int [addressable] [assigned] [usertype] data drivers/misc/eeprom/idt_89hpesx.c:770:21: sparse: got restricted __le32 [usertype] drivers/misc/eeprom/idt_89hpesx.c:834:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] csraddr @@ got restricted __le16 [usertype] @@ drivers/misc/eeprom/idt_89hpesx.c:834:24: sparse: expected unsigned short [addressable] [assigned] [usertype] csraddr drivers/misc/eeprom/idt_89hpesx.c:834:24: sparse: got restricted __le16 [usertype] >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 [1] https://lore.kernel.org/oe-kbuild-all/202401261250.b07Yt30Z-lkp@intel.com/ Thanks, Dawei > > greg k-h >
On Wed, Jan 31, 2024 at 09:34:52AM +0800, Dawei Li wrote: > Hi Greg, > > Thanks for reviewing. > > On Tue, Jan 30, 2024 at 06:04:17AM -0800, Greg KH wrote: > > On Tue, Jan 30, 2024 at 12:06:32PM +0800, Dawei Li wrote: > > > For data structures needs cpu_to_le* conversion, its prototype needs to > > > be declared with __le* explicitly. > > > > > > Fixes: cfad6425382e ("eeprom: Add IDT 89HPESx EEPROM/CSR driver") > > > Reported-by: kernel test robot <lkp@intel.com> > > > Closes: https://lore.kernel.org/oe-kbuild-all/202401261250.b07Yt30Z-lkp@intel.com/ > > > Signed-off-by: Dawei Li <dawei.li@shingroup.cn> > > > Cc: <stable@vger.kernel.org> > > > --- > > > drivers/misc/eeprom/idt_89hpesx.c | 6 +++--- > > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/misc/eeprom/idt_89hpesx.c b/drivers/misc/eeprom/idt_89hpesx.c > > > index d807d08e2614..327afb866b21 100644 > > > --- a/drivers/misc/eeprom/idt_89hpesx.c > > > +++ b/drivers/misc/eeprom/idt_89hpesx.c > > > @@ -129,7 +129,7 @@ struct idt_smb_seq { > > > struct idt_eeprom_seq { > > > u8 cmd; > > > u8 eeaddr; > > > - u16 memaddr; > > > + __le16 memaddr; > > > u8 data; > > > } __packed; > > > > > > @@ -141,8 +141,8 @@ struct idt_eeprom_seq { > > > */ > > > struct idt_csr_seq { > > > u8 cmd; > > > - u16 csraddr; > > > - u32 data; > > > + __le16 csraddr; > > > + __le32 data; > > > } __packed; > > > > > > /* > > > > Declaring them this way is nice, but this doesn't actually "fix" > > anything at all as no code is actually changed. > > > > So how is ths a bugfix? How does this patch do anything? > > > > confused, > > Sorry for the confuson. > > This commit is to address the issue reported by kernel test rebot[1]. > > Partially quoted from it: > > sparse warnings: (new ones prefixed by >>) > >> drivers/misc/eeprom/idt_89hpesx.c:599:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] memaddr @@ got restricted __le16 [usertype] @@ > drivers/misc/eeprom/idt_89hpesx.c:599:31: sparse: expected unsigned short [addressable] [assigned] [usertype] memaddr > drivers/misc/eeprom/idt_89hpesx.c:599:31: sparse: got restricted __le16 [usertype] > drivers/misc/eeprom/idt_89hpesx.c:671:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] memaddr @@ got restricted __le16 [usertype] @@ > drivers/misc/eeprom/idt_89hpesx.c:671:31: sparse: expected unsigned short [addressable] [assigned] [usertype] memaddr > drivers/misc/eeprom/idt_89hpesx.c:671:31: sparse: got restricted __le16 [usertype] > >> drivers/misc/eeprom/idt_89hpesx.c:769:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] csraddr @@ got restricted __le16 [usertype] @@ > drivers/misc/eeprom/idt_89hpesx.c:769:24: sparse: expected unsigned short [addressable] [assigned] [usertype] csraddr > drivers/misc/eeprom/idt_89hpesx.c:769:24: sparse: got restricted __le16 [usertype] > >> drivers/misc/eeprom/idt_89hpesx.c:770:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [addressable] [assigned] [usertype] data @@ got restricted __le32 [usertype] @@ > drivers/misc/eeprom/idt_89hpesx.c:770:21: sparse: expected unsigned int [addressable] [assigned] [usertype] data > drivers/misc/eeprom/idt_89hpesx.c:770:21: sparse: got restricted __le32 [usertype] > drivers/misc/eeprom/idt_89hpesx.c:834:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] csraddr @@ got restricted __le16 [usertype] @@ > drivers/misc/eeprom/idt_89hpesx.c:834:24: sparse: expected unsigned short [addressable] [assigned] [usertype] csraddr > drivers/misc/eeprom/idt_89hpesx.c:834:24: sparse: got restricted __le16 [usertype] > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > > [1] https://lore.kernel.org/oe-kbuild-all/202401261250.b07Yt30Z-lkp@intel.com/ Ok, so this fixes a sparse issue, how is that needed for stable kernels? Please be more explicit about what you are "fixing" in the changelog please, as-is this didn't make any sense to me. Please fix up and send a v2. thanks, greg k-h
Hi Greg, On Tue, Jan 30, 2024 at 06:07:18PM -0800, Greg KH wrote: > On Wed, Jan 31, 2024 at 09:34:52AM +0800, Dawei Li wrote: > > Hi Greg, > > > > Thanks for reviewing. > > > > On Tue, Jan 30, 2024 at 06:04:17AM -0800, Greg KH wrote: > > > On Tue, Jan 30, 2024 at 12:06:32PM +0800, Dawei Li wrote: > > > > For data structures needs cpu_to_le* conversion, its prototype needs to > > > > be declared with __le* explicitly. > > > > > > > > Fixes: cfad6425382e ("eeprom: Add IDT 89HPESx EEPROM/CSR driver") > > > > Reported-by: kernel test robot <lkp@intel.com> > > > > Closes: https://lore.kernel.org/oe-kbuild-all/202401261250.b07Yt30Z-lkp@intel.com/ > > > > Signed-off-by: Dawei Li <dawei.li@shingroup.cn> > > > > Cc: <stable@vger.kernel.org> > > > > --- > > > > drivers/misc/eeprom/idt_89hpesx.c | 6 +++--- > > > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/drivers/misc/eeprom/idt_89hpesx.c b/drivers/misc/eeprom/idt_89hpesx.c > > > > index d807d08e2614..327afb866b21 100644 > > > > --- a/drivers/misc/eeprom/idt_89hpesx.c > > > > +++ b/drivers/misc/eeprom/idt_89hpesx.c > > > > @@ -129,7 +129,7 @@ struct idt_smb_seq { > > > > struct idt_eeprom_seq { > > > > u8 cmd; > > > > u8 eeaddr; > > > > - u16 memaddr; > > > > + __le16 memaddr; > > > > u8 data; > > > > } __packed; > > > > > > > > @@ -141,8 +141,8 @@ struct idt_eeprom_seq { > > > > */ > > > > struct idt_csr_seq { > > > > u8 cmd; > > > > - u16 csraddr; > > > > - u32 data; > > > > + __le16 csraddr; > > > > + __le32 data; > > > > } __packed; > > > > > > > > /* > > > > > > Declaring them this way is nice, but this doesn't actually "fix" > > > anything at all as no code is actually changed. > > > > > > So how is ths a bugfix? How does this patch do anything? > > > > > > confused, > > > > Sorry for the confuson. > > > > This commit is to address the issue reported by kernel test rebot[1]. > > > > Partially quoted from it: > > > > sparse warnings: (new ones prefixed by >>) > > >> drivers/misc/eeprom/idt_89hpesx.c:599:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] memaddr @@ got restricted __le16 [usertype] @@ > > drivers/misc/eeprom/idt_89hpesx.c:599:31: sparse: expected unsigned short [addressable] [assigned] [usertype] memaddr > > drivers/misc/eeprom/idt_89hpesx.c:599:31: sparse: got restricted __le16 [usertype] > > drivers/misc/eeprom/idt_89hpesx.c:671:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] memaddr @@ got restricted __le16 [usertype] @@ > > drivers/misc/eeprom/idt_89hpesx.c:671:31: sparse: expected unsigned short [addressable] [assigned] [usertype] memaddr > > drivers/misc/eeprom/idt_89hpesx.c:671:31: sparse: got restricted __le16 [usertype] > > >> drivers/misc/eeprom/idt_89hpesx.c:769:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] csraddr @@ got restricted __le16 [usertype] @@ > > drivers/misc/eeprom/idt_89hpesx.c:769:24: sparse: expected unsigned short [addressable] [assigned] [usertype] csraddr > > drivers/misc/eeprom/idt_89hpesx.c:769:24: sparse: got restricted __le16 [usertype] > > >> drivers/misc/eeprom/idt_89hpesx.c:770:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [addressable] [assigned] [usertype] data @@ got restricted __le32 [usertype] @@ > > drivers/misc/eeprom/idt_89hpesx.c:770:21: sparse: expected unsigned int [addressable] [assigned] [usertype] data > > drivers/misc/eeprom/idt_89hpesx.c:770:21: sparse: got restricted __le32 [usertype] > > drivers/misc/eeprom/idt_89hpesx.c:834:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] csraddr @@ got restricted __le16 [usertype] @@ > > drivers/misc/eeprom/idt_89hpesx.c:834:24: sparse: expected unsigned short [addressable] [assigned] [usertype] csraddr > > drivers/misc/eeprom/idt_89hpesx.c:834:24: sparse: got restricted __le16 [usertype] > > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > > >> drivers/misc/eeprom/idt_89hpesx.c:859:17: sparse: sparse: cast to restricted __le32 > > > > [1] https://lore.kernel.org/oe-kbuild-all/202401261250.b07Yt30Z-lkp@intel.com/ > > Ok, so this fixes a sparse issue, how is that needed for stable kernels? > > Please be more explicit about what you are "fixing" in the changelog > please, as-is this didn't make any sense to me. Yes, it's my fault not making it clear in commit message. Sorry for that. > > Please fix up and send a v2. Will do that. > > thanks, > > greg k-h > Thanks, Dawei
diff --git a/drivers/misc/eeprom/idt_89hpesx.c b/drivers/misc/eeprom/idt_89hpesx.c index d807d08e2614..327afb866b21 100644 --- a/drivers/misc/eeprom/idt_89hpesx.c +++ b/drivers/misc/eeprom/idt_89hpesx.c @@ -129,7 +129,7 @@ struct idt_smb_seq { struct idt_eeprom_seq { u8 cmd; u8 eeaddr; - u16 memaddr; + __le16 memaddr; u8 data; } __packed; @@ -141,8 +141,8 @@ struct idt_eeprom_seq { */ struct idt_csr_seq { u8 cmd; - u16 csraddr; - u32 data; + __le16 csraddr; + __le32 data; } __packed; /*