realtek: Drop space after casts
authorSven Eckelmann <[email protected]>
Sun, 23 Nov 2025 16:26:03 +0000 (17:26 +0100)
committerHauke Mehrtens <[email protected]>
Mon, 24 Nov 2025 23:28:51 +0000 (00:28 +0100)
The Linux kernel coding style recommends not to add a space after
casts.

Signed-off-by: Sven Eckelmann <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20906
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl839x.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl930x.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl931x.c
target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c

index 2c36093807b7b82da080d3dd624d3d12fae5f895..7e6c9c9ec5424b89211ff61f69f4033f3d8f72e7 100644 (file)
@@ -1226,7 +1226,7 @@ static int rtl83xx_netevent_event(struct notifier_block *this,
                net_work->priv = priv;
 
                net_work->mac = ether_addr_to_u64(n->ha);
-               net_work->gw_addr = *(__be32 *) n->primary_key;
+               net_work->gw_addr = *(__be32 *)n->primary_key;
 
                pr_debug("%s: updating neighbour on port %d, mac %016llx\n",
                        __func__, port, net_work->mac);
index 7ac04a0d2e915d6c0f6c2784c0514f440009b3d8..50b753ed3f49796445a939c8123015878886b5f1 100644 (file)
@@ -413,7 +413,7 @@ static u64 rtl838x_read_l2_entry_using_hash(u32 hash, u32 pos, struct rtl838x_l2
        if (!e->valid)
                return 0;
 
-       return (((u64) r[1]) << 32) | (r[2]);  /* mac and vid concatenated as hash seed */
+       return (((u64)r[1]) << 32) | (r[2]);  /* mac and vid concatenated as hash seed */
 }
 
 static void rtl838x_write_l2_entry_using_hash(u32 hash, u32 pos, struct rtl838x_l2_entry *e)
@@ -450,7 +450,7 @@ static u64 rtl838x_read_cam(int idx, struct rtl838x_l2_entry *e)
        pr_debug("Found in CAM: R1 %x R2 %x R3 %x\n", r[0], r[1], r[2]);
 
        /* Return MAC with concatenated VID ac concatenated ID */
-       return (((u64) r[1]) << 32) | r[2];
+       return (((u64)r[1]) << 32) | r[2];
 }
 
 static void rtl838x_write_cam(int idx, struct rtl838x_l2_entry *e)
@@ -1047,33 +1047,33 @@ static void rtl838x_read_pie_fixed_fields(u32 r[], struct pie_rule *pr)
 
 static void rtl838x_write_pie_fixed_fields(u32 r[],  struct pie_rule *pr)
 {
-       r[6] = ((u32) (pr->spmmask_fix & 0x3)) << 22;
-       r[6] |= ((u32) (pr->spn & 0x3f)) << 16;
+       r[6] = ((u32)(pr->spmmask_fix & 0x3)) << 22;
+       r[6] |= ((u32)(pr->spn & 0x3f)) << 16;
        r[6] |= pr->mgnt_vlan ? BIT(15) : 0;
        r[6] |= pr->dmac_hit_sw ? BIT(14) : 0;
        r[6] |= pr->not_first_frag ? BIT(13) : 0;
-       r[6] |= ((u32) (pr->frame_type_l4 & 0x7)) << 10;
-       r[6] |= ((u32) (pr->frame_type & 0x3)) << 8;
+       r[6] |= ((u32)(pr->frame_type_l4 & 0x7)) << 10;
+       r[6] |= ((u32)(pr->frame_type & 0x3)) << 8;
        r[6] |= pr->otag_fmt ? BIT(7) : 0;
        r[6] |= pr->itag_fmt ? BIT(6) : 0;
        r[6] |= pr->otag_exist ? BIT(5) : 0;
        r[6] |= pr->itag_exist ? BIT(4) : 0;
-       r[6] |= ((u32) (pr->frame_type_l2 & 0x3)) << 2;
-       r[6] |= ((u32) (pr->tid & 0x3));
+       r[6] |= ((u32)(pr->frame_type_l2 & 0x3)) << 2;
+       r[6] |= ((u32)(pr->tid & 0x3));
 
-       r[13] = ((u32) (pr->spmmask_fix_m & 0x3)) << 22;
-       r[13] |= ((u32) (pr->spn_m & 0x3f)) << 16;
+       r[13] = ((u32)(pr->spmmask_fix_m & 0x3)) << 22;
+       r[13] |= ((u32)(pr->spn_m & 0x3f)) << 16;
        r[13] |= pr->mgnt_vlan_m ? BIT(15) : 0;
        r[13] |= pr->dmac_hit_sw_m ? BIT(14) : 0;
        r[13] |= pr->not_first_frag_m ? BIT(13) : 0;
-       r[13] |= ((u32) (pr->frame_type_l4_m & 0x7)) << 10;
-       r[13] |= ((u32) (pr->frame_type_m & 0x3)) << 8;
+       r[13] |= ((u32)(pr->frame_type_l4_m & 0x7)) << 10;
+       r[13] |= ((u32)(pr->frame_type_m & 0x3)) << 8;
        r[13] |= pr->otag_fmt_m ? BIT(7) : 0;
        r[13] |= pr->itag_fmt_m ? BIT(6) : 0;
        r[13] |= pr->otag_exist_m ? BIT(5) : 0;
        r[13] |= pr->itag_exist_m ? BIT(4) : 0;
-       r[13] |= ((u32) (pr->frame_type_l2_m & 0x3)) << 2;
-       r[13] |= ((u32) (pr->tid_m & 0x3));
+       r[13] |= ((u32)(pr->frame_type_l2_m & 0x3)) << 2;
+       r[13] |= ((u32)(pr->tid_m & 0x3));
 
        r[14] = pr->valid ? BIT(31) : 0;
        r[14] |= pr->cond_not ? BIT(30) : 0;
index 2303ce26122f9b0e1adf9c0a7cdb10a893c084f3..b1bf9e9aec5969499a204d5ee31034d1fd35d92f 100644 (file)
@@ -1111,33 +1111,33 @@ static void rtl839x_read_pie_fixed_fields(u32 r[], struct pie_rule *pr)
 
 static void rtl839x_write_pie_fixed_fields(u32 r[],  struct pie_rule *pr)
 {
-       r[6] = ((u32) (pr->spmmask_fix & 0x3)) << 30;
-       r[6] |= ((u32) (pr->spn & 0x3f)) << 24;
+       r[6] = ((u32)(pr->spmmask_fix & 0x3)) << 30;
+       r[6] |= ((u32)(pr->spn & 0x3f)) << 24;
        r[6] |= pr->mgnt_vlan ? BIT(23) : 0;
        r[6] |= pr->dmac_hit_sw ? BIT(22) : 0;
        r[6] |= pr->not_first_frag ? BIT(21) : 0;
-       r[6] |= ((u32) (pr->frame_type_l4 & 0x7)) << 18;
-       r[6] |= ((u32) (pr->frame_type & 0x3)) << 16;
+       r[6] |= ((u32)(pr->frame_type_l4 & 0x7)) << 18;
+       r[6] |= ((u32)(pr->frame_type & 0x3)) << 16;
        r[6] |= pr->otag_fmt ? BIT(15) : 0;
        r[6] |= pr->itag_fmt ? BIT(14) : 0;
        r[6] |= pr->otag_exist ? BIT(13) : 0;
        r[6] |= pr->itag_exist ? BIT(12) : 0;
-       r[6] |= ((u32) (pr->frame_type_l2 & 0x3)) << 10;
-       r[6] |= ((u32) (pr->tid & 0x3)) << 8;
+       r[6] |= ((u32)(pr->frame_type_l2 & 0x3)) << 10;
+       r[6] |= ((u32)(pr->tid & 0x3)) << 8;
 
-       r[12] |= ((u32) (pr->spmmask_fix_m & 0x3)) << 6;
-       r[12] |= (u32) (pr->spn_m & 0x3f);
+       r[12] |= ((u32)(pr->spmmask_fix_m & 0x3)) << 6;
+       r[12] |= (u32)(pr->spn_m & 0x3f);
        r[13] |= pr->mgnt_vlan_m ? BIT(31) : 0;
        r[13] |= pr->dmac_hit_sw_m ? BIT(30) : 0;
        r[13] |= pr->not_first_frag_m ? BIT(29) : 0;
-       r[13] |= ((u32) (pr->frame_type_l4_m & 0x7)) << 26;
-       r[13] |= ((u32) (pr->frame_type_m & 0x3)) << 24;
+       r[13] |= ((u32)(pr->frame_type_l4_m & 0x7)) << 26;
+       r[13] |= ((u32)(pr->frame_type_m & 0x3)) << 24;
        r[13] |= pr->otag_fmt_m ? BIT(23) : 0;
        r[13] |= pr->itag_fmt_m ? BIT(22) : 0;
        r[13] |= pr->otag_exist_m ? BIT(21) : 0;
        r[13] |= pr->itag_exist_m ? BIT(20) : 0;
-       r[13] |= ((u32) (pr->frame_type_l2_m & 0x3)) << 18;
-       r[13] |= ((u32) (pr->tid_m & 0x3)) << 16;
+       r[13] |= ((u32)(pr->frame_type_l2_m & 0x3)) << 18;
+       r[13] |= ((u32)(pr->tid_m & 0x3)) << 16;
 
        r[13] |= pr->valid ? BIT(15) : 0;
        r[13] |= pr->cond_not ? BIT(14) : 0;
index 42e3601a180ac743098aa8f2897b072ae58c2259..64df8065eb8aa7dfc471ceeb906a1d0c8d23403a 100644 (file)
@@ -1744,40 +1744,40 @@ static void rtl930x_write_pie_templated(u32 r[], struct pie_rule *pr, enum templ
 static void rtl930x_write_pie_fixed_fields(u32 r[],  struct pie_rule *pr)
 {
        r[6] = pr->stacking_port ? BIT(31) : 0;
-       r[6] |= ((u32) (pr->spn & 0x7f)) << 24;
+       r[6] |= ((u32)(pr->spn & 0x7f)) << 24;
        r[6] |= pr->mgnt_vlan ? BIT(23) : 0;
        if (pr->phase == PHASE_IACL)
                r[6] |= pr->dmac_hit_sw ? BIT(22) : 0;
        else
                r[6] |= pr->content_too_deep ? BIT(22) : 0;
        r[6] |= pr->not_first_frag ? BIT(21) : 0;
-       r[6] |= ((u32) (pr->frame_type_l4 & 0x7)) << 18;
-       r[6] |= ((u32) (pr->frame_type & 0x3)) << 16;
+       r[6] |= ((u32)(pr->frame_type_l4 & 0x7)) << 18;
+       r[6] |= ((u32)(pr->frame_type & 0x3)) << 16;
        r[6] |= pr->otag_fmt ? BIT(15) : 0;
        r[6] |= pr->itag_fmt ? BIT(14) : 0;
        r[6] |= pr->otag_exist ? BIT(13) : 0;
        r[6] |= pr->itag_exist ? BIT(12) : 0;
-       r[6] |= ((u32) (pr->frame_type_l2 & 0x3)) << 10;
+       r[6] |= ((u32)(pr->frame_type_l2 & 0x3)) << 10;
        r[6] |= pr->igr_normal_port ? BIT(9) : 0;
-       r[6] |= ((u32) (pr->tid & 0x1)) << 8;
+       r[6] |= ((u32)(pr->tid & 0x1)) << 8;
 
        r[12] |= pr->stacking_port_m ? BIT(7) : 0;
-       r[12] |= (u32) (pr->spn_m & 0x7f);
+       r[12] |= (u32)(pr->spn_m & 0x7f);
        r[13] |= pr->mgnt_vlan_m ? BIT(31) : 0;
        if (pr->phase == PHASE_IACL)
                r[13] |= pr->dmac_hit_sw_m ? BIT(30) : 0;
        else
                r[13] |= pr->content_too_deep_m ? BIT(30) : 0;
        r[13] |= pr->not_first_frag_m ? BIT(29) : 0;
-       r[13] |= ((u32) (pr->frame_type_l4_m & 0x7)) << 26;
-       r[13] |= ((u32) (pr->frame_type_m & 0x3)) << 24;
+       r[13] |= ((u32)(pr->frame_type_l4_m & 0x7)) << 26;
+       r[13] |= ((u32)(pr->frame_type_m & 0x3)) << 24;
        r[13] |= pr->otag_fmt_m ? BIT(23) : 0;
        r[13] |= pr->itag_fmt_m ? BIT(22) : 0;
        r[13] |= pr->otag_exist_m ? BIT(21) : 0;
        r[13] |= pr->itag_exist_m ? BIT(20) : 0;
-       r[13] |= ((u32) (pr->frame_type_l2_m & 0x3)) << 18;
+       r[13] |= ((u32)(pr->frame_type_l2_m & 0x3)) << 18;
        r[13] |= pr->igr_normal_port_m ? BIT(17) : 0;
-       r[13] |= ((u32) (pr->tid_m & 0x1)) << 16;
+       r[13] |= ((u32)(pr->tid_m & 0x1)) << 16;
 
        r[13] |= pr->valid ? BIT(15) : 0;
        r[13] |= pr->cond_not ? BIT(14) : 0;
index 2c2d627fe256a1ce1c3a44f412f19b75d0f3221c..54cc8d2e61d9669c08729a20fc04704673d67798 100644 (file)
@@ -148,7 +148,7 @@ static void rtl931x_vlan_profile_dump(int index)
                     (sw_r32(RTL931X_VLAN_PROFILE_SET(index) + 24) & 0xFFFFFFFF);
 
        pr_debug("VLAN %d: L2 learning: %d, L2 Unknown MultiCast Field %llx, IPv4 Unknown MultiCast Field %llx, IPv6 Unknown MultiCast Field: %llx\n",
-                index, (u32) (profile[0] & (3 << 14)), profile[1], profile[2], profile[3]);
+                index, (u32)(profile[0] & (3 << 14)), profile[1], profile[2], profile[3]);
 }
 
 static void rtl931x_stp_get(struct rtl838x_switch_priv *priv, u16 msti, u32 port_state[])
@@ -193,7 +193,7 @@ static void rtl931x_vlan_tables_read(u32 vlan, struct rtl838x_vlan_info *info)
        rtl_table_release(r);
 
        pr_debug("VLAN_READ %d: %08x %08x %08x %08x\n", vlan, v, w, x, y);
-       info->member_ports = ((u64) v) << 25 | (w >> 7);
+       info->member_ports = ((u64)v) << 25 | (w >> 7);
        info->profile_id = (x >> 16) & 0xf;
        info->fid = w & 0x7f;                           /* AKA MSTI depending on context */
        info->hash_uc_fid = !!(x & BIT(31));
@@ -1131,15 +1131,15 @@ static void rtl931x_write_pie_fixed_fields(u32 r[],  struct pie_rule *pr)
        else
                r[7] |= pr->content_too_deep ? BIT(30) : 0;
        r[7] |= pr->not_first_frag ? BIT(29) : 0;
-       r[7] |= ((u32) (pr->frame_type_l4 & 0x7)) << 26;
-       r[7] |= ((u32) (pr->frame_type & 0x3)) << 24;
+       r[7] |= ((u32)(pr->frame_type_l4 & 0x7)) << 26;
+       r[7] |= ((u32)(pr->frame_type & 0x3)) << 24;
        r[7] |= pr->otag_fmt ? BIT(23) : 0;
        r[7] |= pr->itag_fmt ? BIT(22) : 0;
        r[7] |= pr->otag_exist ? BIT(21) : 0;
        r[7] |= pr->itag_exist ? BIT(20) : 0;
-       r[7] |= ((u32) (pr->frame_type_l2 & 0x3)) << 18;
+       r[7] |= ((u32)(pr->frame_type_l2 & 0x3)) << 18;
        r[7] |= pr->igr_normal_port ? BIT(17) : 0;
-       r[7] |= ((u32) (pr->tid & 0x1)) << 16;
+       r[7] |= ((u32)(pr->tid & 0x1)) << 16;
 
        r[14] |= pr->mgnt_vlan_m ? BIT(15) : 0;
        if (pr->phase == PHASE_IACL)
@@ -1147,15 +1147,15 @@ static void rtl931x_write_pie_fixed_fields(u32 r[],  struct pie_rule *pr)
        else
                r[14] |= pr->content_too_deep_m ? BIT(14) : 0;
        r[14] |= pr->not_first_frag_m ? BIT(13) : 0;
-       r[14] |= ((u32) (pr->frame_type_l4_m & 0x7)) << 10;
-       r[14] |= ((u32) (pr->frame_type_m & 0x3)) << 8;
+       r[14] |= ((u32)(pr->frame_type_l4_m & 0x7)) << 10;
+       r[14] |= ((u32)(pr->frame_type_m & 0x3)) << 8;
        r[14] |= pr->otag_fmt_m ? BIT(7) : 0;
        r[14] |= pr->itag_fmt_m ? BIT(6) : 0;
        r[14] |= pr->otag_exist_m ? BIT(5) : 0;
        r[14] |= pr->itag_exist_m ? BIT(4) : 0;
-       r[14] |= ((u32) (pr->frame_type_l2_m & 0x3)) << 2;
+       r[14] |= ((u32)(pr->frame_type_l2_m & 0x3)) << 2;
        r[14] |= pr->igr_normal_port_m ? BIT(1) : 0;
-       r[14] |= (u32) (pr->tid_m & 0x1);
+       r[14] |= (u32)(pr->tid_m & 0x1);
 
        r[15] |= pr->valid ? BIT(31) : 0;
        r[15] |= pr->cond_not ? BIT(30) : 0;
index 771aa43edc2cd28e5f8f8fb92b4ff29a95e5fa0a..26b4553542c78de97e947f3006a300a965b172ff 100644 (file)
@@ -783,7 +783,7 @@ static void rtl839x_setup_notify_ring_buffer(struct rtl838x_eth_priv *priv)
        for (int i = 0; i < NOTIFY_BLOCKS; i++)
                b->ring[i] = KSEG1ADDR(&b->blocks[i]) | 1 | (i == (NOTIFY_BLOCKS - 1) ? WRAP : 0);
 
-       sw_w32((u32) b->ring, RTL839X_DMA_IF_NBUF_BASE_DESC_ADDR_CTRL);
+       sw_w32((u32)b->ring, RTL839X_DMA_IF_NBUF_BASE_DESC_ADDR_CTRL);
        sw_w32_mask(0x3ff << 2, 100 << 2, RTL839X_L2_NOTIFICATION_CTRL);
 
        /* Setup notification events */
@@ -1427,7 +1427,7 @@ static int rtl838x_set_mac_address(struct net_device *dev, void *p)
 {
        struct rtl838x_eth_priv *priv = netdev_priv(dev);
        const struct sockaddr *addr = p;
-       u8 *mac = (u8 *) (addr->sa_data);
+       u8 *mac = (u8 *)(addr->sa_data);
 
        if (!is_valid_ether_addr(addr->sa_data))
                return -EADDRNOTAVAIL;
index 3346c40c9c3bb7310c9053284f875877e053cc45..fe72beded3e248c2e402dac2737a17d92d61af39 100644 (file)
@@ -217,7 +217,7 @@ static struct fw_header *rtl838x_request_fw(struct phy_device *phydev,
                goto out;
        }
 
-       h = (struct fw_header *) fw->data;
+       h = (struct fw_header *)fw->data;
        pr_info("Firmware loaded. Size %d, magic: %08x\n", fw->size, h->magic);
 
        if (h->magic != 0x83808380) {