diff mbox series

hdata/spira: be32_to_cpu() doesn't work on 8bits

Message ID 20170928063950.9494-1-stewart@linux.vnet.ibm.com
State Accepted
Headers show
Series hdata/spira: be32_to_cpu() doesn't work on 8bits | expand

Commit Message

Stewart Smith Sept. 28, 2017, 6:39 a.m. UTC
Sparse warning:
hdata/spira.c:1458:41: warning: incorrect type in argument 1 (different base types) expected restricted beint32_t [usertype] be_val got unsigned char const [unsigned] [usertype] link_speed

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 hdata/spira.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Oliver O'Halloran Sept. 28, 2017, 7:03 a.m. UTC | #1
On Thu, Sep 28, 2017 at 4:39 PM, Stewart Smith
<stewart@linux.vnet.ibm.com> wrote:
> Sparse warning:
> hdata/spira.c:1458:41: warning: incorrect type in argument 1 (different base types) expected restricted beint32_t [usertype] be_val got unsigned char const [unsigned] [usertype] link_speed
>
> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
> ---
>  hdata/spira.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hdata/spira.c b/hdata/spira.c
> index 07d172b30afe..a153fe0b104c 100644
> --- a/hdata/spira.c
> +++ b/hdata/spira.c
> @@ -1455,7 +1455,7 @@ static void add_npu(struct dt_node *xscom, const struct HDIF_array_hdr *links,
>                 if (size <= 0x24)
>                         continue;
>
> -               switch (be32_to_cpu(link->link_speed)) {
> +               switch (link->link_speed) {

Ah yeah, that used to be a uint32. It got changed at the last minute
and I forgot to update that.

Reviewed-by: Oliver O'Halloran <oohall@gmail.com>
Stewart Smith Oct. 5, 2017, 7:05 a.m. UTC | #2
Stewart Smith <stewart@linux.vnet.ibm.com> writes:
> Sparse warning:
> hdata/spira.c:1458:41: warning: incorrect type in argument 1 (different base types) expected restricted beint32_t [usertype] be_val got unsigned char const [unsigned] [usertype] link_speed
>
> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>

Merged to master as of f28fdbcd96dadf5f4e3c9509b9d7abe053a87b24
diff mbox series

Patch

diff --git a/hdata/spira.c b/hdata/spira.c
index 07d172b30afe..a153fe0b104c 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -1455,7 +1455,7 @@  static void add_npu(struct dt_node *xscom, const struct HDIF_array_hdr *links,
 		if (size <= 0x24)
 			continue;
 
-		switch (be32_to_cpu(link->link_speed)) {
+		switch (link->link_speed) {
 			case 0: /* 20Gbps */
 				speed = 20000000000ul;
 				nvlink_speed = 0x3;