2023-02-02 15:31:49

by Peter Zijlstra

[permalink] [raw]
Subject: [PATCH v2 01/10] cyrpto/b128ops: Remove struct u128

Per git-grep u128_xor() and its related struct u128 are unused except
to implement {be,le}128_xor(). Remove them to free up the namespace.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
---
include/crypto/b128ops.h | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)

--- a/include/crypto/b128ops.h
+++ b/include/crypto/b128ops.h
@@ -50,10 +50,6 @@
#include <linux/types.h>

typedef struct {
- u64 a, b;
-} u128;
-
-typedef struct {
__be64 a, b;
} be128;

@@ -61,20 +57,16 @@ typedef struct {
__le64 b, a;
} le128;

-static inline void u128_xor(u128 *r, const u128 *p, const u128 *q)
+static inline void be128_xor(be128 *r, const be128 *p, const be128 *q)
{
r->a = p->a ^ q->a;
r->b = p->b ^ q->b;
}

-static inline void be128_xor(be128 *r, const be128 *p, const be128 *q)
-{
- u128_xor((u128 *)r, (u128 *)p, (u128 *)q);
-}
-
static inline void le128_xor(le128 *r, const le128 *p, const le128 *q)
{
- u128_xor((u128 *)r, (u128 *)p, (u128 *)q);
+ r->a = p->a ^ q->a;
+ r->b = p->b ^ q->b;
}

#endif /* _CRYPTO_B128OPS_H */




2023-02-02 20:23:24

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH v2 01/10] cyrpto/b128ops: Remove struct u128

On February 2, 2023 6:50:31 AM PST, Peter Zijlstra <[email protected]> wrote:
>Per git-grep u128_xor() and its related struct u128 are unused except
>to implement {be,le}128_xor(). Remove them to free up the namespace.
>
>Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
>---
> include/crypto/b128ops.h | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
>--- a/include/crypto/b128ops.h
>+++ b/include/crypto/b128ops.h
>@@ -50,10 +50,6 @@
> #include <linux/types.h>
>
> typedef struct {
>- u64 a, b;
>-} u128;
>-
>-typedef struct {
> __be64 a, b;
> } be128;
>
>@@ -61,20 +57,16 @@ typedef struct {
> __le64 b, a;
> } le128;
>
>-static inline void u128_xor(u128 *r, const u128 *p, const u128 *q)
>+static inline void be128_xor(be128 *r, const be128 *p, const be128 *q)
> {
> r->a = p->a ^ q->a;
> r->b = p->b ^ q->b;
> }
>
>-static inline void be128_xor(be128 *r, const be128 *p, const be128 *q)
>-{
>- u128_xor((u128 *)r, (u128 *)p, (u128 *)q);
>-}
>-
> static inline void le128_xor(le128 *r, const le128 *p, const le128 *q)
> {
>- u128_xor((u128 *)r, (u128 *)p, (u128 *)q);
>+ r->a = p->a ^ q->a;
>+ r->b = p->b ^ q->b;
> }
>
> #endif /* _CRYPTO_B128OPS_H */
>
>

Can we centralize these ordered types, too?

2023-02-03 01:33:16

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH v2 01/10] cyrpto/b128ops: Remove struct u128

On Thu, Feb 02, 2023 at 03:50:31PM +0100, Peter Zijlstra wrote:
> Per git-grep u128_xor() and its related struct u128 are unused except
> to implement {be,le}128_xor(). Remove them to free up the namespace.
>
> Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
> ---
> include/crypto/b128ops.h | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)

Acked-by: Herbert Xu <[email protected]>
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt