Re: add sign-extend functions for 8 and 16 bit values

2014-12-15 Thread Peter Zijlstra
On Mon, Dec 15, 2014 at 05:18:31PM +0100, Martin Kepplinger wrote:
> This adds sign_extend8() and sign_extend16() for the quite many cases
> where this is needed, like sign_extend32().

We're still missing sign_extend64() after this.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


add sign-extend functions for 8 and 16 bit values

2014-12-15 Thread Martin Kepplinger
In short: If you want the first 2 changes, please merge them and notify 
me.

This adds sign_extend8() and sign_extend16() for the quite many cases
where this is needed, like sign_extend32().

Sign-extending is done in a few different ways throughout the kernel
and most of them look not very beautiful, adding non-obvious constant
values. This would simplify things.

I append four example changes for existing drivers. I'm aware that you
are not resposible for these, but I'd post them to the relevant
maintainers only if you want to apply to bitops.h.

While I would definitely move on moving drivers over to this, when I find
them, I can't guarantee I'd change every sign-extension out there myself.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


add sign-extend functions for 8 and 16 bit values

2014-12-15 Thread Martin Kepplinger
In short: If you want the first 2 changes, please merge them and notify 
me.

This adds sign_extend8() and sign_extend16() for the quite many cases
where this is needed, like sign_extend32().

Sign-extending is done in a few different ways throughout the kernel
and most of them look not very beautiful, adding non-obvious constant
values. This would simplify things.

I append four example changes for existing drivers. I'm aware that you
are not resposible for these, but I'd post them to the relevant
maintainers only if you want to apply to bitops.h.

While I would definitely move on moving drivers over to this, when I find
them, I can't guarantee I'd change every sign-extension out there myself.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: add sign-extend functions for 8 and 16 bit values

2014-12-15 Thread Peter Zijlstra
On Mon, Dec 15, 2014 at 05:18:31PM +0100, Martin Kepplinger wrote:
 This adds sign_extend8() and sign_extend16() for the quite many cases
 where this is needed, like sign_extend32().

We're still missing sign_extend64() after this.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/