Your Response Needed

2018-12-18 Thread Alfredo Gomez
Dear Sir/Madam,

My Names are Mr.Alfredo Gomez. I am the Administrative manager at a vault 
financial & security Institution here in Madrid. I am contacting you based on a 
financial opportunity I discovered here in my organization. It's about an 
abandoned sum of 25,000,000.00 million US dollars (Twenty five million  United 
State dollars) in a dormant account with our bank and I have been following and 
monitoring this account since the year 2004 when I was appointed the 
Administrative manager of this financial institutions.

The Banking policy can only allow the release of such funds to a benefactor 
through an application as a beneficiary to the account deposit. For the past 
years, the bank has been expecting a possible beneficiary, but no luck, this 
institution has exploited all its ethical possibilities in other to contact the 
possible beneficiaries or inheritors of the account, but to no success since 
nobody has come over for the claim of the funds for the past 10 years.

I have made my own research with the help of a private investigator, it is my 
knowledge that the account has been dormant for the past 17 years. I also 
learnt that, there have not been any movement on the said account within this 
period. I am 100% sure that no one is aware of the existence of these funds.

However, because of the international financial crises, a lot of reform has 
been made within the Spanish financial system, this includes the new law on 
succession of claims which indicates a duration in which such deposit account 
could be tolerated.

The Bank of Spain has mandated our institution to release the funds to a 
possible beneficiary WITHIN A PERIOD OF 1 YEAR. Failure to respond to this 
ultimatum would legally allow the Bank of Spain to confiscate the funds as 
unclaimed funds (Which of course would go straight to the Government's pocket). 
It is therefore upon this entire discovery that I have decided to contact you 
for your kind cooperation.

I want you to know that I am a senior member of this office. As an insider, I 
am equipped with all classified secret information regarding the release of 
these funds. I would dedicate to make sure that I feed you with all possible 
documentation and information required for the approval and release of these 
funds to you.

Upon your acceptance to cooperate, I agree that 40% of this money will be for 
you, 50% for me and 10% goes for the reimbursement of any expenses that we 
might both incur during the short period of the funds transaction. Please note 
that I have ONLY discussed this issue with you alone.

Immediately you acknowledge the receipt of this mail, we shall further proceed 
and you shall be informed on the next step to urge ahead. In conclusion, it's 
my concern to demand your ultimate honesty, co-operation and confidentiality to 
enable us conclude this transaction.  

I fully assured you that this process would be executed under a legitimate 
arrangement that would legally protect you from any breach of law. 

Reply to my private e-mail: alfredogomez9...@outlook.com

With due cooperation, I wait to read from you soon.

Regards,

Mr.Alfredo Gomez
Telephone: +34 612 432 655
Fax:
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 1/3] staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP

2018-12-18 Thread Johan Hovold
On Thu, Nov 22, 2018 at 10:37:16PM +0530, Nishad Kamdar wrote:
> Convert the GPIO driver to use the GPIO irqchip library
> GPIOLIB_IRQCHIP instead of reimplementing the same.
> 
> Signed-off-by: Nishad Kamdar 
> ---
> Changes in v2:
>  - Retained irq.h and irqdomain.h headers.
>  - Dropped function gb_gpio_irqchip_add() and
>called gpiochip_irqchip_add() from probe().
>  - Referred 
> https://lkml.kernel.org/r/1476054589-28422-1-git-send-email-linus.wall...@linaro.org.

Thanks for the update, and sorry about the late review. This looks
mostly good now, except for a couple minor things pointed out below.

You also included the conversion to gpiochip_get_data() (as Linus also
did in his patch) although that's really a separate change and should go
in its own patch. Please break that bit out in a follow-up patch.

Also note that someone did a bunch random white space changes to this
file in the staging tree, so it will not apply cleanly any more.

> ---
>  drivers/staging/greybus/Kconfig |   1 +
>  drivers/staging/greybus/gpio.c  | 184 
>  2 files changed, 24 insertions(+), 161 deletions(-)
> 
> diff --git a/drivers/staging/greybus/Kconfig b/drivers/staging/greybus/Kconfig
> index ab096bcef98c..b571e4e8060b 100644
> --- a/drivers/staging/greybus/Kconfig
> +++ b/drivers/staging/greybus/Kconfig
> @@ -148,6 +148,7 @@ if GREYBUS_BRIDGED_PHY
>  config GREYBUS_GPIO
>   tristate "Greybus GPIO Bridged PHY driver"
>   depends on GPIOLIB
> + select GPIOLIB_IRQCHIP
>   ---help---
> Select this option if you have a device that follows the
> Greybus GPIO Bridged PHY Class specification.
> diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
> index b1d4698019a1..2ec54744171d 100644
> --- a/drivers/staging/greybus/gpio.c
> +++ b/drivers/staging/greybus/gpio.c
> @@ -9,9 +9,9 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  #include "greybus.h"
> @@ -39,15 +39,8 @@ struct gb_gpio_controller {
>  
>   struct gpio_chipchip;
>   struct irq_chip irqc;

Turns out struct gpio_chip will have an irqchip whenever
CONFIG_GPIOLIB_IRQCHIP is selected so you can drop this one too.

> - struct irq_chip *irqchip;
> - struct irq_domain   *irqdomain;
> - unsigned intirq_base;
> - irq_flow_handler_t  irq_handler;
> - unsigned intirq_default_type;
>   struct mutexirq_lock;
>  };
> -#define gpio_chip_to_gb_gpio_controller(chip) \
> - container_of(chip, struct gb_gpio_controller, chip)
>  #define irq_data_to_gpio_chip(d) (d->domain->host_data)
>  
>  static int gb_gpio_line_count_operation(struct gb_gpio_controller *ggc)
> @@ -276,7 +269,7 @@ static void _gb_gpio_irq_set_type(struct 
> gb_gpio_controller *ggc,
>  static void gb_gpio_irq_mask(struct irq_data *d)
>  {
>   struct gpio_chip *chip = irq_data_to_gpio_chip(d);
> - struct gb_gpio_controller *ggc = gpio_chip_to_gb_gpio_controller(chip);
> + struct gb_gpio_controller *ggc = gpiochip_get_data(chip);

So please split these changes into a separate patch as they are not
related to the irqchip changes.

Oh, and don't forget to update the TODO file now that the conversion is
done. :)

Thanks,
Johan
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] comedi/ni_pcidio: make all defines uppercase

2018-12-18 Thread Ian Abbott

On 17/12/2018 20:51, Alexander Schroth wrote:

According to the Linux coding guidelines, defines should be written
in uppercase. This patch converts all define-statements in the
ni_pcidio.c file to uppercase, thus matching the coding style of the
kernel.

Signed-off-by: Alexander Schroth 
Signed-off-by: Marco Ammon 
---


Minor quibble: There should be a description of the 'v2' changes here 
(after the '---' line).


Also, the patch "Subject:" line is missing the "staging:" tag.  The 
usual set of tags for patches to this driver is "staging: comedi: 
ni_pcidio:".


Apart from that, the patch seems fine.

Reviewed-by: Ian Abbott 


  drivers/staging/comedi/drivers/ni_pcidio.c | 442 +++--
  1 file changed, 222 insertions(+), 220 deletions(-)


--
-=( Ian Abbott  || Web: www.mev.co.uk )=-
-=( MEV Ltd. is a company registered in England & Wales. )=-
-=( Registered number: 02862268.  Registered address:)=-
-=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=-
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 2/3] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface

2018-12-18 Thread Johan Hovold
On Thu, Nov 22, 2018 at 10:38:18PM +0530, Nishad Kamdar wrote:
> Use the gpiod interface instead of the deprecated old non-descriptor
> interface.
> 
> Signed-off-by: Nishad Kamdar 
> ---
> Changes in v2:
>  - Resolved compilation errors.
> ---
>  drivers/staging/greybus/arche-apb-ctrl.c | 159 +--
>  1 file changed, 65 insertions(+), 94 deletions(-)
> 
> diff --git a/drivers/staging/greybus/arche-apb-ctrl.c 
> b/drivers/staging/greybus/arche-apb-ctrl.c
> index be5ffed90bcf..e887f6aee20b 100644
> --- a/drivers/staging/greybus/arche-apb-ctrl.c
> +++ b/drivers/staging/greybus/arche-apb-ctrl.c
> @@ -8,9 +8,8 @@
>  
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
> @@ -24,12 +23,12 @@ static void apb_bootret_deassert(struct device *dev);
>  
>  struct arche_apb_ctrl_drvdata {
>   /* Control GPIO signals to and from AP <=> AP Bridges */
> - int resetn_gpio;
> - int boot_ret_gpio;
> - int pwroff_gpio;
> - int wake_in_gpio;
> - int wake_out_gpio;
> - int pwrdn_gpio;
> + struct gpio_desc *resetn;
> + struct gpio_desc *boot_ret;
> + struct gpio_desc *pwroff;
> + struct gpio_desc *wake_in;
> + struct gpio_desc *wake_out;
> + struct gpio_desc *pwrdn;
>  
>   enum arche_platform_state state;
>   bool init_disabled;
> @@ -37,28 +36,28 @@ struct arche_apb_ctrl_drvdata {
>   struct regulator *vcore;
>   struct regulator *vio;
>  
> - int clk_en_gpio;
> + struct gpio_desc *clk_en;
>   struct clk *clk;
>  
>   struct pinctrl *pinctrl;
>   struct pinctrl_state *pin_default;
>  
>   /* V2: SPI Bus control  */
> - int spi_en_gpio;
> + struct gpio_desc *spi_en;
>   bool spi_en_polarity_high;
>  };
>  
>  /*
>   * Note that these low level api's are active high
>   */
> -static inline void deassert_reset(unsigned int gpio)
> +static inline void deassert_reset(struct gpio_desc *gpio)
>  {
> - gpio_set_value(gpio, 1);
> + gpiod_set_value(gpio, 1);
>  }
>  
> -static inline void assert_reset(unsigned int gpio)
> +static inline void assert_reset(struct gpio_desc *gpio)
>  {
> - gpio_set_value(gpio, 0);
> + gpiod_set_value(gpio, 0);
>  }

As the comment above deassert_reset() suggests, this change will
actually change the semantics of these calls by taking any gpio flags
into account (e.g. ACTIVE_LOW which will invert the signals).

Perhaps you should just use gpiod_set_raw_value() for now, and this can
be addressed later. Alternatively, drop the comment and invert the
polarity here and any users will need to update their device trees.

Either way, mention this in the commit message.

>  /*
> @@ -75,11 +74,11 @@ static int coldboot_seq(struct platform_device *pdev)
>   return 0;
>  
>   /* Hold APB in reset state */
> - assert_reset(apb->resetn_gpio);
> + assert_reset(apb->resetn);
>  
>   if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING &&
> - gpio_is_valid(apb->spi_en_gpio))
> - devm_gpio_free(dev, apb->spi_en_gpio);
> + apb->spi_en)

No need to break the line any more.

> + devm_gpiod_put(dev, apb->spi_en);
>  
>   /* Enable power to APB */
>   if (!IS_ERR(apb->vcore)) {
> @@ -101,13 +100,13 @@ static int coldboot_seq(struct platform_device *pdev)
>   apb_bootret_deassert(dev);
>  
>   /* On DB3 clock was not mandatory */
> - if (gpio_is_valid(apb->clk_en_gpio))
> - gpio_set_value(apb->clk_en_gpio, 1);
> + if (apb->clk_en)
> + gpiod_set_value(apb->clk_en, 1);
>  
>   usleep_range(100, 200);
>  
>   /* deassert reset to APB : Active-low signal */
> - deassert_reset(apb->resetn_gpio);
> + deassert_reset(apb->resetn);
>  
>   apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
>  
> @@ -119,6 +118,7 @@ static int fw_flashing_seq(struct platform_device *pdev)
>   struct device *dev = &pdev->dev;
>   struct arche_apb_ctrl_drvdata *apb = platform_get_drvdata(pdev);
>   int ret;
> + unsigned long flags;
>  
>   if (apb->init_disabled ||
>   apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING)
> @@ -136,25 +136,20 @@ static int fw_flashing_seq(struct platform_device *pdev)
>   return ret;
>   }
>  
> - if (gpio_is_valid(apb->spi_en_gpio)) {

spi_en_gpio is currently optional, so cannot just drop the check.

> - unsigned long flags;
> + if (apb->spi_en_polarity_high)
> + flags = GPIOD_OUT_HIGH;
> + else
> + flags = GPIOD_OUT_LOW;

This should probably also be converted to honouring the gpio flags, but
perhaps better to do in a later patch.

>  
> - if (apb->spi_en_polarity_high)
> - flags = GPIOF_OUT_INIT_HIGH;
> - else
> - flags = GPIOF_OUT_INIT_LOW;
> -
> - ret = devm_gpio_request_one(dev, apb->spi_en_gpio,
> - 

[PATCH][next] staging: most: sound: replace snprintf with strscpy

2018-12-18 Thread Colin King
From: Colin Ian King 

Using snprintf without a format specifier is potentially risky if
the string device_name contains format specifiers. Replace this with
the safer and more efficient strscpy.

Cleans up clang warning:
drivers/staging/most/sound/sound.c:673:41: warning: format string is not
a string literal (potentially insecure) [-Wformat-security]

Signed-off-by: Colin Ian King 
---
 drivers/staging/most/sound/sound.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/sound/sound.c 
b/drivers/staging/most/sound/sound.c
index 29a4c72e6357..ccabf5922a73 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -670,7 +670,7 @@ static int audio_probe_channel(struct most_interface 
*iface, int channel_id,
goto err_free_adpt;
 
pcm->private_data = channel;
-   snprintf(pcm->name, sizeof(pcm->name), device_name);
+   strscpy(pcm->name, device_name, sizeof(pcm->name));
snd_pcm_set_ops(pcm, direction, &pcm_ops);
 
if (create) {
-- 
2.19.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 3/3] staging: greybus: arche-platform: Switch to the gpio descriptor interface

2018-12-18 Thread Johan Hovold
On Thu, Nov 22, 2018 at 10:39:24PM +0530, Nishad Kamdar wrote:
> Use the gpiod interface instead of the deprecated
> old non-descriptor interface.
> 
> Signed-off-by: Nishad Kamdar 
> ---
> Changes in v2:
>  - Move comment to the same line as to what it applies to.
> ---
>  drivers/staging/greybus/arche-platform.c | 119 ---
>  1 file changed, 41 insertions(+), 78 deletions(-)
> 
> diff --git a/drivers/staging/greybus/arche-platform.c 
> b/drivers/staging/greybus/arche-platform.c
> index 4c36e88766e7..a5cea79d8e32 100644
> --- a/drivers/staging/greybus/arche-platform.c
> +++ b/drivers/staging/greybus/arche-platform.c
> @@ -8,10 +8,9 @@
>  
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
> @@ -45,14 +44,14 @@ enum svc_wakedetect_state {
>  
>  struct arche_platform_drvdata {
>   /* Control GPIO signals to and from AP <=> SVC */
> - int svc_reset_gpio;
> + struct gpio_desc *svc_reset;
> + struct gpio_desc *svc_sysboot;

Why move sysboot? The flag below is about reset (but should eventually
go away).

>   bool is_reset_act_hi;
> - int svc_sysboot_gpio;
> - int wake_detect_gpio; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME signals */
> + struct gpio_desc *wake_detect; /* bi-dir,maps to WAKE_MOD & WAKE_FRAME 
> signals */
>  
>   enum arche_platform_state state;
>  
> - int svc_refclk_req;
> + struct gpio_desc *svc_refclk_req;
>   struct clk *svc_ref_clk;
>  
>   struct pinctrl *pinctrl;
> @@ -85,9 +84,9 @@ static void arche_platform_set_wake_detect_state(
>   arche_pdata->wake_detect_state = state;
>  }
>  
> -static inline void svc_reset_onoff(unsigned int gpio, bool onoff)
> +static inline void svc_reset_onoff(struct gpio_desc *gpio, bool onoff)
>  {
> - gpio_set_value(gpio, onoff);
> + gpiod_set_value(gpio, onoff);
>  }
>  
>  static int apb_cold_boot(struct device *dev, void *data)
> @@ -116,7 +115,6 @@ static int apb_poweroff(struct device *dev, void *data)
>  static void arche_platform_wd_irq_en(struct arche_platform_drvdata 
> *arche_pdata)
>  {
>   /* Enable interrupt here, to read event back from SVC */
> - gpio_direction_input(arche_pdata->wake_detect_gpio);
>   enable_irq(arche_pdata->wake_detect_irq);
>  }
>  
> @@ -160,7 +158,7 @@ static irqreturn_t arche_platform_wd_irq(int irq, void 
> *devid)
>  
>   spin_lock_irqsave(&arche_pdata->wake_lock, flags);
>  
> - if (gpio_get_value(arche_pdata->wake_detect_gpio)) {
> + if (gpiod_get_value(arche_pdata->wake_detect)) {
>   /* wake/detect rising */
>  
>   /*
> @@ -224,10 +222,10 @@ arche_platform_coldboot_seq(struct 
> arche_platform_drvdata *arche_pdata)
>  
>   dev_info(arche_pdata->dev, "Booting from cold boot state\n");
>  
> - svc_reset_onoff(arche_pdata->svc_reset_gpio,
> + svc_reset_onoff(arche_pdata->svc_reset,

No need to break line here.

>   arche_pdata->is_reset_act_hi);
>  
> - gpio_set_value(arche_pdata->svc_sysboot_gpio, 0);
> + gpiod_set_value(arche_pdata->svc_sysboot, 0);
>   usleep_range(100, 200);
>  
>   ret = clk_prepare_enable(arche_pdata->svc_ref_clk);
> @@ -238,7 +236,7 @@ arche_platform_coldboot_seq(struct arche_platform_drvdata 
> *arche_pdata)
>   }
>  
>   /* bring SVC out of reset */
> - svc_reset_onoff(arche_pdata->svc_reset_gpio,
> + svc_reset_onoff(arche_pdata->svc_reset,

Same here. Please check throughout.

>   !arche_pdata->is_reset_act_hi);
>  
>   arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_ACTIVE);
> @@ -259,10 +257,10 @@ arche_platform_fw_flashing_seq(struct 
> arche_platform_drvdata *arche_pdata)
>  
>   dev_info(arche_pdata->dev, "Switching to FW flashing state\n");
>  
> - svc_reset_onoff(arche_pdata->svc_reset_gpio,
> + svc_reset_onoff(arche_pdata->svc_reset,
>   arche_pdata->is_reset_act_hi);
>  
> - gpio_set_value(arche_pdata->svc_sysboot_gpio, 1);
> + gpiod_set_value(arche_pdata->svc_sysboot, 1);
>  
>   usleep_range(100, 200);
>  
> @@ -273,7 +271,7 @@ arche_platform_fw_flashing_seq(struct 
> arche_platform_drvdata *arche_pdata)
>   return ret;
>   }
>  
> - svc_reset_onoff(arche_pdata->svc_reset_gpio,
> + svc_reset_onoff(arche_pdata->svc_reset,
>   !arche_pdata->is_reset_act_hi);
>  
>   arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_FW_FLASHING);
> @@ -305,7 +303,7 @@ arche_platform_poweroff_seq(struct arche_platform_drvdata 
> *arche_pdata)
>   clk_disable_unprepare(arche_pdata->svc_ref_clk);
>  
>   /* As part of exit, put APB back in reset state */
> - svc_reset_onoff(arche_pdata->svc_reset_gpio,
> + svc_reset_onoff(arche_pdata->svc_reset,
>   arche_pdata->is_reset_act_hi);
>  
>   arche_platform_set_state(arche_pdata, ARCHE_PLATFORM_STATE_OFF);
> @@ -43

[PATCH -next] staging: fbtft: use strcmp() instead of strncmp() for subsystem lookup

2018-12-18 Thread YueHaibing
strncmp() stops comparing when either the end of one of the first two 
arguments is reached or when 'n' characters have been compared, whichever
comes first.That means that strncmp(s1, s2, n) is equivalent to 
strcmp(s1, s2) if n exceeds the length of s1 or the length of s2.

This patch avoids that the following warning is reported by smatch:

drivers/staging/fbtft/fbtft_device.c:1458
 fbtft_device_init() error: strncmp() '"list"' too small (5 vs 32)

Signed-off-by: YueHaibing 
---
 drivers/staging/fbtft/fbtft_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c 
b/drivers/staging/fbtft/fbtft_device.c
index 50e97da..0e995028 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1455,7 +1455,7 @@ static int __init fbtft_device_init(void)
}
 
/* name=list lists all supported displays */
-   if (strncmp(name, "list", FBTFT_GPIO_NAME_SIZE) == 0) {
+   if (strcmp(name, "list") == 0) {
pr_info("Supported displays:\n");
 
for (i = 0; i < ARRAY_SIZE(displays); i++)
-- 
2.7.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH -next] staging: fbtft: use strcmp() instead of strncmp() for subsystem lookup

2018-12-18 Thread YueHaibing
sorry, Pls ignore this.  The title need fix.

On 2018/12/18 21:09, YueHaibing wrote:
> strncmp() stops comparing when either the end of one of the first two 
> arguments is reached or when 'n' characters have been compared, whichever
> comes first.That means that strncmp(s1, s2, n) is equivalent to 
> strcmp(s1, s2) if n exceeds the length of s1 or the length of s2.
> 
> This patch avoids that the following warning is reported by smatch:
> 
> drivers/staging/fbtft/fbtft_device.c:1458
>  fbtft_device_init() error: strncmp() '"list"' too small (5 vs 32)
> 
> Signed-off-by: YueHaibing 
> ---
>  drivers/staging/fbtft/fbtft_device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft_device.c 
> b/drivers/staging/fbtft/fbtft_device.c
> index 50e97da..0e995028 100644
> --- a/drivers/staging/fbtft/fbtft_device.c
> +++ b/drivers/staging/fbtft/fbtft_device.c
> @@ -1455,7 +1455,7 @@ static int __init fbtft_device_init(void)
>   }
>  
>   /* name=list lists all supported displays */
> - if (strncmp(name, "list", FBTFT_GPIO_NAME_SIZE) == 0) {
> + if (strcmp(name, "list") == 0) {
>   pr_info("Supported displays:\n");
>  
>   for (i = 0; i < ARRAY_SIZE(displays); i++)
> 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 -next] staging: fbtft: use strcmp() instead of strncmp() for

2018-12-18 Thread YueHaibing
strncmp() stops comparing when either the end of one of the first two 
arguments is reached or when 'n' characters have been compared, whichever
comes first.That means that strncmp(s1, s2, n) is equivalent to 
strcmp(s1, s2) if n exceeds the length of s1 or the length of s2.

This patch avoids that the following warning is reported by smatch:

drivers/staging/fbtft/fbtft_device.c:1458
 fbtft_device_init() error: strncmp() '"list"' too small (5 vs 32)

Signed-off-by: YueHaibing 
---
v2: fix patch title
---
 drivers/staging/fbtft/fbtft_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c 
b/drivers/staging/fbtft/fbtft_device.c
index 50e97da..0e995028 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1455,7 +1455,7 @@ static int __init fbtft_device_init(void)
}
 
/* name=list lists all supported displays */
-   if (strncmp(name, "list", FBTFT_GPIO_NAME_SIZE) == 0) {
+   if (strcmp(name, "list") == 0) {
pr_info("Supported displays:\n");
 
for (i = 0; i < ARRAY_SIZE(displays); i++)
-- 
2.7.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 -next] staging: fbtft: use strcmp() instead of strncmp() for

2018-12-18 Thread Dan Carpenter
On Tue, Dec 18, 2018 at 09:25:08PM +0800, YueHaibing wrote:
> strncmp() stops comparing when either the end of one of the first two 
> arguments is reached or when 'n' characters have been compared, whichever
> comes first.That means that strncmp(s1, s2, n) is equivalent to 
> strcmp(s1, s2) if n exceeds the length of s1 or the length of s2.
> 
> This patch avoids that the following warning is reported by smatch:
> 
> drivers/staging/fbtft/fbtft_device.c:1458
>  fbtft_device_init() error: strncmp() '"list"' too small (5 vs 32)
> 
> Signed-off-by: YueHaibing 
> ---
> v2: fix patch title

v2 is worse than v1...

v1 is a little long but I wouldn't have complained about it.

Please assume that the subject and the commit message are separate
things.  Take a look how the patch description reads on marc.info:

https://marc.info/?l=linux-driver-devel&m=154513957719226&w=2

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 -next] staging: fbtft: use strcmp() instead of strncmp() for

2018-12-18 Thread YueHaibing
On 2018/12/18 21:37, Dan Carpenter wrote:
> On Tue, Dec 18, 2018 at 09:25:08PM +0800, YueHaibing wrote:
>> strncmp() stops comparing when either the end of one of the first two 
>> arguments is reached or when 'n' characters have been compared, whichever
>> comes first.That means that strncmp(s1, s2, n) is equivalent to 
>> strcmp(s1, s2) if n exceeds the length of s1 or the length of s2.
>>
>> This patch avoids that the following warning is reported by smatch:
>>
>> drivers/staging/fbtft/fbtft_device.c:1458
>>  fbtft_device_init() error: strncmp() '"list"' too small (5 vs 32)
>>
>> Signed-off-by: YueHaibing 
>> ---
>> v2: fix patch title
> 
> v2 is worse than v1...

Yes, , I messed up.

I will fix it.

> 
> v1 is a little long but I wouldn't have complained about it.
> 
> Please assume that the subject and the commit message are separate
> things.  Take a look how the patch description reads on marc.info:
> 
> https://marc.info/?l=linux-driver-devel&m=154513957719226&w=2
> 
> regards,
> dan carpenter
> 
> 
> .
> 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 -next] staging: fbtft: fix strncmp() size warning

2018-12-18 Thread YueHaibing
strncmp() stops comparing when either the end of one of the first two
arguments is reached or when 'n' characters have been compared, whichever
comes first.That means that strncmp(s1, s2, n) is equivalent to
strcmp(s1, s2) if n exceeds the length of s1 or the length of s2.

This patch avoids that the following warning is reported by smatch:

drivers/staging/fbtft/fbtft_device.c:1458
 fbtft_device_init() error: strncmp() '"list"' too small (5 vs 32)

Signed-off-by: YueHaibing 
---
v2-v3: fix messed patch title
---
 drivers/staging/fbtft/fbtft_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft_device.c 
b/drivers/staging/fbtft/fbtft_device.c
index 50e97da..046f9d3 100644
--- a/drivers/staging/fbtft/fbtft_device.c
+++ b/drivers/staging/fbtft/fbtft_device.c
@@ -1455,7 +1455,7 @@ static int __init fbtft_device_init(void)
}
 
/* name=list lists all supported displays */
-   if (strncmp(name, "list", FBTFT_GPIO_NAME_SIZE) == 0) {
+   if (strcmp(name, "list") == 0) {
pr_info("Supported displays:\n");
 
for (i = 0; i < ARRAY_SIZE(displays); i++)
-- 
2.7.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 2/2] dt-bindings: net: dsa: ksz9477: add sample of switch bindings managed in i2c mode

2018-12-18 Thread Rob Herring
On Mon, Dec 17, 2018 at 09:44:23PM +0100, Sergio Paracuellos wrote:
> Add device-tree binding example of the ksz9477 switch managed in i2c mode.
> 
> Cc: devicet...@vger.kernel.org
> Signed-off-by: Sergio Paracuellos 
> ---
> Changes v3:
> - No changes. Just resent patches together.
> 
> Changes v2:
> - Use generic name for label of the switch and make sure reg and @X
>   have the same value.
> 
>  .../devicetree/bindings/net/dsa/ksz.txt   | 50 +++
>  1 file changed, 50 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/ksz.txt 
> b/Documentation/devicetree/bindings/net/dsa/ksz.txt
> index 0f407fb371ce..d3c4b9d4f416 100644
> --- a/Documentation/devicetree/bindings/net/dsa/ksz.txt
> +++ b/Documentation/devicetree/bindings/net/dsa/ksz.txt
> @@ -74,3 +74,53 @@ Ethernet switch connected via SPI to the host, CPU port 
> wired to eth0:
>   };
>   };
>   };
> +
> +Ethernet switch connected via I2C to the host, CPU port wired to eth0:
> +
> + eth0: ethernet@10001000 {

Why do we have all this indentation? Please remove. And use tab chars, 
not spaces.

> + fixed-link {
> + speed = <1000>;
> + full-duplex;
> + };
> + };
> +
> + i2c0: i2c@f8008000 {
> + switch: ksz9897@5f {
> + compatible = 
> "microchip,ksz9897";
> + reg = <5f>;
> +
> + ports {
> + 
> #address-cells = <1>;
> + 
> #size-cells = <0>;
> + 
> port@0 {
> + 
> reg = <0>;
> + 
> label = "lan1";
> + 
> };
> + 
> port@1 {
> + 
> reg = <1>;
> + 
> label = "lan2";
> + 
> };
> + 
> port@2 {
> + 
> reg = <2>;
> + 
> label = "lan3";
> + 
> };
> + 
> port@3 {
> + 
> reg = <3>;
> + 
> label = "lan4";
> + 
> };
> + 
> port@4 {
> + 
> reg = <4>;
> + 
> label = "lan5";
> + 
> };
> + 
> port@6 {
> + 
> reg = <6>;
> + 
> label = "cpu";
> + 
> ethernet = <ð0>;
> + 
> fixed-link {
> + 
> speed = <1000>;
> + 
> full-duplex;
> +

[PATCH] staging: rtlwifi: Fix one line with over 80 chars.

2018-12-18 Thread Lei Zhou
Add local temporary variable used as buffer to pass caller pointer into
function ieee80211_connection_loss() to avoid over 80 characters on one
line.

Signed-off-by: Lei Zhou 
---
 drivers/staging/rtlwifi/base.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtlwifi/base.c b/drivers/staging/rtlwifi/base.c
index 35df2cf..8bd1a78 100644
--- a/drivers/staging/rtlwifi/base.c
+++ b/drivers/staging/rtlwifi/base.c
@@ -1979,6 +1979,7 @@ void rtl_watchdog_wq_callback(void *data)
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
+   struct ieee80211_vif *vif = NULL;
bool busytraffic = false;
bool tx_busy_traffic = false;
bool rx_busy_traffic = false;
@@ -2130,7 +2131,8 @@ void rtl_watchdog_wq_callback(void *data)
if (rtlpriv->link_info.roam_times >= 5) {
pr_err("AP off, try to reconnect now\n");
rtlpriv->link_info.roam_times = 0;
-   
ieee80211_connection_loss(rtlpriv->mac80211.vif);
+   vif = rtlpriv->mac80211.vif;
+   ieee80211_connection_loss(vif);
}
} else {
rtlpriv->link_info.roam_times = 0;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3] staging: android: ion: Add implementation of dma_buf_vmap and dma_buf_vunmap

2018-12-18 Thread Alexey Skidanov



On 12/17/18 20:42, Liam Mark wrote:
> On Sun, 16 Dec 2018, Alexey Skidanov wrote:
> 
>>
>>
>> On 12/16/18 7:20 AM, Liam Mark wrote:
>>> On Tue, 6 Feb 2018, Alexey Skidanov wrote:
>>>


 On 02/07/2018 01:56 AM, Laura Abbott wrote:
> On 01/31/2018 10:10 PM, Alexey Skidanov wrote:
>>
>> On 01/31/2018 03:00 PM, Greg KH wrote:
>>> On Wed, Jan 31, 2018 at 02:03:42PM +0200, Alexey Skidanov wrote:
 Any driver may access shared buffers, created by ion, using
 dma_buf_vmap and
 dma_buf_vunmap dma-buf API that maps/unmaps previosuly allocated
 buffers into
 the kernel virtual address space. The implementation of these API is
 missing in
 the current ion implementation.

 Signed-off-by: Alexey Skidanov 
 ---
>>>
>>> No review from any other Intel developers? :(
>> Will add.
>>>
>>> Anyway, what in-tree driver needs access to these functions?
>> I'm not sure that there are the in-tree drivers using these functions
>> and ion as> buffer exporter because they are not implemented in ion :)
>> But there are some in-tre> drivers using these APIs (gpu drivers) with
>> other buffer exporters.
>
> It's still not clear why you need to implement these APIs.
 How the importing kernel module may access the content of the buffer? :)
 With the current ion implementation it's only possible by dma_buf_kmap,
 mapping one page at a time. For pretty large buffers, it might have some
 performance impact.
 (Probably, the page by page mapping is the only way to access large
 buffers on 32 bit systems, where the vmalloc range is very small. By the
 way, the current ion dma_map_kmap doesn't really map only 1 page at a
 time - it uses the result of vmap() that might fail on 32 bit systems.)

> Are you planning to use Ion with GPU drivers? I'm especially
> interested in this if you have a non-Android use case.
 Yes, my use case is the non-Android one. But not with GPU drivers.
>
> Thanks,
> Laura

 Thanks,
 Alexey
>>>
>>> I was wondering if we could re-open the discussion on adding support to 
>>> ION for dma_buf_vmap.
>>> It seems like the patch was not taken as the reviewers wanted more 
>>> evidence of an upstream use case.
>>>
>>> Here would be my upstream usage argument for including dma_buf_vmap 
>>> support in ION.
>>>
>>> Currently all calls to ion_dma_buf_begin_cpu_access result in the creation 
>>> of a kernel mapping for the buffer, unfortunately the resulting call to 
>>> alloc_vmap_area can be quite expensive and this has caused a performance 
>>> regression for certain clients when they have moved to the new version of 
>>> ION.
>>>
>>> The kernel mapping is not actually needed in ion_dma_buf_begin_cpu_access, 
>>> and generally isn't needed by clients. So if we remove the creation of the 
>>> kernel mapping in ion_dma_buf_begin_cpu_access and only create it when 
>>> needed we can speed up the calls to ion_dma_buf_begin_cpu_access.
>>>
>>> An additional benefit of removing the creation of kernel mappings from 
>>> ion_dma_buf_begin_cpu_access is that it makes the ION code more secure.
>>> Currently a malicious client could call the DMA_BUF_IOCTL_SYNC IOCTL with 
>>> flags DMA_BUF_SYNC_END multiple times to cause the ION buffer kmap_cnt to 
>>> go negative which could lead to undesired behavior.
>>>
>>> One disadvantage of the above change is that a kernel mapping is not 
>>> already created when a client calls dma_buf_kmap. So the following 
>>> dma_buf_kmap contract can't be satisfied.
>>>
>>> /**
>>> * dma_buf_kmap - Map a page of the buffer object into kernel address 
>>> space. The
>>> * same restrictions as for kmap and friends apply.
>>> * @dmabuf:  [in]buffer to map page from.
>>> * @page_num:[in]page in PAGE_SIZE units to map.
>>> *
>>> * This call must always succeed, any necessary preparations that might 
>>> fail
>>> * need to be done in begin_cpu_access.
>>> */
>>>
>>> But hopefully we can work around this by moving clients to dma_buf_vmap.
>> I think the problem is with the contract. We can't ensure that the call
>> is always succeeds regardless the implementation - any mapping might
>> fail. Probably this is why  *all* clients of dma_buf_kmap() check the
>> return value (so it's safe to return NULL in case of failure).
>>
> 
> I think currently the call to dma_buf_kmap will always succeed since the 
> DMA-Buf contract requires that the client first successfully call 
> dma_buf_begin_cpu_access(), and if dma_buf_begin_cpu_access() succeeds 
> then dma_buf_kmap will succeed.
> 
>> I would suggest to fix the contract and to keep the dma_buf_kmap()
>> support in ION.
> 
> I will leave it to the DMA-Buf maintainers as to whether they want to 
> change their contract.
> 
> Liam
> 
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative 

Re: [PATCH] Drivers: hv: vmbus: Check for ring when getting debug info

2018-12-18 Thread Sasha Levin

On Mon, Dec 17, 2018 at 08:16:09PM +, Dexuan Cui wrote:


fc96df16a1ce is good and can already fix the "return stack garbage" issue,
but let's also improve hv_ringbuffer_get_debuginfo(), which would silently
return stack garbage, if people forget to check channel->state or
ring_info->ring_buffer, when using the function in the future.

Having an error check in the function would eliminate the potential risk.

Add a Fixes tag to indicate the patch depdendency.

Fixes: fc96df16a1ce ("Drivers: hv: vmbus: Return -EINVAL for the sys files for 
unopened channels")
Cc: sta...@vger.kernel.org
Cc: K. Y. Srinivasan 
Cc: Haiyang Zhang 
Signed-off-by: Stephen Hemminger 
Signed-off-by: Dexuan Cui 
---

*NOTE*: the patch is based on char-misc's char-misc-linus branch.


Queued up, thank you.

--
Thanks,
Sasha
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 03/17] staging: rtl8188eu: remove commented declarations in rtw_mlme_ext.c

2018-12-18 Thread Michael Straube
Remove unused/commented declarations.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 8c566180d808..f2eb63634972 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -1828,7 +1828,6 @@ unsigned int send_delba(struct adapter *padapter, u8 
initiator, u8 *addr)
 {
struct sta_priv *pstapriv = &padapter->stapriv;
struct sta_info *psta = NULL;
-   /* struct recv_reorder_ctrl *preorder_ctrl; */
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u16 tid;
@@ -3338,7 +3337,6 @@ static unsigned int OnAssocRsp(struct adapter *padapter,
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
-   /* struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network); */
u8 *pframe = precv_frame->pkt->data;
uint pkt_len = precv_frame->pkt->len;
 
@@ -4871,7 +4869,6 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf)
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex 
*)(&(pmlmeinfo->network));
struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
-   /* u32  initialgain; */
 
if (pparm->InfrastructureMode == Ndis802_11APMode) {
 #ifdef CONFIG_88EU_AP_MODE
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 08/17] staging: rtl8188eu: remove unused arrays WFD_OUI and WMM_INFO_OUI

2018-12-18 Thread Michael Straube
The arrays WFD_OUI and WMM_INFO_OUI are not used anywhere,
so remove them.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c| 2 --
 drivers/staging/rtl8188eu/include/rtw_mlme_ext.h | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index e7ffa782a387..ca818887cbc6 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -26,9 +26,7 @@ unsigned char RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
 unsigned char WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
 unsigned char WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
 unsigned char P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
-unsigned char WFD_OUI[] = {0x50, 0x6F, 0x9A, 0x0A};
 
-unsigned char WMM_INFO_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01};
 unsigned char WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
 
 unsigned char WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02};
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h 
b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
index 0ade33df16d2..62999bc06de5 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
@@ -84,10 +84,8 @@
 extern unsigned char RTW_WPA_OUI[];
 extern unsigned char WMM_OUI[];
 extern unsigned char WPS_OUI[];
-extern unsigned char WFD_OUI[];
 extern unsigned char P2P_OUI[];
 
-extern unsigned char WMM_INFO_OUI[];
 extern unsigned char WMM_PARA_OUI[];
 
 /*  Channel Plan Type. */
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 13/17] staging: rtl8188eu: change order of declarations to improve readability

2018-12-18 Thread Michael Straube
Change the order of array declarations in rtw_mlme_ext.c to improve
readability.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 30ae42c17796..d3d211d8 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -23,8 +23,8 @@ static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
 OUI definitions for the vendor specific IE
 ***/
 const u8 RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
-static const u8 WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
 const u8 WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
+static const u8 WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
 static const u8 P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
 
 static const u8 WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 05/17] staging: rtl8188eu: add blank line after declarations

2018-12-18 Thread Michael Straube
Add a missing blank line after declarations in rtw_mlme_ext.c.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 813f5d9e550d..beac6e9ee5dd 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -3592,6 +3592,7 @@ static unsigned int OnAction_back(struct adapter 
*padapter,
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 *pframe = precv_frame->pkt->data;
struct sta_priv *pstapriv = &padapter->stapriv;
+
/* check RA matches or not */
if (memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe),
   ETH_ALEN))/* for if1, sta/ap mode */
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 02/17] staging: rtl8188eu: replace tabs with spaces in rtw_mlme_ext.c

2018-12-18 Thread Michael Straube
Replace tabs with spaces where appropriate.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 5c485777e482..8c566180d808 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -4025,7 +4025,7 @@ static u8 init_channel_set(struct adapter *padapter, u8 
ChannelPlan,
return chanset_size;
 }
 
-intinit_mlme_ext_priv(struct adapter *padapter)
+int init_mlme_ext_priv(struct adapter *padapter)
 {
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
@@ -5205,7 +5205,7 @@ u8 setauth_hdl(struct adapter *padapter, unsigned char 
*pbuf)
 
if (pparm->mode < 4)
pmlmeinfo->auth_algo = pparm->mode;
-   return  H2C_SUCCESS;
+   return H2C_SUCCESS;
 }
 
 u8 setkey_hdl(struct adapter *padapter, u8 *pbuf)
@@ -5310,7 +5310,7 @@ u8 add_ba_hdl(struct adapter *padapter, unsigned char 
*pbuf)
struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, 
pparm->addr);
 
if (!psta)
-   return  H2C_SUCCESS;
+   return H2C_SUCCESS;
 
if (((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && 
(pmlmeinfo->HT_enable)) ||
((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) {
@@ -5320,7 +5320,7 @@ u8 add_ba_hdl(struct adapter *padapter, unsigned char 
*pbuf)
} else {
psta->htpriv.candidate_tid_bitmap &= ~BIT(pparm->tid);
}
-   return  H2C_SUCCESS;
+   return H2C_SUCCESS;
 }
 
 u8 set_tx_beacon_cmd(struct adapter *padapter)
@@ -5471,7 +5471,7 @@ u8 set_ch_hdl(struct adapter *padapter, u8 *pbuf)
 
set_channel_bwmode(padapter, set_ch_parm->ch, set_ch_parm->ch_offset, 
set_ch_parm->bw);
 
-   return  H2C_SUCCESS;
+   return H2C_SUCCESS;
 }
 
 u8 set_chplan_hdl(struct adapter *padapter, unsigned char *pbuf)
@@ -5487,5 +5487,5 @@ u8 set_chplan_hdl(struct adapter *padapter, unsigned char 
*pbuf)
pmlmeext->max_chan_nums = init_channel_set(padapter, 
setChannelPlan_param->channel_plan, pmlmeext->channel_set);
init_channel_list(padapter, pmlmeext->channel_set, 
pmlmeext->max_chan_nums, &pmlmeext->channel_list);
 
-   return  H2C_SUCCESS;
+   return H2C_SUCCESS;
 }
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 04/17] staging: rtl8188eu: remove blank lines between declarations

2018-12-18 Thread Michael Straube
Remove blank lines between declarations in rtw_mlme_ext.c.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index f2eb63634972..813f5d9e550d 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -1868,7 +1868,6 @@ unsigned int send_beacon(struct adapter *padapter)
u8 bxmitok = false;
int issue = 0;
int poll = 0;
-
unsigned long start = jiffies;
 
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
@@ -5303,7 +5302,6 @@ u8 add_ba_hdl(struct adapter *padapter, unsigned char 
*pbuf)
struct addBaReq_parm *pparm = (struct addBaReq_parm *)pbuf;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
-
struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, 
pparm->addr);
 
if (!psta)
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 10/17] staging: rtl8188eu: convert unsigned char arrays to u8

2018-12-18 Thread Michael Straube
Change the type of some arrays from unsigned char to u8.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 16 +++---
 .../staging/rtl8188eu/core/rtw_wlan_util.c| 22 +--
 drivers/staging/rtl8188eu/include/rtw_mlme.h  |  6 ++---
 .../staging/rtl8188eu/include/rtw_mlme_ext.h  | 10 -
 4 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 30ebec6c32be..dd1280eb3355 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -22,15 +22,15 @@ static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
 /**
 OUI definitions for the vendor specific IE
 ***/
-unsigned char RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
-unsigned char WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
-unsigned char WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
-unsigned char P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
+u8 RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
+u8 WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
+u8 WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
+u8 P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
 
-unsigned char WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
+u8 WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
 
-unsigned char WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02};
-unsigned char RSN_TKIP_CIPHER[4] = {0x00, 0x0f, 0xac, 0x02};
+u8 WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02};
+u8 RSN_TKIP_CIPHER[4] = {0x00, 0x0f, 0xac, 0x02};
 
 /
 MCS rate definitions
@@ -5207,7 +5207,7 @@ u8 setkey_hdl(struct adapter *padapter, u8 *pbuf)
struct setkey_parm *pparm = (struct setkey_parm *)pbuf;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-   unsigned char null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+   u8 null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
/* main tx key for wep. */
if (pparm->set_tx)
diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c 
b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 9a20faad96c9..484bb41b25cc 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -12,20 +12,20 @@
 #include 
 #include 
 
-static unsigned char ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f};
-static unsigned char ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
+static u8 ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f};
+static u8 ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
 
-static unsigned char BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
-static unsigned char BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
+static u8 BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
+static u8 BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
 
-static unsigned char CISCO_OUI[] = {0x00, 0x40, 0x96};
-static unsigned char MARVELL_OUI[] = {0x00, 0x50, 0x43};
-static unsigned char RALINK_OUI[] = {0x00, 0x0c, 0x43};
-static unsigned char REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
-static unsigned char AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
-static unsigned char EPIGRAM_OUI[] = {0x00, 0x90, 0x4c};
+static u8 CISCO_OUI[] = {0x00, 0x40, 0x96};
+static u8 MARVELL_OUI[] = {0x00, 0x50, 0x43};
+static u8 RALINK_OUI[] = {0x00, 0x0c, 0x43};
+static u8 REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
+static u8 AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
+static u8 EPIGRAM_OUI[] = {0x00, 0x90, 0x4c};
 
-unsigned char REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
+u8 REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
 
 #define R2T_PHY_DELAY  (0)
 
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h 
b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index 126b96906171..090191fcae0a 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -211,9 +211,9 @@ int hostapd_mode_init(struct adapter *padapter);
 void hostapd_mode_unload(struct adapter *padapter);
 #endif
 
-extern unsigned char WPA_TKIP_CIPHER[4];
-extern unsigned char RSN_TKIP_CIPHER[4];
-extern unsigned char REALTEK_96B_IE[];
+extern u8 WPA_TKIP_CIPHER[4];
+extern u8 RSN_TKIP_CIPHER[4];
+extern u8 REALTEK_96B_IE[];
 extern const u8 MCS_rate_1R[16];
 
 void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf);
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h 
b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
index 62999bc06de5..a2d9d5307179 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
@@ -81,12 +81,12 @@
 #define_54M_RATE_  11
 
 
-extern unsigned char RTW_WPA_OUI[];
-extern unsigned char WMM_OUI[];
-extern unsigned char WPS_OUI[];
-extern unsigned char P2P_OUI[];
+extern u8 RTW_WPA_OUI[];
+extern u8 WMM_OUI[];
+extern u8 WPS_OUI[];
+extern u8 P2P_OUI[];
 
-extern unsigned char WMM_P

[PATCH v2 06/17] staging: rtl8188eu: remove unnecessary comments in rtw_mlme_ext.c

2018-12-18 Thread Michael Straube
Remove comments from 'endif's where the corresponding 'if' is just
a few lines above to improve readability.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index beac6e9ee5dd..40951a31a606 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -333,7 +333,7 @@ static void issue_beacon(struct adapter *padapter, int 
timeout_ms)
}
 #if defined(CONFIG_88EU_AP_MODE)
spin_lock_bh(&pmlmepriv->bcn_update_lock);
-#endif /* if defined (CONFIG_88EU_AP_MODE) */
+#endif
 
/* update attribute */
pattrib = &pmgntframe->attrib;
@@ -436,7 +436,7 @@ static void issue_beacon(struct adapter *padapter, int 
timeout_ms)
pmlmepriv->update_bcn = false;
 
spin_unlock_bh(&pmlmepriv->bcn_update_lock);
-#endif /* if defined (CONFIG_88EU_AP_MODE) */
+#endif
 
if ((pattrib->pktlen + TXDESC_SIZE) > 512) {
DBG_88E("beacon frame too large\n");
@@ -465,7 +465,7 @@ static void issue_probersp(struct adapter *padapter, 
unsigned char *da)
u8 *pwps_ie;
uint wps_ielen;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-#endif /* if defined (CONFIG_88EU_AP_MODE) */
+#endif
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
@@ -4087,7 +4087,7 @@ void mgt_dispatcher(struct adapter *padapter, struct 
recv_frame *precv_frame)
struct mlme_handler *ptable;
 #ifdef CONFIG_88EU_AP_MODE
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-#endif /* CONFIG_88EU_AP_MODE */
+#endif
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
u8 *pframe = precv_frame->pkt->data;
struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, 
GetAddr2Ptr(pframe));
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 07/17] staging: rtl8188eu: remove unnecessary parentheses in rtw_mlme_ext.c

2018-12-18 Thread Michael Straube
Remove unnecessary parentheses, most of them reported by checkpatch.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 322 +-
 1 file changed, 161 insertions(+), 161 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 40951a31a606..e7ffa782a387 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -184,7 +184,7 @@ Following are some TX functions for WiFi MLME
 
 void update_mgnt_tx_rate(struct adapter *padapter, u8 rate)
 {
-   struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
+   struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 
pmlmeext->tx_rate = rate;
DBG_88E("%s(): rate = %x\n", __func__, rate);
@@ -192,7 +192,7 @@ void update_mgnt_tx_rate(struct adapter *padapter, u8 rate)
 
 void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib 
*pattrib)
 {
-   struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
+   struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 
memset((u8 *)(pattrib), 0, sizeof(struct pkt_attrib));
 
@@ -319,11 +319,11 @@ static void issue_beacon(struct adapter *padapter, int 
timeout_ms)
struct ieee80211_hdr *pwlanhdr;
__le16 *fctrl;
unsigned int rate_len;
-   struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
-   struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-   struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
-   struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
-   struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
+   struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
+   struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+   struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+   struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
+   struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
@@ -349,7 +349,7 @@ static void issue_beacon(struct adapter *padapter, int 
timeout_ms)
*(fctrl) = 0;
 
ether_addr_copy(pwlanhdr->addr1, bc_addr);
-   ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
+   ether_addr_copy(pwlanhdr->addr2, myid(&padapter->eeprompriv));
ether_addr_copy(pwlanhdr->addr3, cur_network->MacAddress);
 
SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/);
@@ -413,7 +413,7 @@ static void issue_beacon(struct adapter *padapter, int 
timeout_ms)
pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, min_t(unsigned int, 
rate_len, 8), cur_network->SupportedRates, &pattrib->pktlen);
 
/*  DS parameter set */
-   pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char 
*)&(cur_network->Configuration.DSConfig), &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char 
*)&cur_network->Configuration.DSConfig, &pattrib->pktlen);
 
{
u8 erpinfo = 0;
@@ -460,15 +460,15 @@ static void issue_probersp(struct adapter *padapter, 
unsigned char *da)
struct ieee80211_hdr *pwlanhdr;
__le16 *fctrl;
unsigned char *mac, *bssid;
-   struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
+   struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 #if defined(CONFIG_88EU_AP_MODE)
u8 *pwps_ie;
uint wps_ielen;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 #endif
-   struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
-   struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
-   struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
+   struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
+   struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
+   struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
unsigned int rate_len;
 
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
@@ -486,7 +486,7 @@ static void issue_probersp(struct adapter *padapter, 
unsigned char *da)
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct ieee80211_hdr *)pframe;
 
-   mac = myid(&(padapter->eeprompriv));
+   mac = myid(&padapter->eeprompriv);
bssid = cur_network->MacAddress;
 
fctrl = &pwlanhdr->frame_control;
@@ -573,7 +573,7 @@ static void issue_probersp(struct adapter *padapter, 
unsigned char *da)
pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, min_t(unsigned 
int, rate_len, 8), cur_network->SupportedRates, &pattrib->pktlen);
 
/*  DS parameter set */
-   pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char 
*)&(cur_network->Configuration.DSConfig), &pattrib->pktlen);
+   pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char 
*)&cur_network->Configuration.DSConfig, &pattr

[PATCH v2 01/17] staging: rtl8188eu: cleanup declarations in rtw_mlme_ext.c

2018-12-18 Thread Michael Straube
Replace tabs with spaces and/or remove spaces in declarations.

Signed-off-by: Michael Straube 
---
v1 -> v2
one logical thing per patch
replace some more tabs with spaces
remove some more comments

 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 482 +-
 1 file changed, 241 insertions(+), 241 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 6790b840aef8..5c485777e482 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -22,14 +22,14 @@ static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
 /**
 OUI definitions for the vendor specific IE
 ***/
-unsigned char  RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
+unsigned char RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
 unsigned char WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
-unsigned char  WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
-unsigned char  P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
-unsigned char  WFD_OUI[] = {0x50, 0x6F, 0x9A, 0x0A};
+unsigned char WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
+unsigned char P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
+unsigned char WFD_OUI[] = {0x50, 0x6F, 0x9A, 0x0A};
 
-unsigned char  WMM_INFO_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01};
-unsigned char  WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
+unsigned char WMM_INFO_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01};
+unsigned char WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
 
 unsigned char WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02};
 unsigned char RSN_TKIP_CIPHER[4] = {0x00, 0x0f, 0xac, 0x02};
@@ -56,7 +56,7 @@ static struct rt_channel_plan_2g 
RTW_ChannelPlan2G[RT_CHANNEL_DOMAIN_2G_MAX] = {
{{}, 0},
/*  0x05, RT_CHANNEL_DOMAIN_2G_NULL */
 };
 
-static struct rt_channel_plan_map  
RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = {
+static struct rt_channel_plan_map RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = {
/*  0x00 ~ 0x1F , Old Define = */
{0x02}, /* 0x00, RT_CHANNEL_DOMAIN_FCC */
{0x02}, /* 0x01, RT_CHANNEL_DOMAIN_IC */
@@ -154,8 +154,8 @@ int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, 
const u32 ch)
 
 struct xmit_frame *alloc_mgtxmitframe(struct xmit_priv *pxmitpriv)
 {
-   struct xmit_frame   *pmgntframe;
-   struct xmit_buf *pxmitbuf;
+   struct xmit_frame *pmgntframe;
+   struct xmit_buf *pxmitbuf;
 
pmgntframe = rtw_alloc_xmitframe(pxmitpriv);
if (!pmgntframe) {
@@ -184,7 +184,7 @@ Following are some TX functions for WiFi MLME
 
 void update_mgnt_tx_rate(struct adapter *padapter, u8 rate)
 {
-   struct mlme_ext_priv*pmlmeext = &(padapter->mlmeextpriv);
+   struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
 
pmlmeext->tx_rate = rate;
DBG_88E("%s(): rate = %x\n", __func__, rate);
@@ -192,7 +192,7 @@ void update_mgnt_tx_rate(struct adapter *padapter, u8 rate)
 
 void update_mgntframe_attrib(struct adapter *padapter, struct pkt_attrib 
*pattrib)
 {
-   struct mlme_ext_priv*pmlmeext = &(padapter->mlmeextpriv);
+   struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
 
memset((u8 *)(pattrib), 0, sizeof(struct pkt_attrib));
 
@@ -259,7 +259,7 @@ static s32 dump_mgntframe_and_wait_ack(struct adapter 
*padapter,
 {
s32 ret = _FAIL;
u32 timeout_ms = 500;/*   500ms */
-   struct xmit_priv*pxmitpriv = &padapter->xmitpriv;
+   struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
return -1;
@@ -313,18 +313,18 @@ static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 
hidden_ssid_mode)
 
 static void issue_beacon(struct adapter *padapter, int timeout_ms)
 {
-   struct xmit_frame   *pmgntframe;
-   struct pkt_attrib   *pattrib;
-   unsigned char   *pframe;
+   struct xmit_frame *pmgntframe;
+   struct pkt_attrib *pattrib;
+   unsigned char *pframe;
struct ieee80211_hdr *pwlanhdr;
__le16 *fctrl;
-   unsigned intrate_len;
-   struct xmit_priv*pxmitpriv = &(padapter->xmitpriv);
+   unsigned int rate_len;
+   struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
-   struct mlme_ext_priv*pmlmeext = &(padapter->mlmeextpriv);
-   struct mlme_ext_info*pmlmeinfo = &(pmlmeext->mlmext_info);
-   struct wlan_bssid_ex*cur_network = &(pmlmeinfo->network);
-   u8  bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+   struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
+   struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
+   struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);

[PATCH v2 15/17] staging: rtl8188eu: change return type of is_basicrate() to bool

2018-12-18 Thread Michael Straube
The function is_basicrate() returns true or false, so change the
return type from int to bool.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c 
b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index d18ce3a76c95..5f9c9de1f1da 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -156,7 +156,7 @@ static unsigned char ratetbl_val_2wifirate(unsigned char 
rate)
}
 }
 
-static int is_basicrate(struct adapter *padapter, unsigned char rate)
+static bool is_basicrate(struct adapter *padapter, unsigned char rate)
 {
int i;
unsigned char val;
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 14/17] staging: rtl8188eu: simplify null array initializations

2018-12-18 Thread Michael Straube
Simplfy initialization of null arrays to improve readability
and save some lines.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 4 ++--
 drivers/staging/rtl8188eu/core/rtw_xmit.c | 6 ++
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index d3d211d8..2a42f80d1970 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -17,7 +17,7 @@
 #include 
 #include 
 
-static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
+static u8 null_addr[ETH_ALEN] = {};
 
 /**
 OUI definitions for the vendor specific IE
@@ -5207,7 +5207,7 @@ u8 setkey_hdl(struct adapter *padapter, u8 *pbuf)
struct setkey_parm *pparm = (struct setkey_parm *)pbuf;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-   u8 null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+   u8 null_sta[ETH_ALEN] = {};
 
/* main tx key for wep. */
if (pparm->set_tx)
diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c 
b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 14e3f59b9009..3b1ccd138c3f 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -592,7 +592,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, 
struct xmit_frame *pxmitfr
struct  pkt_attrib *pattrib = &pxmitframe->attrib;
struct  security_priv   *psecuritypriv = &padapter->securitypriv;
struct  xmit_priv *pxmitpriv = &padapter->xmitpriv;
-   u8 priority[4] = {0x0, 0x0, 0x0, 0x0};
+   u8 priority[4] = {};
u8 hw_hdr_offset = 0;
 
if (pattrib->psta)
@@ -605,9 +605,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, 
struct xmit_frame *pxmitfr
if (pattrib->encrypt == _TKIP_) {
/* encode mic code */
if (stainfo) {
-   u8 null_key[16] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
-  0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
-  0x0, 0x0};
+   u8 null_key[16] = {};
 
pframe = pxmitframe->buf_addr + hw_hdr_offset;
 
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 16/17] staging: rtl8188eu: add spaces around '&' in rtw_mlme_ext.c

2018-12-18 Thread Michael Straube
Add spaces around '&' to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 90 +--
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index 2a42f80d1970..7a36661ebbed 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -355,7 +355,7 @@ static void issue_beacon(struct adapter *padapter, int 
timeout_ms)
pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);
 
-   if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
+   if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
int len_diff;
u8 *wps_ie;
uint wps_ielen;
@@ -503,7 +503,7 @@ static void issue_probersp(struct adapter *padapter, 
unsigned char *da)
return;
 
 #if defined(CONFIG_88EU_AP_MODE)
-   if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
+   if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
pwps_ie = rtw_get_wps_ie(cur_network->ies+_FIXED_IE_LENGTH_, 
cur_network->ie_length-_FIXED_IE_LENGTH_, NULL, &wps_ielen);
 
/* inerset & update wps_probe_resp_ie */
@@ -571,7 +571,7 @@ static void issue_probersp(struct adapter *padapter, 
unsigned char *da)
/*  DS parameter set */
pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char 
*)&cur_network->Configuration.DSConfig, &pattrib->pktlen);
 
-   if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) {
+   if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
u8 erpinfo = 0;
u32 ATIMWindow;
/*  IBSS Parameter Set... */
@@ -1218,9 +1218,9 @@ static int _issue_nulldata(struct adapter *padapter, 
unsigned char *da,
fctrl = &pwlanhdr->frame_control;
*(fctrl) = 0;
 
-   if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
+   if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)
SetFrDs(fctrl);
-   else if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
+   else if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)
SetToDs(fctrl);
 
if (power_mode)
@@ -1339,9 +1339,9 @@ static int _issue_qos_nulldata(struct adapter *padapter, 
unsigned char *da,
fctrl = &pwlanhdr->frame_control;
*(fctrl) = 0;
 
-   if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
+   if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)
SetFrDs(fctrl);
-   else if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
+   else if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)
SetToDs(fctrl);
 
if (pattrib->mdata)
@@ -1612,7 +1612,7 @@ static void issue_action_BA(struct adapter *padapter, 
unsigned char *raddr,
 
psta = rtw_get_stainfo(pstapriv, raddr);
if (psta) {
-   start_seq = 
(psta->sta_xmitpriv.txseq_tid[status & 0x07]&0xfff) + 1;
+   start_seq = 
(psta->sta_xmitpriv.txseq_tid[status & 0x07] & 0xfff) + 1;
 
DBG_88E("BA_starting_seqctrl=%d for TID=%d\n", 
start_seq, status & 0x07);
 
@@ -1828,7 +1828,7 @@ unsigned int send_delba(struct adapter *padapter, u8 
initiator, u8 *addr)
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
u16 tid;
 
-   if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+   if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS))
return _SUCCESS;
 
@@ -1840,7 +1840,7 @@ unsigned int send_delba(struct adapter *padapter, u8 
initiator, u8 *addr)
for (tid = 0; tid < MAXTID; tid++) {
if (psta->recvreorder_ctrl[tid].enable) {
DBG_88E("rx agg disable tid(%d)\n", tid);
-   issue_action_BA(padapter, addr, 
RTW_WLAN_ACTION_DELBA, (((tid << 1) | initiator)&0x1F));
+   issue_action_BA(padapter, addr, 
RTW_WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
psta->recvreorder_ctrl[tid].enable = false;
psta->recvreorder_ctrl[tid].indicate_seq = 
0x;
}
@@ -1849,7 +1849,7 @@ unsigned int send_delba(struct adapter *padapter, u8 
initiator, u8 *addr)
for (tid = 0; tid < MAXTID; tid++) {
if (psta->htpriv.agg_enable_bitmap & BIT(tid)) {
DBG_88E("tx agg disable tid(%d)\n", tid);
-   issue_action_BA(padapter, addr, 
RTW_WLAN_ACTION_DELBA, (((tid << 1) | initiator)&0x1F))

[PATCH v2 17/17] staging: rtl8188eu: cleanup brace coding style issues

2018-12-18 Thread Michael Straube
Cleanup brace coding style issues reported by checkpatch.

ERROR: space required before the open brace '{'
WARNING: braces {} are not necessary for single statement blocks
CHECK: Unbalanced braces around else statement

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_cmd.c  | 3 +--
 drivers/staging/rtl8188eu/core/rtw_security.c | 4 ++--
 drivers/staging/rtl8188eu/hal/phy.c   | 4 ++--
 drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c  | 7 +++
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 3 +--
 5 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c 
b/drivers/staging/rtl8188eu/core/rtw_cmd.c
index f9cdd1da8add..407f65cf7150 100644
--- a/drivers/staging/rtl8188eu/core/rtw_cmd.c
+++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c
@@ -214,9 +214,8 @@ int rtw_cmd_thread(void *context)
pcmdpriv->cmdthd_running = false;
 
/*  free all cmd_obj resources */
-   while ((pcmd = rtw_dequeue_cmd(&pcmdpriv->cmd_queue))) {
+   while ((pcmd = rtw_dequeue_cmd(&pcmdpriv->cmd_queue)))
rtw_free_cmd_obj(pcmd);
-   }
 
complete(&pcmdpriv->terminate_cmdthread_comp);
 
diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c 
b/drivers/staging/rtl8188eu/core/rtw_security.c
index f7407632e80b..364d6ea14bf8 100644
--- a/drivers/staging/rtl8188eu/core/rtw_security.c
+++ b/drivers/staging/rtl8188eu/core/rtw_security.c
@@ -1259,7 +1259,7 @@ u32   rtw_aes_encrypt(struct adapter *padapter, u8 
*pxmitframe)
length = 
pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
 
aes_cipher(prwskey, pattrib->hdrlen, 
pframe, length);
-   } else{
+   } else {
length = 
pxmitpriv->frag_len-pattrib->hdrlen-pattrib->iv_len-pattrib->icv_len;
 
aes_cipher(prwskey, pattrib->hdrlen, 
pframe, length);
@@ -1267,7 +1267,7 @@ u32   rtw_aes_encrypt(struct adapter *padapter, u8 
*pxmitframe)
pframe = (u8 
*)round_up((size_t)(pframe), 8);
}
}
-   } else{
+   } else {
RT_TRACE(_module_rtl871x_security_c_, _drv_err_, ("%s: 
stainfo==NULL!!!\n", __func__));
res = _FAIL;
}
diff --git a/drivers/staging/rtl8188eu/hal/phy.c 
b/drivers/staging/rtl8188eu/hal/phy.c
index 051cfbab78b1..51c40abfafaa 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -437,9 +437,9 @@ void 
rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
thermal_val = (u8)(thermal_avg / thermal_avg_count);
 
if (dm_odm->RFCalibrateInfo.bDoneTxpower &&
-   !dm_odm->RFCalibrateInfo.bReloadtxpowerindex)
+   !dm_odm->RFCalibrateInfo.bReloadtxpowerindex) {
delta = abs(thermal_val - 
dm_odm->RFCalibrateInfo.ThermalValue);
-   else {
+   } else {
delta = abs(thermal_val - hal_data->EEPROMThermalMeter);
if (dm_odm->RFCalibrateInfo.bReloadtxpowerindex) {
dm_odm->RFCalibrateInfo.bReloadtxpowerindex = 
false;
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
index b832bbf202a5..701136f6 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
@@ -90,15 +90,14 @@ static s32 FillH2CCmd_88E(struct adapter *adapt, u8 
ElementID, u32 CmdLen, u8 *p
 
/* Write Ext command */
msgbox_ex_addr = REG_HMEBOX_EXT_0 + (h2c_box_num * 
RTL88E_EX_MESSAGE_BOX_SIZE);
-   for (cmd_idx = 0; cmd_idx < ext_cmd_len; cmd_idx++) {
+   for (cmd_idx = 0; cmd_idx < ext_cmd_len; cmd_idx++)
usb_write8(adapt, msgbox_ex_addr+cmd_idx, *((u8 
*)(&h2c_cmd_ex)+cmd_idx));
-   }
}
/*  Write command */
msgbox_addr = REG_HMEBOX_0 + (h2c_box_num * 
RTL88E_MESSAGE_BOX_SIZE);
-   for (cmd_idx = 0; cmd_idx < RTL88E_MESSAGE_BOX_SIZE; cmd_idx++) 
{
+   for (cmd_idx = 0; cmd_idx < RTL88E_MESSAGE_BOX_SIZE; cmd_idx++)
usb_write8(adapt, msgbox_addr+cmd_idx, *((u8 
*)(&h2c_cmd)+cmd_idx));
-   }
+
bcmd_down = true;
 
adapt->HalData->LastHMEBoxNum =
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
index d5a1cf92ca6f..086f98d38cba 100644
--- a/drivers/staging/rtl8188eu/hal/rtl818

[PATCH v2 09/17] staging: rtl8188eu: remove redundant declaration in rtw_mlme_ext.c

2018-12-18 Thread Michael Straube
The array REALTEK_96B_IE is already declared in rtw_mlme.h,
so remove the declaration in rtw_mlme_ext.c.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index ca818887cbc6..30ebec6c32be 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -32,8 +32,6 @@ unsigned char WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 
0x01};
 unsigned char WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02};
 unsigned char RSN_TKIP_CIPHER[4] = {0x00, 0x0f, 0xac, 0x02};
 
-extern unsigned char REALTEK_96B_IE[];
-
 /
 MCS rate definitions
 */
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 12/17] staging: rtl8188eu: make some arrays static in rtw_mlme_ext.c

2018-12-18 Thread Michael Straube
Make some arrays that are only used in rtw_mlme_ext.c static and
remove the corresponding extern declarations from rtw_mlme_ext.h.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c| 6 +++---
 drivers/staging/rtl8188eu/include/rtw_mlme_ext.h | 5 -
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index ade4045bab45..30ae42c17796 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -23,11 +23,11 @@ static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
 OUI definitions for the vendor specific IE
 ***/
 const u8 RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
-const u8 WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
+static const u8 WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
 const u8 WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
-const u8 P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
+static const u8 P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
 
-const u8 WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
+static const u8 WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
 
 const u8 WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02};
 const u8 RSN_TKIP_CIPHER[4] = {0x00, 0x0f, 0xac, 0x02};
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h 
b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
index 08151a175d6e..1fb2349bd0a0 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
@@ -80,13 +80,8 @@
 #define_48M_RATE_  10
 #define_54M_RATE_  11
 
-
 extern const u8 RTW_WPA_OUI[];
-extern const u8 WMM_OUI[];
 extern const u8 WPS_OUI[];
-extern const u8 P2P_OUI[];
-
-extern const u8 WMM_PARA_OUI[];
 
 /*  Channel Plan Type. */
 /*  Note: */
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 11/17] staging: rtl8188eu: constify some arrays

2018-12-18 Thread Michael Straube
The values of these arrays in rtw_mlme_ext.c and rtw_wlan_util.c
are never changed, so make them const.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 14 +-
 .../staging/rtl8188eu/core/rtw_wlan_util.c| 26 +--
 drivers/staging/rtl8188eu/include/rtw_mlme.h  |  4 +--
 .../staging/rtl8188eu/include/rtw_mlme_ext.h  | 10 +++
 4 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index dd1280eb3355..ade4045bab45 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -22,15 +22,15 @@ static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
 /**
 OUI definitions for the vendor specific IE
 ***/
-u8 RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
-u8 WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
-u8 WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
-u8 P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
+const u8 RTW_WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
+const u8 WMM_OUI[] = {0x00, 0x50, 0xf2, 0x02};
+const u8 WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
+const u8 P2P_OUI[] = {0x50, 0x6F, 0x9A, 0x09};
 
-u8 WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
+const u8 WMM_PARA_OUI[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
 
-u8 WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02};
-u8 RSN_TKIP_CIPHER[4] = {0x00, 0x0f, 0xac, 0x02};
+const u8 WPA_TKIP_CIPHER[4] = {0x00, 0x50, 0xf2, 0x02};
+const u8 RSN_TKIP_CIPHER[4] = {0x00, 0x0f, 0xac, 0x02};
 
 /
 MCS rate definitions
diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c 
b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 484bb41b25cc..d18ce3a76c95 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -12,18 +12,18 @@
 #include 
 #include 
 
-static u8 ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f};
-static u8 ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
+static const u8 ARTHEROS_OUI1[] = {0x00, 0x03, 0x7f};
+static const u8 ARTHEROS_OUI2[] = {0x00, 0x13, 0x74};
 
-static u8 BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
-static u8 BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
+static const u8 BROADCOM_OUI1[] = {0x00, 0x10, 0x18};
+static const u8 BROADCOM_OUI2[] = {0x00, 0x0a, 0xf7};
 
-static u8 CISCO_OUI[] = {0x00, 0x40, 0x96};
-static u8 MARVELL_OUI[] = {0x00, 0x50, 0x43};
-static u8 RALINK_OUI[] = {0x00, 0x0c, 0x43};
-static u8 REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
-static u8 AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
-static u8 EPIGRAM_OUI[] = {0x00, 0x90, 0x4c};
+static const u8 CISCO_OUI[] = {0x00, 0x40, 0x96};
+static const u8 MARVELL_OUI[] = {0x00, 0x50, 0x43};
+static const u8 RALINK_OUI[] = {0x00, 0x0c, 0x43};
+static const u8 REALTEK_OUI[] = {0x00, 0xe0, 0x4c};
+static const u8 AIRGOCAP_OUI[] = {0x00, 0x0a, 0xf5};
+static const u8 EPIGRAM_OUI[] = {0x00, 0x90, 0x4c};
 
 u8 REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
 
@@ -33,20 +33,20 @@ u8 REALTEK_96B_IE[] = {0x00, 0xe0, 0x4c, 0x02, 0x01, 0x20};
 #define WAIT_FOR_BCN_TO_MIN(6000)
 #define WAIT_FOR_BCN_TO_MAX(2)
 
-static u8 rtw_basic_rate_cck[4] = {
+static const u8 rtw_basic_rate_cck[4] = {
IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK,
IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK,
IEEE80211_CCK_RATE_11MB | IEEE80211_BASIC_RATE_MASK
 };
 
-static u8 rtw_basic_rate_ofdm[3] = {
+static const u8 rtw_basic_rate_ofdm[3] = {
IEEE80211_OFDM_RATE_6MB | IEEE80211_BASIC_RATE_MASK,
IEEE80211_OFDM_RATE_12MB | IEEE80211_BASIC_RATE_MASK,
IEEE80211_OFDM_RATE_24MB | IEEE80211_BASIC_RATE_MASK
 };
 
-static u8 rtw_basic_rate_mix[7] = {
+static const u8 rtw_basic_rate_mix[7] = {
IEEE80211_CCK_RATE_1MB | IEEE80211_BASIC_RATE_MASK,
IEEE80211_CCK_RATE_2MB | IEEE80211_BASIC_RATE_MASK,
IEEE80211_CCK_RATE_5MB | IEEE80211_BASIC_RATE_MASK,
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme.h 
b/drivers/staging/rtl8188eu/include/rtw_mlme.h
index 090191fcae0a..bfef66525944 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme.h
@@ -211,8 +211,8 @@ int hostapd_mode_init(struct adapter *padapter);
 void hostapd_mode_unload(struct adapter *padapter);
 #endif
 
-extern u8 WPA_TKIP_CIPHER[4];
-extern u8 RSN_TKIP_CIPHER[4];
+extern const u8 WPA_TKIP_CIPHER[4];
+extern const u8 RSN_TKIP_CIPHER[4];
 extern u8 REALTEK_96B_IE[];
 extern const u8 MCS_rate_1R[16];
 
diff --git a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h 
b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
index a2d9d5307179..08151a175d6e 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mlme_ext.h
@@ -81,12 +81,12 @@
 #define   

Re: [PATCH v3 2/2] dt-bindings: net: dsa: ksz9477: add sample of switch bindings managed in i2c mode

2018-12-18 Thread Sergio Paracuellos
Hi Rob,

On Tue, Dec 18, 2018 at 4:10 PM Rob Herring  wrote:
>
> On Mon, Dec 17, 2018 at 09:44:23PM +0100, Sergio Paracuellos wrote:
> > Add device-tree binding example of the ksz9477 switch managed in i2c mode.
> >
> > Cc: devicet...@vger.kernel.org
> > Signed-off-by: Sergio Paracuellos 
> > ---
> > Changes v3:
> > - No changes. Just resent patches together.
> >
> > Changes v2:
> > - Use generic name for label of the switch and make sure reg and @X
> >   have the same value.
> >
> >  .../devicetree/bindings/net/dsa/ksz.txt   | 50 +++
> >  1 file changed, 50 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/net/dsa/ksz.txt 
> > b/Documentation/devicetree/bindings/net/dsa/ksz.txt
> > index 0f407fb371ce..d3c4b9d4f416 100644
> > --- a/Documentation/devicetree/bindings/net/dsa/ksz.txt
> > +++ b/Documentation/devicetree/bindings/net/dsa/ksz.txt
> > @@ -74,3 +74,53 @@ Ethernet switch connected via SPI to the host, CPU port 
> > wired to eth0:
> >   };
> >   };
> >   };
> > +
> > +Ethernet switch connected via I2C to the host, CPU port wired to eth0:
> > +
> > + eth0: ethernet@10001000 {
>
> Why do we have all this indentation? Please remove. And use tab chars,
> not spaces.

The original file format is using all of this indentation. So I think
we would need a patch to change de format of the original file and
another with this new changes properly formatted.

>
> > + fixed-link {
> > + speed = 
> > <1000>;
> > + full-duplex;
> > + };
> > + };
> > +
> > + i2c0: i2c@f8008000 {
> > + switch: ksz9897@5f {
> > + compatible = 
> > "microchip,ksz9897";
> > + reg = <5f>;
> > +
> > + ports {
> > +   
> >   #address-cells = <1>;
> > +   
> >   #size-cells = <0>;
> > +   
> >   port@0 {
> > +   
> >   reg = <0>;
> > +   
> >   label = "lan1";
> > +   
> >   };
> > +   
> >   port@1 {
> > +   
> >   reg = <1>;
> > +   
> >   label = "lan2";
> > +   
> >   };
> > +   
> >   port@2 {
> > +   
> >   reg = <2>;
> > +   
> >   label = "lan3";
> > +   
> >   };
> > +   
> >   port@3 {
> > +   
> >   reg = <3>;
> > +   
> >   label = "lan4";
> > +   
> >   };
> > +   
> >   port@4 {
> > +   
> >   reg = <4>;
> > +   
> >   label = "lan5";
> > +   
> >   };
> > +   
> >   port@6 {
> > +   
> >   reg = <6>;
> > +   
> >   label = "cpu";
> > + 

Re: [PATCH] staging: rtlwifi: Fix one line with over 80 chars.

2018-12-18 Thread Greg KH
On Tue, Dec 18, 2018 at 10:30:05AM -0500, Lei Zhou wrote:
> Add local temporary variable used as buffer to pass caller pointer into
> function ieee80211_connection_loss() to avoid over 80 characters on one
> line.
> 
> Signed-off-by: Lei Zhou 
> ---
>  drivers/staging/rtlwifi/base.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtlwifi/base.c b/drivers/staging/rtlwifi/base.c
> index 35df2cf..8bd1a78 100644
> --- a/drivers/staging/rtlwifi/base.c
> +++ b/drivers/staging/rtlwifi/base.c
> @@ -1979,6 +1979,7 @@ void rtl_watchdog_wq_callback(void *data)
>   struct rtl_priv *rtlpriv = rtl_priv(hw);
>   struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
>   struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
> + struct ieee80211_vif *vif = NULL;
>   bool busytraffic = false;
>   bool tx_busy_traffic = false;
>   bool rx_busy_traffic = false;
> @@ -2130,7 +2131,8 @@ void rtl_watchdog_wq_callback(void *data)
>   if (rtlpriv->link_info.roam_times >= 5) {
>   pr_err("AP off, try to reconnect now\n");
>   rtlpriv->link_info.roam_times = 0;
> - 
> ieee80211_connection_loss(rtlpriv->mac80211.vif);
> + vif = rtlpriv->mac80211.vif;
> + ieee80211_connection_loss(vif);

That really is not worth the effort to fix a line that is one character
"too big".  It's fine as-is.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 14/17] staging: rtl8188eu: simplify null array initializations

2018-12-18 Thread Greg KH
On Tue, Dec 18, 2018 at 07:34:48PM +0100, Michael Straube wrote:
> Simplfy initialization of null arrays to improve readability
> and save some lines.
> 
> Signed-off-by: Michael Straube 
> ---
>  drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 4 ++--
>  drivers/staging/rtl8188eu/core/rtw_xmit.c | 6 ++
>  2 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
> b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> index d3d211d8..2a42f80d1970 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> @@ -17,7 +17,7 @@
>  #include 
>  #include 
>  
> -static u8 null_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
> +static u8 null_addr[ETH_ALEN] = {};
>  
>  /**
>  OUI definitions for the vendor specific IE
> @@ -5207,7 +5207,7 @@ u8 setkey_hdl(struct adapter *padapter, u8 *pbuf)
>   struct setkey_parm *pparm = (struct setkey_parm *)pbuf;
>   struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
>   struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
> - u8 null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
> + u8 null_sta[ETH_ALEN] = {};

This just changed the type of the variable to a fixed size.  I'm
guessing it's ok, but it looks odd in a "cleanup patch"...

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 03/11] staging: bcm2835-camera: Move module info to the end

2018-12-18 Thread Peter Robinson
On Thu, Oct 25, 2018 at 4:30 PM Stefan Wahren  wrote:
>
> In order to have this more consistent between the vc04 services move
> the module information to the end of the file.
>
> Signed-off-by: Stefan Wahren 
Reviewed-by: Peter Robinson 
Tested-by: Peter Robinson 

Tested with a v2 camera module.

> ---
>  .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c| 12 
> ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c 
> b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index 7d3222c..cd773eb 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -43,12 +43,6 @@
>
>  #define MAX_BCM2835_CAMERAS 2
>
> -MODULE_DESCRIPTION("Broadcom 2835 MMAL video capture");
> -MODULE_AUTHOR("Vincent Sanders");
> -MODULE_LICENSE("GPL");
> -MODULE_VERSION(BM2835_MMAL_VERSION);
> -MODULE_ALIAS("platform:bcm2835-camera");
> -
>  int bcm2835_v4l2_debug;
>  module_param_named(debug, bcm2835_v4l2_debug, int, 0644);
>  MODULE_PARM_DESC(bcm2835_v4l2_debug, "Debug level 0-2");
> @@ -1976,3 +1970,9 @@ static struct platform_driver bcm2835_camera_driver = {
>  };
>
>  module_platform_driver(bcm2835_camera_driver)
> +
> +MODULE_DESCRIPTION("Broadcom 2835 MMAL video capture");
> +MODULE_AUTHOR("Vincent Sanders");
> +MODULE_LICENSE("GPL");
> +MODULE_VERSION(BM2835_MMAL_VERSION);
> +MODULE_ALIAS("platform:bcm2835-camera");
> --
> 2.7.4
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH RFC 02/11] staging: bcm2835-camera: fix module autoloading

2018-12-18 Thread Peter Robinson
On Thu, Oct 25, 2018 at 4:30 PM Stefan Wahren  wrote:
>
> In order to make the module bcm2835-camera load automatically, we need to
> add a module alias.
>
> Fixes: 4bebb0312ea9 ("staging/bcm2835-camera: Set ourselves up as a platform 
> driver.")
> Signed-off-by: Stefan Wahren 

Reviewed-by: Peter Robinson 
Tested-by: Peter Robinson 

Tested with a v2 camera module and kernel module loads automatically
as expected.

> ---
>  drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c 
> b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index d6fbef7..7d3222c 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -47,6 +47,7 @@ MODULE_DESCRIPTION("Broadcom 2835 MMAL video capture");
>  MODULE_AUTHOR("Vincent Sanders");
>  MODULE_LICENSE("GPL");
>  MODULE_VERSION(BM2835_MMAL_VERSION);
> +MODULE_ALIAS("platform:bcm2835-camera");
>
>  int bcm2835_v4l2_debug;
>  module_param_named(debug, bcm2835_v4l2_debug, int, 0644);
> --
> 2.7.4
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel