[PATCH] staging: mt7621-pci: fix io space and properly set resource limits
Function 'mt7621_pci_parse_request_of_pci_ranges' is using 'of_pci_range_to_resource' to get both mem and io resources. Internally this function calls to 'pci_address_to_pio' which returns -1 if io space address is an address > IO_SPACE_LIMIT which is 0x for mips. This mt7621 soc has io space in physical address 0x1e16. In order to fix this, overwrite invalid io 0x with properly values from the device tree and set mapped address of this resource as io port base memory address calling 'set_io_port_base' function. There is also need to properly setup resource limits and io and memory windows with properly parsed values instead of set them as 'no limit' which it is wrong. For any reason I don't really know legacy driver sets up mem window as 0x and any other value seems to does not work as expected, so set up also here with same values. Signed-off-by: Sergio Paracuellos --- Io resources seems to be ok with this changes (tested on gnubee PC1): [ 16.629599] mt7621-pci-phy 1e149000.pcie-phy: Xtal is 40MHz [ 16.640715] mt7621-pci-phy 1e149000.pcie-phy: Xtal is 40MHz [ 16.651828] mt7621-pci-phy 1e14a000.pcie-phy: Xtal is 40MHz [ 16.762828] mt7621-pci 1e14.pcie: PCIE0 enabled [ 16.772546] mt7621-pci 1e14.pcie: PCIE1 enabled [ 16.782263] mt7621-pci 1e14.pcie: PCIE2 enabled [ 16.791990] mt7621-pci 1e14.pcie: PCI coherence region base: 0x6000, mask/settings: 0xf002 [ 16.810725] mt7621-pci 1e14.pcie: PCI host bridge to bus :00 [ 16.823414] pci_bus :00: root bus resource [io 0x1e16-0x1e16] [ 16.837111] pci_bus :00: root bus resource [mem 0x6000-0x6fff] [ 16.850809] pci_bus :00: root bus resource [bus 00-ff] [ 16.861797] pci :00:00.0: [0e8d:0801] type 01 class 0x060400 [ 16.873807] pci :00:00.0: reg 0x10: [mem 0x-0x7fff] [ 16.886296] pci :00:00.0: reg 0x14: [mem 0x-0x] [ 16.898867] pci :00:00.0: supports D1 [ 16.906860] pci :00:00.0: PME# supported from D0 D1 D3hot [ 16.918729] pci :00:01.0: [0e8d:0801] type 01 class 0x060400 [ 16.930741] pci :00:01.0: reg 0x10: [mem 0x-0x7fff] [ 16.943239] pci :00:01.0: reg 0x14: [mem 0x-0x] [ 16.955795] pci :00:01.0: supports D1 [ 16.963790] pci :00:01.0: PME# supported from D0 D1 D3hot [ 16.975590] pci :00:02.0: [0e8d:0801] type 01 class 0x060400 [ 16.987596] pci :00:02.0: reg 0x10: [mem 0x-0x7fff] [ 17.88] pci :00:02.0: reg 0x14: [mem 0x-0x] [ 17.012642] pci :00:02.0: supports D1 [ 17.020634] pci :00:02.0: PME# supported from D0 D1 D3hot [ 17.033310] pci :00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring [ 17.049284] pci :00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring [ 17.065236] pci :00:02.0: bridge configuration invalid ([bus 00-00]), reconfiguring [ 17.081408] pci :01:00.0: [1b21:0611] type 00 class 0x010185 [ 17.093429] pci :01:00.0: reg 0x10: [io 0x-0x0007] [ 17.104544] pci :01:00.0: reg 0x14: [io 0x-0x0003] [ 17.115655] pci :01:00.0: reg 0x18: [io 0x-0x0007] [ 17.126767] pci :01:00.0: reg 0x1c: [io 0x-0x0003] [ 17.137877] pci :01:00.0: reg 0x20: [io 0x-0x000f] [ 17.148991] pci :01:00.0: reg 0x24: [mem 0x-0x01ff] [ 17.161627] pci :01:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s x1 link at :00:00.0 (capable of 4.000 Gb/s with 5 GT/s x1 link) [ 17.190393] pci :00:00.0: PCI bridge to [bus 01-ff] [ 17.200842] pci :00:00.0: bridge window [io 0x-0x0fff] [ 17.212985] pci :00:00.0: bridge window [mem 0x-0x000f] [ 17.226512] pci :00:00.0: bridge window [mem 0x-0x000f pref] [ 17.240905] pci_bus :01: busn_res: [bus 01-ff] end is updated to 01 [ 17.254335] pci :02:00.0: [1b21:0611] type 00 class 0x010185 [ 17.266360] pci :02:00.0: reg 0x10: [io 0x-0x0007] [ 17.277472] pci :02:00.0: reg 0x14: [io 0x-0x0003] [ 17.288584] pci :02:00.0: reg 0x18: [io 0x-0x0007] [ 17.299695] pci :02:00.0: reg 0x1c: [io 0x-0x0003] [ 17.310806] pci :02:00.0: reg 0x20: [io 0x-0x000f] [ 17.321917] pci :02:00.0: reg 0x24: [mem 0x-0x01ff] [ 17.334555] pci :02:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s x1 link at :00:01.0 (capable of 4.000 Gb/s with 5 GT/s x1 link) [ 17.363326] pci :00:01.0: PCI bridge to [bus 02-ff] [ 17.373781] pci :00:01.0: bridge window [io 0x-0x0fff] [ 17.385922] pci :00:01.0: bridge window [mem 0x-0x000f] [ 17.399445] pci :00:01.0: bridge window [mem 0x-0x000f pref] [ 17.413838] pci_bus :02: busn_res: [bus 02-ff] end is updated to 02 [ 17.427246] pci :03:00.0: [1b21:0611] type 00 class 0x010185 [ 17.43
Re: [PATCH] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size
On Tue, Mar 17, 2020 at 01:45:06PM +0300, Dan Carpenter wrote: > On Sat, Mar 14, 2020 at 05:47:54PM +0100, Oscar Carter wrote: > > Use ARRAY_SIZE to replace the hardcoded size so we will never have a > > mismatch. > > > > Signed-off-by: Oscar Carter > > --- > > drivers/staging/vt6656/main_usb.c | 8 +--- > > 1 file changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/staging/vt6656/main_usb.c > > b/drivers/staging/vt6656/main_usb.c > > index 5e48b3ddb94c..4370941ffc04 100644 > > --- a/drivers/staging/vt6656/main_usb.c > > +++ b/drivers/staging/vt6656/main_usb.c > > @@ -23,6 +23,7 @@ > > > > #include > > #include > > +#include > > #include "device.h" > > #include "card.h" > > #include "baseband.h" > > @@ -116,6 +117,7 @@ static int vnt_init_registers(struct vnt_private *priv) > > int ii; > > u8 tmp; > > u8 calib_tx_iq = 0, calib_tx_dc = 0, calib_rx_iq = 0; > > + const int n_cck_pwr_tbl = ARRAY_SIZE(priv->cck_pwr_tbl); > > Please use ARRAY_SIZE(priv->cck_pwr_tbl) everywhere instead of > introducing this new variable. > Ok, I create a new version of the patch and I resend it. > regards, > dan carpenter > thanks, oscar carter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size
Use ARRAY_SIZE to replace the hardcoded size so we will never have a mismatch. Signed-off-by: Oscar Carter --- Changelog v1 -> v2 - Use ARRAY_SIZE(priv->cck_pwr_tbl) everywhere instead of introducing a new variable to hold its value. drivers/staging/vt6656/main_usb.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index 5e48b3ddb94c..acfcc11c3b61 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -23,6 +23,7 @@ #include #include +#include #include "device.h" #include "card.h" #include "baseband.h" @@ -145,7 +146,7 @@ static int vnt_init_registers(struct vnt_private *priv) init_cmd->init_class = DEVICE_INIT_COLD; init_cmd->exist_sw_net_addr = priv->exist_sw_net_addr; - for (ii = 0; ii < 6; ii++) + for (ii = 0; ii < ARRAY_SIZE(init_cmd->sw_net_addr); ii++) init_cmd->sw_net_addr[ii] = priv->current_net_addr[ii]; init_cmd->short_retry_limit = priv->short_retry_limit; init_cmd->long_retry_limit = priv->long_retry_limit; @@ -184,7 +185,7 @@ static int vnt_init_registers(struct vnt_private *priv) priv->cck_pwr = priv->eeprom[EEP_OFS_PWR_CCK]; priv->ofdm_pwr_g = priv->eeprom[EEP_OFS_PWR_OFDMG]; /* load power table */ - for (ii = 0; ii < 14; ii++) { + for (ii = 0; ii < ARRAY_SIZE(priv->cck_pwr_tbl); ii++) { priv->cck_pwr_tbl[ii] = priv->eeprom[ii + EEP_OFS_CCK_PWR_TBL]; if (priv->cck_pwr_tbl[ii] == 0) @@ -200,7 +201,7 @@ static int vnt_init_registers(struct vnt_private *priv) * original zonetype is USA, but custom zonetype is Europe, * then need to recover 12, 13, 14 channels with 11 channel */ - for (ii = 11; ii < 14; ii++) { + for (ii = 11; ii < ARRAY_SIZE(priv->cck_pwr_tbl); ii++) { priv->cck_pwr_tbl[ii] = priv->cck_pwr_tbl[10]; priv->ofdm_pwr_tbl[ii] = priv->ofdm_pwr_tbl[10]; } -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[staging:staging-linus] BUILD SUCCESS 14800df6a020d38847fec77ac5a43dc221e5edfc
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-linus branch HEAD: 14800df6a020d38847fec77ac5a43dc221e5edfc Merge tag 'iio-fixes-for-5.6a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus elapsed time: 480m configs tested: 164 configs skipped: 0 The following configs have been built successfully. More configs may be tested in the coming days. arm allmodconfig arm allnoconfig arm allyesconfig arm64allmodconfig arm64 allnoconfig arm64allyesconfig arm efm32_defconfig arm at91_dt_defconfig armshmobile_defconfig arm64 defconfig arm exynos_defconfig armmulti_v5_defconfig arm sunxi_defconfig armmulti_v7_defconfig sparcallyesconfig nios2 3c120_defconfig s390 allmodconfig i386 alldefconfig i386 allnoconfig mips allyesconfig arc allyesconfig nios2 10m50_defconfig sh rsk7269_defconfig shtitan_defconfig riscvnommu_virt_defconfig ia64 alldefconfig s390 debug_defconfig alpha defconfig m68k allmodconfig i386 allyesconfig i386defconfig ia64 allmodconfig ia64defconfig ia64 allnoconfig ia64 allyesconfig c6xevmc6678_defconfig xtensa iss_defconfig c6x allyesconfig xtensa common_defconfig openrisc simple_smp_defconfig openriscor1ksim_defconfig cskydefconfig nds32 allnoconfig nds32 defconfig h8300 edosk2674_defconfig h8300h8300h-sim_defconfig h8300 h8s-sim_defconfig m68k m5475evb_defconfig m68k multi_defconfig m68k sun3_defconfig arc defconfig microblaze mmu_defconfig microblazenommu_defconfig powerpc allnoconfig powerpc defconfig powerpc ppc64_defconfig powerpc rhel-kconfig mips 32r2_defconfig mips 64r6el_defconfig mips allmodconfig mips allnoconfig mips fuloong2e_defconfig mips malta_kvm_defconfig pariscallnoconfig parisc allyesconfig pariscgeneric-32bit_defconfig pariscgeneric-64bit_defconfig x86_64 randconfig-a001-20200318 x86_64 randconfig-a002-20200318 x86_64 randconfig-a003-20200318 i386 randconfig-a001-20200318 i386 randconfig-a002-20200318 i386 randconfig-a003-20200318 riscvrandconfig-a001-20200318 m68k randconfig-a001-20200318 nds32randconfig-a001-20200318 alpharandconfig-a001-20200318 parisc randconfig-a001-20200318 mips randconfig-a001-20200318 c6x randconfig-a001-20200318 h8300randconfig-a001-20200318 microblaze randconfig-a001-20200318 nios2randconfig-a001-20200318 sparc64 randconfig-a001-20200318 csky randconfig-a001-20200318 openrisc randconfig-a001-20200318 s390 randconfig-a001-20200318 sh randconfig-a001-20200318 xtensa randconfig-a001-20200318 x86_64 randconfig-b001-20200318 x86_64 randconfig-b002-20200318 x86_64 randconfig-b003-20200318 i386 randconfig-b001-20200318 i386 randconfig-b002-20200318 i386 randconfig-b003-20200318 x86_64 randconfig-c001-20200318 x86_64 randconfig-c002-20200318 x86_64 randconfig-c003-20200318 i386 randconfig-c001-202
[staging:staging-testing] BUILD SUCCESS 281d90e24f1378967531d715decf6b81ecba664e
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing branch HEAD: 281d90e24f1378967531d715decf6b81ecba664e Merge tag 'iio-5.7a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next elapsed time: 485m configs tested: 164 configs skipped: 0 The following configs have been built successfully. More configs may be tested in the coming days. arm allmodconfig arm allnoconfig arm allyesconfig arm64allmodconfig arm64 allnoconfig arm64allyesconfig arm at91_dt_defconfig arm efm32_defconfig arm exynos_defconfig armmulti_v5_defconfig armmulti_v7_defconfig armshmobile_defconfig arm sunxi_defconfig arm64 defconfig sparcallyesconfig xtensa iss_defconfig nios2 10m50_defconfig sh rsk7269_defconfig shtitan_defconfig i386 allnoconfig i386 alldefconfig i386 allyesconfig i386defconfig ia64 alldefconfig ia64 allmodconfig ia64 allnoconfig ia64 allyesconfig ia64defconfig nios2 3c120_defconfig c6xevmc6678_defconfig c6x allyesconfig xtensa common_defconfig openrisc simple_smp_defconfig openriscor1ksim_defconfig alpha defconfig cskydefconfig nds32 allnoconfig nds32 defconfig h8300 edosk2674_defconfig h8300h8300h-sim_defconfig h8300 h8s-sim_defconfig m68k allmodconfig m68k m5475evb_defconfig m68k multi_defconfig m68k sun3_defconfig arc allyesconfig arc defconfig microblaze mmu_defconfig microblazenommu_defconfig powerpc allnoconfig powerpc defconfig powerpc ppc64_defconfig powerpc rhel-kconfig mips fuloong2e_defconfig mips malta_kvm_defconfig mips 32r2_defconfig mips 64r6el_defconfig mips allmodconfig mips allnoconfig mips allyesconfig pariscallnoconfig parisc allyesconfig pariscgeneric-32bit_defconfig pariscgeneric-64bit_defconfig x86_64 randconfig-a001-20200318 x86_64 randconfig-a002-20200318 x86_64 randconfig-a003-20200318 i386 randconfig-a001-20200318 i386 randconfig-a002-20200318 i386 randconfig-a003-20200318 riscvrandconfig-a001-20200318 m68k randconfig-a001-20200318 nds32randconfig-a001-20200318 alpharandconfig-a001-20200318 parisc randconfig-a001-20200318 mips randconfig-a001-20200318 c6x randconfig-a001-20200318 h8300randconfig-a001-20200318 microblaze randconfig-a001-20200318 nios2randconfig-a001-20200318 sparc64 randconfig-a001-20200318 csky randconfig-a001-20200318 openrisc randconfig-a001-20200318 s390 randconfig-a001-20200318 sh randconfig-a001-20200318 xtensa randconfig-a001-20200318 x86_64 randconfig-b001-20200318 x86_64 randconfig-b002-20200318 i386 randconfig-b001-20200318 x86_64 randconfig-b003-20200318 i386 randconfig-b002-20200318 i386 randconfig-b003-20200318 x86_64 randconfig-c001-20200318 x86_64 randconfig-c002-20200318 x86_64 randconfig-c003-20200318 i386 randconfig-c001-20200318 i386 randconfig-c002-20200318 i386 randconfig-c003-20200318 x86_64 randconfig-d001-20200318 x86_64
Consulta
Consulta ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Consulta Marzo 2020
Buenos días Os informamos que se encuentra abierto el plazo de inscripción para la presente Convocatoria de Cursos Bonificables E- Learning para empleados (Marzo 2020) Todos los cursos son totalmente Bonificables con cargo al Crédito de Formación 2020 que disponen las empresas. Deseáis que os mandemos la información? Saludos. Alex Pons Director departamento formación. FOESCO Formación Estatal Continua. Entidad Organizadora: B171823AP www.foesco.com e-mail: cur...@foesco.net Tel: 910 323 794 (Horario de 9h a 15h y de 17h a 20h de Lunes a Viernes) FOESCO ofrece formación a empresas y trabajadores en activo a través de cursos bonificados por la Fundación Estatal para la Formación en el Empleo (antiguo FORCEM) que gestiona las acciones formativas de FORMACIÓN CONTINUA para trabajadores y se rige por la ley 30/2015 de 9 de Septiembre. Si no desea recibir mas información de FOESCO responda a este correo con la palabra BAJA en el asunto. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: rtl8192u: Corrects 'Avoid CamelCase' for variables
The variables of function setKey triggered a 'Avoid CamelCase' warning from checkpatch.pl. This patch renames these variables to correct this warning. Signed-off-by: Camylla Goncalves Cantanheide --- drivers/staging/rtl8192u/r8192U_core.c | 52 +- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 93a15d57e..3aa87296d 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -4877,50 +4877,50 @@ void EnableHWSecurityConfig8192(struct net_device *dev) write_nic_byte(dev, SECR, SECR_value); } -void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, - u8 *MacAddr, u8 DefaultKey, u32 *KeyContent) +void setKey(struct net_device *dev, u8 entry_no, u8 key_idx, u16 key_type, + u8 *mac_addr, u8 default_key, u32 *key_content) { - u32 TargetCommand = 0; - u32 TargetContent = 0; - u16 usConfig = 0; + u32 target_cmd = 0; + u32 content = 0; + u16 config = 0; u8 i; - if (EntryNo >= TOTAL_CAM_ENTRY) + if (entry_no >= TOTAL_CAM_ENTRY) RT_TRACE(COMP_ERR, "cam entry exceeds in %s\n", __func__); RT_TRACE(COMP_SEC, ">to %s, dev:%p, EntryNo:%d, KeyIndex:%d, KeyType:%d, MacAddr%pM\n", -__func__, dev, EntryNo, KeyIndex, KeyType, MacAddr); +__func__, dev, entry_no, key_idx, key_type, mac_addr); - if (DefaultKey) - usConfig |= BIT(15) | (KeyType << 2); + if (default_key) + config |= BIT(15) | (key_type << 2); else - usConfig |= BIT(15) | (KeyType << 2) | KeyIndex; + config |= BIT(15) | (key_type << 2) | key_idx; for (i = 0; i < CAM_CONTENT_COUNT; i++) { - TargetCommand = i + CAM_CONTENT_COUNT * EntryNo; - TargetCommand |= BIT(31) | BIT(16); + target_cmd = i + CAM_CONTENT_COUNT * entry_no; + target_cmd |= BIT(31) | BIT(16); if (i == 0) { /* MAC|Config */ - TargetContent = (u32)(*(MacAddr + 0)) << 16 | - (u32)(*(MacAddr + 1)) << 24 | - (u32)usConfig; + content = (u32)(*(mac_addr + 0)) << 16 | + (u32)(*(mac_addr + 1)) << 24 | + (u32)config; - write_nic_dword(dev, WCAMI, TargetContent); - write_nic_dword(dev, RWCAM, TargetCommand); + write_nic_dword(dev, WCAMI, content); + write_nic_dword(dev, RWCAM, target_cmd); } else if (i == 1) { /* MAC */ - TargetContent = (u32)(*(MacAddr + 2))| - (u32)(*(MacAddr + 3)) << 8 | - (u32)(*(MacAddr + 4)) << 16 | - (u32)(*(MacAddr + 5)) << 24; - write_nic_dword(dev, WCAMI, TargetContent); - write_nic_dword(dev, RWCAM, TargetCommand); + content = (u32)(*(mac_addr + 2)) | + (u32)(*(mac_addr + 3)) << 8 | + (u32)(*(mac_addr + 4)) << 16 | + (u32)(*(mac_addr + 5)) << 24; + write_nic_dword(dev, WCAMI, content); + write_nic_dword(dev, RWCAM, target_cmd); } else { /* Key Material */ - if (KeyContent) { + if (key_content) { write_nic_dword(dev, WCAMI, - *(KeyContent + i - 2)); - write_nic_dword(dev, RWCAM, TargetCommand); + *(key_content + i - 2)); + write_nic_dword(dev, RWCAM, target_cmd); } } } -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[driver-core:driver-core-testing] BUILD SUCCESS 8ba88804bb3b877c841bc1864a8605111580cd0b
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-testing branch HEAD: 8ba88804bb3b877c841bc1864a8605111580cd0b drivers: base: power: wakeup.c: Use built-in RCU list checking elapsed time: 483m configs tested: 163 configs skipped: 0 The following configs have been built successfully. More configs may be tested in the coming days. arm allmodconfig arm allnoconfig arm allyesconfig arm64allmodconfig arm64 allnoconfig arm64allyesconfig arm at91_dt_defconfig arm efm32_defconfig arm exynos_defconfig armmulti_v5_defconfig armmulti_v7_defconfig armshmobile_defconfig arm sunxi_defconfig arm64 defconfig sparcallyesconfig i386 allnoconfig i386 allyesconfig i386 alldefconfig i386defconfig ia64 allmodconfig ia64defconfig ia64 allnoconfig ia64 allyesconfig ia64 alldefconfig nios2 3c120_defconfig nios2 10m50_defconfig c6xevmc6678_defconfig xtensa iss_defconfig c6x allyesconfig xtensa common_defconfig openrisc simple_smp_defconfig openriscor1ksim_defconfig nds32 defconfig nds32 allnoconfig cskydefconfig alpha defconfig h8300 edosk2674_defconfig h8300h8300h-sim_defconfig h8300 h8s-sim_defconfig m68k allmodconfig m68k m5475evb_defconfig m68k multi_defconfig m68k sun3_defconfig arc allyesconfig arc defconfig microblaze mmu_defconfig microblazenommu_defconfig powerpc allnoconfig powerpc defconfig powerpc ppc64_defconfig powerpc rhel-kconfig mips 32r2_defconfig mips 64r6el_defconfig mips allmodconfig mips allnoconfig mips allyesconfig mips fuloong2e_defconfig mips malta_kvm_defconfig pariscallnoconfig parisc allyesconfig pariscgeneric-32bit_defconfig pariscgeneric-64bit_defconfig x86_64 randconfig-a001-20200318 x86_64 randconfig-a002-20200318 x86_64 randconfig-a003-20200318 i386 randconfig-a001-20200318 i386 randconfig-a002-20200318 i386 randconfig-a003-20200318 alpharandconfig-a001-20200318 m68k randconfig-a001-20200318 mips randconfig-a001-20200318 nds32randconfig-a001-20200318 parisc randconfig-a001-20200318 riscvrandconfig-a001-20200318 c6x randconfig-a001-20200318 h8300randconfig-a001-20200318 microblaze randconfig-a001-20200318 nios2randconfig-a001-20200318 sparc64 randconfig-a001-20200318 csky randconfig-a001-20200318 openrisc randconfig-a001-20200318 s390 randconfig-a001-20200318 sh randconfig-a001-20200318 xtensa randconfig-a001-20200318 x86_64 randconfig-b001-20200318 x86_64 randconfig-b002-20200318 x86_64 randconfig-b003-20200318 i386 randconfig-b001-20200318 i386 randconfig-b002-20200318 i386 randconfig-b003-20200318 x86_64 randconfig-c001-20200318 x86_64 randconfig-c002-20200318 x86_64 randconfig-c003-20200318 i386 randconfig-c001-20200318 i386 randconfig-c002-20200318 i386 randconfig-c003-20200318 x86_64 randconfig-d001-20200318 i386 randconfig-d001-20200318 i386 randconfig-d003-20200318 i386 randconfig-d002-20200318 x86_64
Re: [PATCH 2/2] staging: rtl8192u: Corrects 'Avoid CamelCase' for variables
On Wed, 2020-03-18 at 14:31 -0300, Camylla Cantanheide wrote: > Dear Dan Carpenter and Joe Perches, > > Thank you very much for the suggestions, I found the evaluation of both > very significant. Now, I have another perspective on variables. > > I solved the problem for the *setKey *function, however, when executing the > checkpatch, more *Checks* of the same type appeared. > > Should I send the second version of the patch, only to the *setKey* > function or do I resolve all *Checks* for the entire file? A single patch refactoring the function would be fine. Also perhaps a name change as a separate patch later as setKey is a relatively generic name and not obviously specific to the rtl8192u.. Perhaps a first refactoring patch like the below then a renaming one. (untested) --- drivers/staging/rtl8192u/r8192U_core.c | 50 -- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 89dd1fb..0c0cb08 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -4880,7 +4880,7 @@ void EnableHWSecurityConfig8192(struct net_device *dev) void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, u8 *MacAddr, u8 DefaultKey, u32 *KeyContent) { - u32 TargetCommand = 0; + u32 TargetCommand = CAM_CONTENT_COUNT * EntryNo | BIT(31) | BIT(16); u32 TargetContent = 0; u16 usConfig = 0; u8 i; @@ -4897,32 +4897,28 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, else usConfig |= BIT(15) | (KeyType << 2) | KeyIndex; - for (i = 0; i < CAM_CONTENT_COUNT; i++) { - TargetCommand = i + CAM_CONTENT_COUNT * EntryNo; - TargetCommand |= BIT(31) | BIT(16); - - if (i == 0) { /* MAC|Config */ - TargetContent = (u32)(*(MacAddr + 0)) << 16 | - (u32)(*(MacAddr + 1)) << 24 | - (u32)usConfig; - - write_nic_dword(dev, WCAMI, TargetContent); - write_nic_dword(dev, RWCAM, TargetCommand); - } else if (i == 1) { /* MAC */ - TargetContent = (u32)(*(MacAddr + 2))| - (u32)(*(MacAddr + 3)) << 8 | - (u32)(*(MacAddr + 4)) << 16 | - (u32)(*(MacAddr + 5)) << 24; - write_nic_dword(dev, WCAMI, TargetContent); - write_nic_dword(dev, RWCAM, TargetCommand); - } else { - /* Key Material */ - if (KeyContent) { - write_nic_dword(dev, WCAMI, - *(KeyContent + i - 2)); - write_nic_dword(dev, RWCAM, TargetCommand); - } - } + TargetContent = MacAddr[0] << 16 | + MacAddr[0] << 24 | + (u32)usConfig; + + write_nic_dword(dev, WCAMI, TargetContent); + write_nic_dword(dev, RWCAM, TargetCommand++); + +/* MAC */ + TargetContent = MacAddr[2] | + MacAddr[3] << 8 | + MacAddr[4] << 16 | + MacAddr[5] << 24; + write_nic_dword(dev, WCAMI, TargetContent); + write_nic_dword(dev, RWCAM, TargetCommand++); + + /* Key Material */ + if (!KeyContent) + return; + + for (i = 2; i < CAM_CONTENT_COUNT; i++) { + write_nic_dword(dev, WCAMI, *KeyContent++); + write_nic_dword(dev, RWCAM, TargetCommand++); } } ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: rtl8192u: Corrects 'Avoid CamelCase' for variables
On Wed, 2020-03-18 at 21:12 +, Camylla Goncalves Cantanheide wrote: > The variables of function setKey triggered a 'Avoid CamelCase' > warning from checkpatch.pl. This patch renames these > variables to correct this warning. Please always try to improve the code for humans to read over correcting mindless checkpatch messages. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel