Jaswinder Singh | 12 Jul 10:53
Favicon

warning: cast adds address space to expression

Hello all,

I am trying to solve sparse warnings in kernel.

Please let me know how can I solve following sparse warning :-

warning: cast adds address space to expression

Is this a warning or a Info.

If any sparse documentation is available, please let me know.

Thank you,

Jaswinder Singh.



--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Pavel Roskin | 12 Jul 17:17

Re: warning: cast adds address space to expression

Quoting Jaswinder Singh <jaswinder <at> infradead.org>:

> Hello all,
>
> I am trying to solve sparse warnings in kernel.
>
> Please let me know how can I solve following sparse warning :-
>
> warning: cast adds address space to expression
>
> Is this a warning or a Info.

It's a warning.  The code must be doing something like this:

void *addr1;
void __iomem *addr2;

addr2 = (void __iomem *) addr1;

> If any sparse documentation is available, please let me know.

I don't think you need sparse documentation to resolve it.  Sparse  
only detected a bad cast, but fixing it requires deeper understanding  
of the code, not of the warning.

You should look at the expression and see if the value before cast  
needs the attribute, or the value after the cast doesn't need the  
attribute.

The meanings of attributes in Linux are:
(Continue reading)


Gmane