2022-11-06 19:02:33

by Deepak R Varma

[permalink] [raw]
Subject: [PATCH v2 0/2] staging: r8188eu: casting simplified

Patch set proposes variable casting simplifications. Change improves code
readability and appears more maintainable.

Changes in v2:
1. Patch set introduced.
Changes associated with pointer casting and variable casting are
split into separate patches. Hence the patch set.
Suggested by [email protected]


Deepak R Varma (2):
staging: r8188eu: simplify complex pointer casting
staging: r8188eu: remove unnecessary casting

drivers/staging/r8188eu/core/rtw_br_ext.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

--
2.34.1





2022-11-06 19:21:08

by Deepak R Varma

[permalink] [raw]
Subject: [PATCH v2 2/2] staging: r8188eu: remove unnecessary casting

The dhcpMessage struct member variable "cookie" is already declared
to be of type __be32. There is no need to cast it again as __be32.

Signed-off-by: Deepak R Varma <[email protected]>
---

Changes in v2:
1. Change associated with variable cookie separated into this patch.
Feedback from [email protected].

drivers/staging/r8188eu/core/rtw_br_ext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index 4deaa7e352a3..a7c67014dde0 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -615,7 +615,7 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb)
if ((udph->source == htons(CLIENT_PORT)) &&
(udph->dest == htons(SERVER_PORT))) { /* DHCP request */
struct dhcpMessage *dhcph = (void *)udph + sizeof(struct udphdr);
- u32 cookie = be32_to_cpu((__be32)dhcph->cookie);
+ u32 cookie = be32_to_cpu(dhcph->cookie);

if (cookie == DHCP_MAGIC) { /* match magic word */
if (!(dhcph->flags & htons(BROADCAST_FLAG))) {
--
2.34.1




2022-11-07 07:03:24

by Philipp Hortmann

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] staging: r8188eu: casting simplified

On 11/6/22 18:54, Deepak R Varma wrote:
> Patch set proposes variable casting simplifications. Change improves code
> readability and appears more maintainable.
>
> Changes in v2:
> 1. Patch set introduced.
> Changes associated with pointer casting and variable casting are
> split into separate patches. Hence the patch set.
> Suggested by [email protected]
>
>
> Deepak R Varma (2):
> staging: r8188eu: simplify complex pointer casting
> staging: r8188eu: remove unnecessary casting
>
> drivers/staging/r8188eu/core/rtw_br_ext.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> --
> 2.34.1
>
>
>
>
Tested-by: Philipp Hortmann <[email protected]> # Edimax N150