From: kernel test robot <lkp@intel.com>
To: Greg Joyce <gjoyce@linux.vnet.ibm.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>,
Jonathan Derrick <jonathan.derrick@linux.dev>
Subject: arch/powerpc/platforms/pseries/plpks_sed_ops.c:89:15: sparse: sparse: cast to restricted __be32
Date: Sun, 19 Nov 2023 12:09:06 +0800 [thread overview]
Message-ID: <202311191142.ZOdOE2vT-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b8f1fa2419c19c81bc386a6b350879ba54a573e1
commit: ec8cf230ceccfcc2bd29990c2902be168a92dee4 powerpc/pseries: PLPKS SED Opal keystore support
date: 5 weeks ago
config: powerpc64-randconfig-r131-20231119 (https://download.01.org/0day-ci/archive/20231119/202311191142.ZOdOE2vT-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231119/202311191142.ZOdOE2vT-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311191142.ZOdOE2vT-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> arch/powerpc/platforms/pseries/plpks_sed_ops.c:89:15: sparse: sparse: cast to restricted __be32
>> arch/powerpc/platforms/pseries/plpks_sed_ops.c:89:15: sparse: sparse: cast to restricted __be32
>> arch/powerpc/platforms/pseries/plpks_sed_ops.c:89:15: sparse: sparse: cast to restricted __be32
>> arch/powerpc/platforms/pseries/plpks_sed_ops.c:89:15: sparse: sparse: cast to restricted __be32
>> arch/powerpc/platforms/pseries/plpks_sed_ops.c:89:15: sparse: sparse: cast to restricted __be32
>> arch/powerpc/platforms/pseries/plpks_sed_ops.c:89:15: sparse: sparse: cast to restricted __be32
>> arch/powerpc/platforms/pseries/plpks_sed_ops.c:116:24: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long [addressable] [assigned] [usertype] authority @@ got restricted __be64 [usertype] @@
arch/powerpc/platforms/pseries/plpks_sed_ops.c:116:24: sparse: expected unsigned long [addressable] [assigned] [usertype] authority
arch/powerpc/platforms/pseries/plpks_sed_ops.c:116:24: sparse: got restricted __be64 [usertype]
>> arch/powerpc/platforms/pseries/plpks_sed_ops.c:117:20: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned long [addressable] [assigned] [usertype] range @@ got restricted __be64 [usertype] @@
arch/powerpc/platforms/pseries/plpks_sed_ops.c:117:20: sparse: expected unsigned long [addressable] [assigned] [usertype] range
arch/powerpc/platforms/pseries/plpks_sed_ops.c:117:20: sparse: got restricted __be64 [usertype]
>> arch/powerpc/platforms/pseries/plpks_sed_ops.c:119:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [addressable] [assigned] [usertype] key_len @@ got restricted __be32 [usertype] @@
arch/powerpc/platforms/pseries/plpks_sed_ops.c:119:22: sparse: expected unsigned int [addressable] [assigned] [usertype] key_len
arch/powerpc/platforms/pseries/plpks_sed_ops.c:119:22: sparse: got restricted __be32 [usertype]
vim +89 arch/powerpc/platforms/pseries/plpks_sed_ops.c
66
67 /*
68 * Read the SED Opal key from PLPKS given the label
69 */
70 int sed_read_key(char *keyname, char *key, u_int *keylen)
71 {
72 struct plpks_var var;
73 struct plpks_sed_object_data data;
74 int ret;
75 u_int len;
76
77 plpks_init_var(&var, keyname);
78
79 if (!plpks_sed_available)
80 return -EOPNOTSUPP;
81
82 var.data = (u8 *)&data;
83 var.datalen = sizeof(data);
84
85 ret = plpks_read_os_var(&var);
86 if (ret != 0)
87 return ret;
88
> 89 len = min_t(u16, be32_to_cpu(data.key_len), var.datalen);
90 memcpy(key, data.key, len);
91 key[len] = '\0';
92 *keylen = len;
93
94 return 0;
95 }
96
97 /*
98 * Write the SED Opal key to PLPKS given the label
99 */
100 int sed_write_key(char *keyname, char *key, u_int keylen)
101 {
102 struct plpks_var var;
103 struct plpks_sed_object_data data;
104 struct plpks_var_name vname;
105
106 plpks_init_var(&var, keyname);
107
108 if (!plpks_sed_available)
109 return -EOPNOTSUPP;
110
111 var.datalen = sizeof(struct plpks_sed_object_data);
112 var.data = (u8 *)&data;
113
114 /* initialize SED object */
115 data.version = PLPKS_SED_OBJECT_DATA_V0;
> 116 data.authority = cpu_to_be64(PLPKS_SED_AUTHORITY);
> 117 data.range = cpu_to_be64(PLPKS_SED_RANGE);
118 memset(&data.pad1, '\0', sizeof(data.pad1));
> 119 data.key_len = cpu_to_be32(keylen);
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-11-19 4:13 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=202311191142.ZOdOE2vT-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=gjoyce@linux.vnet.ibm.com \
--cc=jonathan.derrick@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®