treewide: strip trailing whitespace

Strip trailing whitespace in all code:
find . -type f | grep "\.c$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.h$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.dts$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.dtsi$" | xargs sed -i 's/[ \t]\+$//'

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18626
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Mieczyslaw Nalewaj
2025-05-19 14:27:36 +02:00
committed by Robert Marko
parent 6b43a52171
commit a238170e57
138 changed files with 1965 additions and 1965 deletions

View File

@@ -148,7 +148,7 @@
label = "Factory";
reg = <0x50000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;

View File

@@ -215,7 +215,7 @@
#nvmem-cell-cells = <1>;
};
};
};
partition@69c0000 {

View File

@@ -195,7 +195,7 @@
reg = <0x380000 0x200000>;
read-only;
};
partition@580000 {
label = "ubi";
reg = <0x580000 0x7a80000>;

View File

@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;

View File

@@ -250,7 +250,7 @@
slot0: pcie@0,0 {
reg = <0x0000 0 0 0 0>;
#address-cells = <0x03>;
#address-cells = <0x03>;
#size-cells = <0x02>;
};
};

View File

@@ -45,7 +45,7 @@
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory: eeprom@0 {

View File

@@ -262,7 +262,7 @@ void rtk_hal_dump_table(void)
printk(" %2d", l2_data.fid);
printk(" %4d", l2_data.cvid);
printk(" %02x%02x%02x%02x%02x%02x\n", l2_data.mac.octet[0],
l2_data.mac.octet[1], l2_data.mac.octet[2], l2_data.mac.octet[3],
l2_data.mac.octet[1], l2_data.mac.octet[2], l2_data.mac.octet[3],
l2_data.mac.octet[4], l2_data.mac.octet[5]);
address ++;
}
@@ -523,7 +523,7 @@ void rtk_hal_qos_get_table2type(struct ra_switch_ioctl_data *data)
void rtk_hal_qos_set_port2table(struct ra_switch_ioctl_data *data)
{
rtk_api_ret_t ret;
ret = rtk_qos_portPriSelIndex_set(data->port, data->qos_table_idx);
if (ret != 0)
printk("rtk_qos_portPriSelIndex_set failed\n");
@@ -533,7 +533,7 @@ void rtk_hal_qos_get_port2table(struct ra_switch_ioctl_data *data)
{
rtk_api_ret_t ret;
rtk_qos_priDecTbl_t Index;
ret = rtk_qos_portPriSelIndex_get(data->port, &Index);
if (ret != 0)
printk("rtk_qos_portPriSelIndex_set failed\n");
@@ -642,7 +642,7 @@ void rtk_hal_enable_igmpsnoop(struct ra_switch_ioctl_data *data)
{
rtk_api_ret_t ret;
rtk_portmask_t pmask;
ret = rtk_igmp_init();
if (data->on_off == 1) {
@@ -800,7 +800,7 @@ void rtk_hal_vlan_tag(struct ra_switch_ioctl_data *data)
RTK_PORTMASK_PORT_SET(vlan.untag, data->port);
else
RTK_PORTMASK_PORT_CLEAR(vlan.untag, data->port);
ret = rtk_vlan_set(data->vid, &vlan);
if (ret != RT_ERR_OK)
printk("rtk_vlan_set failed\n");

View File

@@ -28,15 +28,15 @@
#define RTL8367C_SW_CPU_PORT 6
//RTL8367C_PHY_PORT_NUM + ext0 + ext1
#define RTL8367C_NUM_PORTS 7
#define RTL8367C_NUM_VIDS 4096
#define RTL8367C_NUM_PORTS 7
#define RTL8367C_NUM_VIDS 4096
struct rtl8367_priv {
struct switch_dev swdev;
bool global_vlan_enable;
};
struct rtl8367_mib_counter {
struct rtl8367_mib_counter {
const char *name;
};
@@ -72,13 +72,13 @@ static struct rtl8367_mib_counter rtl8367c_mib_counters[] = {
{"etherStatsPkts256to511Octets"},
{"etherStatsPkts512to1023Octets"},
{"etherStatsPkts1024toMaxOctets"},
{"etherStatsMcastPkts"},
{"etherStatsMcastPkts"},
{"etherStatsBcastPkts"},
{"ifOutOctets"},
{"dot3StatsSingleCollisionFrames"},
{"dot3StatsMultipleCollisionFrames"},
{"dot3StatsDeferredTransmissions"},
{"dot3StatsLateCollisions"},
{"dot3StatsLateCollisions"},
{"etherStatsCollisions"},
{"dot3StatsExcessiveCollisions"},
{"dot3OutPauseFrames"},
@@ -131,7 +131,7 @@ static inline unsigned int rtl8367c_portmask_phy_to_sw(rtk_portmask_t phy_portma
if(RTK_PORTMASK_IS_PORT_SET(phy_portmask,rtl8367c_sw_to_phy_port(i))) {
RTK_PORTMASK_PORT_CLEAR(phy_portmask,rtl8367c_sw_to_phy_port(i));
RTK_PORTMASK_PORT_SET(phy_portmask,i);
}
}
}
return (unsigned int)phy_portmask.bits[0];
@@ -155,7 +155,7 @@ static int rtl8367c_get_mibs_num(void)
static const char *rtl8367c_get_mib_name(int idx)
{
return rtl8367c_mib_counters[idx].name;
}
@@ -166,7 +166,7 @@ static int rtl8367c_get_port_mib_counter(int idx, int port, unsigned long long *
static int rtl8367c_is_vlan_valid(unsigned int vlan)
{
unsigned max = RTL8367C_NUM_VIDS;
unsigned max = RTL8367C_NUM_VIDS;
if (vlan == 0 || vlan >= max)
return 0;
@@ -175,37 +175,37 @@ static int rtl8367c_is_vlan_valid(unsigned int vlan)
}
static int rtl8367c_get_vlan( unsigned short vid, struct rtl8367_vlan_info *vlan)
{
{
rtk_vlan_cfg_t vlan_cfg;
memset(vlan, '\0', sizeof(struct rtl8367_vlan_info));
if (vid >= RTL8367C_NUM_VIDS)
return -EINVAL;
return -EINVAL;
if(rtk_vlan_get(vid,&vlan_cfg))
return -EINVAL;
return -EINVAL;
vlan->vid = vid;
vlan->member = rtl8367c_portmask_phy_to_sw(vlan_cfg.mbr);
vlan->untag = rtl8367c_portmask_phy_to_sw(vlan_cfg.untag);
vlan->member = rtl8367c_portmask_phy_to_sw(vlan_cfg.mbr);
vlan->untag = rtl8367c_portmask_phy_to_sw(vlan_cfg.untag);
vlan->fid = vlan_cfg.fid_msti;
return 0;
}
static int rtl8367c_set_vlan( unsigned short vid, u32 mbr, u32 untag, u8 fid)
{
{
rtk_vlan_cfg_t vlan_cfg;
int i;
memset(&vlan_cfg, 0x00, sizeof(rtk_vlan_cfg_t));
memset(&vlan_cfg, 0x00, sizeof(rtk_vlan_cfg_t));
for (i = 0; i < RTL8367C_NUM_PORTS; i++) {
if (mbr & (1 << i)) {
RTK_PORTMASK_PORT_SET(vlan_cfg.mbr, rtl8367c_sw_to_phy_port(i));
if(untag & (1 << i))
RTK_PORTMASK_PORT_SET(vlan_cfg.untag, rtl8367c_sw_to_phy_port(i));
RTK_PORTMASK_PORT_SET(vlan_cfg.untag, rtl8367c_sw_to_phy_port(i));
}
}
vlan_cfg.fid_msti=fid;
@@ -217,9 +217,9 @@ static int rtl8367c_set_vlan( unsigned short vid, u32 mbr, u32 untag, u8 fid)
static int rtl8367c_get_pvid( int port, int *pvid)
{
u32 prio=0;
if (port >= RTL8367C_NUM_PORTS)
return -EINVAL;
return -EINVAL;
return rtk_vlan_portPvid_get(rtl8367c_sw_to_phy_port(port),pvid,&prio);
}
@@ -228,16 +228,16 @@ static int rtl8367c_get_pvid( int port, int *pvid)
static int rtl8367c_set_pvid( int port, int pvid)
{
u32 prio=0;
if (port >= RTL8367C_NUM_PORTS)
return -EINVAL;
return -EINVAL;
return rtk_vlan_portPvid_set(rtl8367c_sw_to_phy_port(port),pvid,prio);
}
static int rtl8367c_get_port_link(int port, int *link, int *speed, int *duplex)
{
if(rtk_port_phyStatus_get(rtl8367c_sw_to_phy_port(port),(rtk_port_linkStatus_t *)link,
(rtk_port_speed_t *)speed,(rtk_port_duplex_t *)duplex))
return -EINVAL;
@@ -252,7 +252,7 @@ rtl8367_sw_set_vlan_enable(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
struct rtl8367_priv *priv = container_of(dev, struct rtl8367_priv, swdev);
struct rtl8367_priv *priv = container_of(dev, struct rtl8367_priv, swdev);
priv->global_vlan_enable = val->value.i ;
@@ -295,7 +295,7 @@ static int rtl8367_sw_reset_port_mibs(struct switch_dev *dev,
static int rtl8367_sw_get_port_mib(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
{
int i, len = 0;
unsigned long long counter = 0;
static char mib_buf[4096];
@@ -305,7 +305,7 @@ static int rtl8367_sw_get_port_mib(struct switch_dev *dev,
len += snprintf(mib_buf + len, sizeof(mib_buf) - len,
"Port %d MIB counters\n",
val->port_vlan);
val->port_vlan);
for (i = 0; i <rtl8367c_get_mibs_num(); ++i) {
len += snprintf(mib_buf + len, sizeof(mib_buf) - len,
@@ -328,7 +328,7 @@ static int rtl8367_sw_get_port_mib(struct switch_dev *dev,
static int rtl8367_sw_get_vlan_info(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
{
{
int i;
u32 len = 0;
struct rtl8367_vlan_info vlan;
@@ -370,8 +370,8 @@ static int rtl8367_sw_get_vlan_ports(struct switch_dev *dev, struct switch_val *
{
struct switch_port *port;
struct rtl8367_vlan_info vlan;
int i;
int i;
if (!rtl8367c_is_vlan_valid(val->port_vlan))
return -EINVAL;
@@ -401,8 +401,8 @@ static int rtl8367_sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *
u32 untag = 0;
u8 fid=0;
int err;
int i;
int i;
if (!rtl8367c_is_vlan_valid(val->port_vlan))
return -EINVAL;
@@ -430,7 +430,7 @@ static int rtl8367_sw_set_vlan_ports(struct switch_dev *dev, struct switch_val *
//pr_info("[%s] vid=%d , mem=%x,untag=%x,fid=%d \n",__func__,val->port_vlan,member,untag,fid);
return rtl8367c_set_vlan(val->port_vlan, member, untag, fid);
return rtl8367c_set_vlan(val->port_vlan, member, untag, fid);
}
@@ -442,7 +442,7 @@ static int rtl8367_sw_get_port_pvid(struct switch_dev *dev, int port, int *val)
static int rtl8367_sw_set_port_pvid(struct switch_dev *dev, int port, int val)
{
{
return rtl8367c_set_pvid(port, val);
}
@@ -459,17 +459,17 @@ static int rtl8367_sw_reset_switch(struct switch_dev *dev)
static int rtl8367_sw_get_port_link(struct switch_dev *dev, int port,
struct switch_port_link *link)
{
{
int speed;
if (port >= RTL8367C_NUM_PORTS)
return -EINVAL;
if(rtl8367c_get_port_link(port,(int *)&link->link,(int *)&speed,(int *)&link->duplex))
return -EINVAL;
return -EINVAL;
if (!link->link)
return 0;
return 0;
switch (speed) {
case 0:
@@ -497,8 +497,8 @@ static struct switch_attr rtl8367_globals[] = {
.description = "Enable VLAN mode",
.set = rtl8367_sw_set_vlan_enable,
.get = rtl8367_sw_get_vlan_enable,
.max = 1,
}, {
.max = 1,
}, {
.type = SWITCH_TYPE_NOVAL,
.name = "reset_mibs",
.description = "Reset all MIB counters",
@@ -562,8 +562,8 @@ int rtl8367s_swconfig_init(void (*reset_func)(void))
int err=0;
rtl8367_switch_reset_func = reset_func ;
memset(priv, 0, sizeof(struct rtl8367_priv));
memset(priv, 0, sizeof(struct rtl8367_priv));
priv->global_vlan_enable =0;
dev->name = "RTL8367C";
@@ -571,7 +571,7 @@ int rtl8367s_swconfig_init(void (*reset_func)(void))
dev->ports = RTL8367C_NUM_PORTS;
dev->vlans = RTL8367C_NUM_VIDS;
dev->ops = &rtl8367_sw_ops;
dev->alias = "RTL8367C";
dev->alias = "RTL8367C";
err = register_switch(dev, NULL);
pr_info("[%s]\n",__func__);

View File

@@ -49,7 +49,7 @@ static void rtk_dump_mib_type(rtk_stat_port_type_t cntr_idx)
rtk_stat_port_get(port, cntr_idx, &Cntr);
printk("%8llu", Cntr);
}
printk("\n");
}
static void rtk_hal_dump_mib(void)
@@ -103,7 +103,7 @@ static void rtk_hal_dump_mib(void)
rtk_dump_mib_type(STAT_Dot3InPauseFrames);
/* clear MIB */
rtk_stat_global_reset();
}
static int rtk_hal_dump_vlan(void)
@@ -138,7 +138,7 @@ static int rtk_hal_dump_vlan(void)
EXT_PORT1) ? '1' : '-');
printk("\n");
}
return 0;
}

View File

@@ -10,7 +10,7 @@
* GNU General Public License for more details.
*
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
@@ -64,7 +64,7 @@ unsigned int mii_mgr_write(unsigned int phy_addr,unsigned int phy_register,unsig
bus->write(bus, phy_addr, phy_register, write_data);
mutex_unlock(&bus->mdio_lock);
return 0;
}
@@ -89,7 +89,7 @@ static int rtl8367s_hw_reset(void)
static int rtl8367s_vlan_config(int want_at_p0)
{
rtk_vlan_cfg_t vlan1, vlan2;
/* Set LAN/WAN VLAN partition */
memset(&vlan1, 0x00, sizeof(rtk_vlan_cfg_t));
@@ -101,7 +101,7 @@ static int rtl8367s_vlan_config(int want_at_p0)
RTK_PORTMASK_PORT_SET(vlan1.untag, UTP_PORT1);
RTK_PORTMASK_PORT_SET(vlan1.untag, UTP_PORT2);
RTK_PORTMASK_PORT_SET(vlan1.untag, UTP_PORT3);
if (want_at_p0) {
RTK_PORTMASK_PORT_SET(vlan1.mbr, UTP_PORT4);
RTK_PORTMASK_PORT_SET(vlan1.untag, UTP_PORT4);
@@ -111,11 +111,11 @@ static int rtl8367s_vlan_config(int want_at_p0)
}
vlan1.ivl_en = 1;
rtk_vlan_set(1, &vlan1);
memset(&vlan2, 0x00, sizeof(rtk_vlan_cfg_t));
RTK_PORTMASK_PORT_SET(vlan2.mbr, EXT_PORT1);
RTK_PORTMASK_PORT_SET(vlan2.untag, EXT_PORT1);
@@ -144,7 +144,7 @@ static int rtl8367s_vlan_config(int want_at_p0)
rtk_vlan_portPvid_set(UTP_PORT4, 2, 0);
}
return 0;
return 0;
}
static int rtl8367s_hw_init(void)
@@ -201,7 +201,7 @@ static void set_rtl8367s_rgmii(void)
rtk_port_macForceLinkExt_set(EXT_PORT1, mode, &mac_cfg);
rtk_port_rgmiiDelayExt_set(EXT_PORT1, 1, 3);
rtk_port_phyEnableAll_set(ENABLED);
}
void init_gsw(void)
@@ -239,9 +239,9 @@ static int rtk_gsw_probe(struct platform_device *pdev)
return -EPROBE_DEFER;
gsw = devm_kzalloc(&pdev->dev, sizeof(struct rtk_gsw), GFP_KERNEL);
if (!gsw)
return -ENOMEM;
return -ENOMEM;
gsw->dev = &pdev->dev;
@@ -263,12 +263,12 @@ static int rtk_gsw_probe(struct platform_device *pdev)
"mediatek,port_map", &pm)) {
if (!strcasecmp(pm, "wllll"))
rtl8367s_vlan_config(1);
rtl8367s_vlan_config(1);
else
rtl8367s_vlan_config(0);
} else {
#ifdef CONFIG_SWCONFIG
#ifdef CONFIG_SWCONFIG
rtl8367s_swconfig_init(&init_gsw);
#else
rtl8367s_vlan_config(0);
@@ -280,7 +280,7 @@ static int rtk_gsw_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, gsw);
return 0;
}
static void rtk_gsw_remove(struct platform_device *pdev)