[PATCH] staging: lustre: lnet: remove dead code

2017-06-28 Thread Dmitriy Cherkasov
Remove code which was permanently disabled with ifdefs.

This also resolves the following checkpatch warning which was
triggered by the dead code:

WARNING: space prohibited before semicolon

Signed-off-by: Dmitriy Cherkasov 
---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h 
b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
index 5540de6..7c487fa 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h
@@ -521,13 +521,7 @@ struct ksock_proto {
 
 static inline __u32 ksocknal_csum(__u32 crc, unsigned char const *p, size_t 
len)
 {
-#if 1
return crc32_le(crc, p, len);
-#else
-   while (len-- > 0)
-   crc = ((crc + 0x100) & ~0xff) | ((crc + *p++) & 0xff) ;
-   return crc;
-#endif
 }
 
 static inline int
-- 
1.9.1

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


[PATCH] hv: fix msi affinity when device requests all possible CPU's

2017-06-28 Thread Stephen Hemminger
When Intel 10G (ixgbevf) is passed to a Hyper-V guest with SR-IOV,
the driver requests affinity with all possible CPU's (0-239) even
those CPU's are not online (and will never be). Because of this the device
is unable to correctly get MSI interrupt's setup.

This was caused by the change in 4.12 that converted this affinity
into all possible CPU's (0-31) but then host reports
an error since this is larger than the number of online cpu's.

Previously, this worked (up to 4.12-rc1) because only online cpu's
would be put in mask passed to the host.

This patch applies only to 4.12.
The driver in linux-next needs a a different fix because of the changes
to PCI host protocol version.

Fixes: 433fcf6b7b31 ("PCI: hv: Specify CPU_AFFINITY_ALL for MSI affinity when 
>= 32 CPUs")
Signed-off-by: Stephen Hemminger 
---
 drivers/pci/host/pci-hyperv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 84936383e269..3cadfcca3ae9 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -900,10 +900,12 @@ static void hv_compose_msi_msg(struct irq_data *data, 
struct msi_msg *msg)
 * processors because Hyper-V only supports 64 in a guest.
 */
affinity = irq_data_get_affinity_mask(data);
+   cpumask_and(affinity, affinity, cpu_online_mask);
+
if (cpumask_weight(affinity) >= 32) {
int_pkt->int_desc.cpu_mask = CPU_AFFINITY_ALL;
} else {
-   for_each_cpu_and(cpu, affinity, cpu_online_mask) {
+   for_each_cpu(cpu, affinity) {
int_pkt->int_desc.cpu_mask |=
(1ULL << vmbus_cpu_number_to_vp_number(cpu));
}
-- 
2.11.0

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


Re: [PATCH] staging: speakup: make function ser_to_dev static

2017-06-28 Thread Okash Khawaja
Hi,

On Wed, Jun 28, 2017 at 02:13:51PM +0100, Colin King wrote:
> From: Colin Ian King 
> 
> The helper function ser_to_dev does not need to be in global scope, so
> make it static.
> 
> Cleans up sparse warning:
> "warning: symbol 'ser_to_dev' was not declared. Should it be static?"
Thanks very much!

> 
> Signed-off-by: Colin Ian King 

Reviewed-by: Okash Khawaja 

> ---
>  drivers/staging/speakup/spk_ttyio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/speakup/spk_ttyio.c 
> b/drivers/staging/speakup/spk_ttyio.c
> index 442f191a017e..ed8e96b06ead 100644
> --- a/drivers/staging/speakup/spk_ttyio.c
> +++ b/drivers/staging/speakup/spk_ttyio.c
> @@ -21,7 +21,7 @@ struct spk_ldisc_data {
>  static struct spk_synth *spk_ttyio_synth;
>  static struct tty_struct *speakup_tty;
>  
> -int ser_to_dev(int ser, dev_t *dev_no)
> +static int ser_to_dev(int ser, dev_t *dev_no)
>  {
>   if (ser < 0 || ser > (255 - 64)) {
>   pr_err("speakup: Invalid ser param. Must be between 0 and 191 
> inclusive.\n");
> -- 
> 2.11.0
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] [media] staging/imx: remove confusing IS_ERR_OR_NULL usage

2017-06-28 Thread Arnd Bergmann
While looking at a compiler warning, I noticed the use of
IS_ERR_OR_NULL, which is generally a sign of a bad API design
and should be avoided.

In this driver, this is fairly easy, we can simply stop storing
error pointers in persistent structures, and change the one
function that might return either a NULL pointer or an error
code to consistently return error pointers when failing.

Fixes: e130291212df ("[media] media: Add i.MX media core driver")
Signed-off-by: Arnd Bergmann 
---
I can't reproduce the original warning any more, but this
patch still makes sense by itself.
---
 drivers/staging/media/imx/imx-ic-prpencvf.c | 41 -
 drivers/staging/media/imx/imx-media-csi.c   | 29 +++-
 drivers/staging/media/imx/imx-media-dev.c   |  2 +-
 drivers/staging/media/imx/imx-media-of.c|  2 +-
 drivers/staging/media/imx/imx-media-vdic.c  | 37 ++
 5 files changed, 61 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c 
b/drivers/staging/media/imx/imx-ic-prpencvf.c
index ed363fe3b3d0..7a9d9f32f989 100644
--- a/drivers/staging/media/imx/imx-ic-prpencvf.c
+++ b/drivers/staging/media/imx/imx-ic-prpencvf.c
@@ -134,19 +134,19 @@ static inline struct prp_priv *sd_to_priv(struct 
v4l2_subdev *sd)
 
 static void prp_put_ipu_resources(struct prp_priv *priv)
 {
-   if (!IS_ERR_OR_NULL(priv->ic))
+   if (priv->ic)
ipu_ic_put(priv->ic);
priv->ic = NULL;
 
-   if (!IS_ERR_OR_NULL(priv->out_ch))
+   if (priv->out_ch)
ipu_idmac_put(priv->out_ch);
priv->out_ch = NULL;
 
-   if (!IS_ERR_OR_NULL(priv->rot_in_ch))
+   if (priv->rot_in_ch)
ipu_idmac_put(priv->rot_in_ch);
priv->rot_in_ch = NULL;
 
-   if (!IS_ERR_OR_NULL(priv->rot_out_ch))
+   if (priv->rot_out_ch)
ipu_idmac_put(priv->rot_out_ch);
priv->rot_out_ch = NULL;
 }
@@ -154,43 +154,46 @@ static void prp_put_ipu_resources(struct prp_priv *priv)
 static int prp_get_ipu_resources(struct prp_priv *priv)
 {
struct imx_ic_priv *ic_priv = priv->ic_priv;
+   struct ipu_ic *ic;
+   struct ipuv3_channel *out_ch, *rot_in_ch, *rot_out_ch;
int ret, task = ic_priv->task_id;
 
priv->ipu = priv->md->ipu[ic_priv->ipu_id];
 
-   priv->ic = ipu_ic_get(priv->ipu, task);
-   if (IS_ERR(priv->ic)) {
+   ic = ipu_ic_get(priv->ipu, task);
+   if (IS_ERR(ic)) {
v4l2_err(_priv->sd, "failed to get IC\n");
-   ret = PTR_ERR(priv->ic);
+   ret = PTR_ERR(ic);
goto out;
}
+   priv->ic = ic;
 
-   priv->out_ch = ipu_idmac_get(priv->ipu,
-prp_channel[task].out_ch);
-   if (IS_ERR(priv->out_ch)) {
+   out_ch = ipu_idmac_get(priv->ipu, prp_channel[task].out_ch);
+   if (IS_ERR(out_ch)) {
v4l2_err(_priv->sd, "could not get IDMAC channel %u\n",
 prp_channel[task].out_ch);
-   ret = PTR_ERR(priv->out_ch);
+   ret = PTR_ERR(out_ch);
goto out;
}
+   priv->out_ch = out_ch;
 
-   priv->rot_in_ch = ipu_idmac_get(priv->ipu,
-   prp_channel[task].rot_in_ch);
-   if (IS_ERR(priv->rot_in_ch)) {
+   rot_in_ch = ipu_idmac_get(priv->ipu, prp_channel[task].rot_in_ch);
+   if (IS_ERR(rot_in_ch)) {
v4l2_err(_priv->sd, "could not get IDMAC channel %u\n",
 prp_channel[task].rot_in_ch);
-   ret = PTR_ERR(priv->rot_in_ch);
+   ret = PTR_ERR(rot_in_ch);
goto out;
}
+   priv->rot_in_ch = rot_in_ch;
 
-   priv->rot_out_ch = ipu_idmac_get(priv->ipu,
-prp_channel[task].rot_out_ch);
-   if (IS_ERR(priv->rot_out_ch)) {
+   rot_out_ch = ipu_idmac_get(priv->ipu, prp_channel[task].rot_out_ch);
+   if (IS_ERR(rot_out_ch)) {
v4l2_err(_priv->sd, "could not get IDMAC channel %u\n",
 prp_channel[task].rot_out_ch);
-   ret = PTR_ERR(priv->rot_out_ch);
+   ret = PTR_ERR(rot_out_ch);
goto out;
}
+   priv->rot_out_ch = rot_out_ch;
 
return 0;
 out:
diff --git a/drivers/staging/media/imx/imx-media-csi.c 
b/drivers/staging/media/imx/imx-media-csi.c
index a2d26693912e..a4b3c305dcc8 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -122,11 +122,11 @@ static inline struct csi_priv *sd_to_dev(struct 
v4l2_subdev *sdev)
 
 static void csi_idmac_put_ipu_resources(struct csi_priv *priv)
 {
-   if (!IS_ERR_OR_NULL(priv->idmac_ch))
+   if (priv->idmac_ch)
ipu_idmac_put(priv->idmac_ch);
priv->idmac_ch = NULL;
 
-   if (!IS_ERR_OR_NULL(priv->smfc))
+   if (priv->smfc)
  

[PATCH] staging: ks7010: fix spelling mistake: "errror" -> "error"

2017-06-28 Thread Colin King
From: Colin Ian King 

Trivial fix to spelling mistake in netdev_err message

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

diff --git a/drivers/staging/ks7010/ks_wlan_net.c 
b/drivers/staging/ks7010/ks_wlan_net.c
index 0c778aa4bb7a..8aa12e813bd7 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2273,7 +2273,7 @@ static int ks_wlan_set_sleep_mode(struct net_device *dev,
netdev_info(dev, "SET_SLEEP_MODE %d\n", priv->sleep_mode);
hostif_sme_enqueue(priv, SME_SLEEP_REQUEST);
} else {
-   netdev_err(dev, "SET_SLEEP_MODE %d errror\n", *uwrq);
+   netdev_err(dev, "SET_SLEEP_MODE %d error\n", *uwrq);
return -EINVAL;
}
 
-- 
2.11.0

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


Re: [PATCH] staging: speakup: make function ser_to_dev static

2017-06-28 Thread Samuel Thibault
walter harms, on mer. 28 juin 2017 16:49:03 +0200, wrote:
> Am 28.06.2017 15:13, schrieb Colin King:
> > diff --git a/drivers/staging/speakup/spk_ttyio.c 
> > b/drivers/staging/speakup/spk_ttyio.c
> > index 442f191a017e..ed8e96b06ead 100644
> > --- a/drivers/staging/speakup/spk_ttyio.c
> > +++ b/drivers/staging/speakup/spk_ttyio.c
> > @@ -21,7 +21,7 @@ struct spk_ldisc_data {
> >  static struct spk_synth *spk_ttyio_synth;
> >  static struct tty_struct *speakup_tty;
> >  
> > -int ser_to_dev(int ser, dev_t *dev_no)
> > +static int ser_to_dev(int ser, dev_t *dev_no)
> >  {
> > if (ser < 0 || ser > (255 - 64)) {
> > pr_err("speakup: Invalid ser param. Must be between 0 and 191 
> > inclusive.\n");
> 
> 
> Is there any remark, why the programmer decided to use (255 - 64) instead of 
> 191 ?

That's because minor numbers for ttyS* are starting from 64.

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


Re: [PATCH] staging: speakup: make function ser_to_dev static

2017-06-28 Thread walter harms


Am 28.06.2017 15:13, schrieb Colin King:
> From: Colin Ian King 
> 
> The helper function ser_to_dev does not need to be in global scope, so
> make it static.
> 
> Cleans up sparse warning:
> "warning: symbol 'ser_to_dev' was not declared. Should it be static?"
> 
> Signed-off-by: Colin Ian King 
> ---
>  drivers/staging/speakup/spk_ttyio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/speakup/spk_ttyio.c 
> b/drivers/staging/speakup/spk_ttyio.c
> index 442f191a017e..ed8e96b06ead 100644
> --- a/drivers/staging/speakup/spk_ttyio.c
> +++ b/drivers/staging/speakup/spk_ttyio.c
> @@ -21,7 +21,7 @@ struct spk_ldisc_data {
>  static struct spk_synth *spk_ttyio_synth;
>  static struct tty_struct *speakup_tty;
>  
> -int ser_to_dev(int ser, dev_t *dev_no)
> +static int ser_to_dev(int ser, dev_t *dev_no)
>  {
>   if (ser < 0 || ser > (255 - 64)) {
>   pr_err("speakup: Invalid ser param. Must be between 0 and 191 
> inclusive.\n");


Is there any remark, why the programmer decided to use (255 - 64) instead of 
191 ?

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


[PATCH] staging: speakup: make function ser_to_dev static

2017-06-28 Thread Colin King
From: Colin Ian King 

The helper function ser_to_dev does not need to be in global scope, so
make it static.

Cleans up sparse warning:
"warning: symbol 'ser_to_dev' was not declared. Should it be static?"

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

diff --git a/drivers/staging/speakup/spk_ttyio.c 
b/drivers/staging/speakup/spk_ttyio.c
index 442f191a017e..ed8e96b06ead 100644
--- a/drivers/staging/speakup/spk_ttyio.c
+++ b/drivers/staging/speakup/spk_ttyio.c
@@ -21,7 +21,7 @@ struct spk_ldisc_data {
 static struct spk_synth *spk_ttyio_synth;
 static struct tty_struct *speakup_tty;
 
-int ser_to_dev(int ser, dev_t *dev_no)
+static int ser_to_dev(int ser, dev_t *dev_no)
 {
if (ser < 0 || ser > (255 - 64)) {
pr_err("speakup: Invalid ser param. Must be between 0 and 191 
inclusive.\n");
-- 
2.11.0

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


Re: [PATCH v4] staging: vboxvideo: Add vboxvideo to drivers/staging

2017-06-28 Thread Daniel Vetter
On Wed, Jun 28, 2017 at 2:46 PM, Hans de Goede  wrote:
> On 27-06-17 06:25, kbuild test robot wrote:
>>
>> Hi Hans,
>>
>> [auto build test ERROR on staging/staging-testing]
>> [also build test ERROR on v4.12-rc7 next-20170626]
>> [if your patch is applied to the wrong git tree, please drop us a note to
>> help improve the system]
>>
>> url:
>> https://github.com/0day-ci/linux/commits/Hans-de-Goede/staging-vboxvideo-Add-vboxvideo-to-drivers-staging/20170627-035353
>> config: x86_64-randconfig-n0-06270721 (attached as .config)
>> compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
>> reproduce:
>>  # save the attached .config to linux build tree
>>  make ARCH=x86_64
>>
>> All errors (new ones prefixed by >>):
>>
 ERROR: "framebuffer_release" [drivers/staging/vboxvideo/vboxvideo.ko]
 undefined!
 ERROR: "fb_set_suspend" [drivers/staging/vboxvideo/vboxvideo.ko]
 undefined!
 ERROR: "fb_dealloc_cmap" [drivers/staging/vboxvideo/vboxvideo.ko]
 undefined!
 ERROR: "unregister_framebuffer" [drivers/staging/vboxvideo/vboxvideo.ko]
 undefined!
>
>
> Hmm, this is likely caused by building with a Kconfig with FBDEV disabled.
>
> The attached patch should fix this. I will send out a v5 with this squashed
> in later
> today.

If you use the drm fbdev helper library (all of it) then this should
all Just Work. Calling any fb core function from a drm driver directly
is a bug most likely.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rts5208 : Fixing coding style warnings

2017-06-28 Thread Frans Klaver
Hi,

On Wed, Jun 28, 2017 at 2:50 PM, Simo Koskinen  wrote:
> Fixed following warnings found by checkpatch.pl script:
>
> WARNING: Prefer using '"%s...", __func__' to using '',
> this function's name, in a string
>
> Signed-off-by: Simo Koskinen 
> ---
>  drivers/staging/rts5208/rtsx.c  |  2 --
>  drivers/staging/rts5208/rtsx_chip.c |  4 ++--
>  drivers/staging/rts5208/sd.c|  8 
>  drivers/staging/rts5208/spi.c   |  8 
>  drivers/staging/rts5208/xd.c| 11 ++-
>  5 files changed, 16 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
> index b8177f5..c7ae702 100644
> --- a/drivers/staging/rts5208/rtsx.c
> +++ b/drivers/staging/rts5208/rtsx.c
> @@ -1009,8 +1009,6 @@ static void rtsx_remove(struct pci_dev *pci)
>  {
> struct rtsx_dev *dev = pci_get_drvdata(pci);
>
> -   dev_info(>dev, "rtsx_remove() called\n");
> -
> quiesce_and_remove_host(dev);
> release_everything(dev);
>  }
> diff --git a/drivers/staging/rts5208/rtsx_chip.c 
> b/drivers/staging/rts5208/rtsx_chip.c
> index 7f4107b..4ad472d 100644
> --- a/drivers/staging/rts5208/rtsx_chip.c
> +++ b/drivers/staging/rts5208/rtsx_chip.c
> @@ -616,8 +616,8 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
> else
> retval = rtsx_pre_handle_sdio_new(chip);
>
> -   dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x 
> (rtsx_reset_chip)\n",
> -   (unsigned int)(chip->need_reset));
> +   dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (%s)\n",
> +   (unsigned int)(chip->need_reset), __func__);
>  #else  /* HW_AUTO_SWITCH_SD_BUS */
> retval = rtsx_pre_handle_sdio_old(chip);
>  #endif  /* HW_AUTO_SWITCH_SD_BUS */
> diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
> index c2eb072..ae774ff 100644
> --- a/drivers/staging/rts5208/sd.c
> +++ b/drivers/staging/rts5208/sd.c
> @@ -910,8 +910,8 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 
> sample_point, u8 tune_dir)
> int retval;
> bool ddr_rx = false;
>
> -   dev_dbg(rtsx_dev(chip), "sd_change_phase (sample_point = %d, tune_dir 
> = %d)\n",
> -   sample_point, tune_dir);
> +   dev_dbg(rtsx_dev(chip), "%s (sample_point = %d, tune_dir = %d)\n",
> +   __func__, sample_point, tune_dir);
>
> if (tune_dir == TUNE_RX) {
> SD_VP_CTL = SD_VPRX_CTL;
> @@ -3575,8 +3575,8 @@ static int reset_mmc_only(struct rtsx_chip *chip)
> return STATUS_FAIL;
> }
>
> -   dev_dbg(rtsx_dev(chip), "In reset_mmc_only, sd_card->sd_type = 
> 0x%x\n",
> -   sd_card->sd_type);
> +   dev_dbg(rtsx_dev(chip), "In %s, sd_card->sd_type = 0x%x\n",
> +   __func__, sd_card->sd_type);
>
> return STATUS_SUCCESS;
>  }
> diff --git a/drivers/staging/rts5208/spi.c b/drivers/staging/rts5208/spi.c
> index 8b8cd95..feb9c2b 100644
> --- a/drivers/staging/rts5208/spi.c
> +++ b/drivers/staging/rts5208/spi.c
> @@ -520,8 +520,8 @@ int spi_get_status(struct scsi_cmnd *srb, struct 
> rtsx_chip *chip)
>  {
> struct spi_info *spi = >spi;
>
> -   dev_dbg(rtsx_dev(chip), "spi_get_status: err_code = 0x%x\n",
> -   spi->err_code);
> +   dev_dbg(rtsx_dev(chip), "%s: err_code = 0x%x\n",
> +   __func__, spi->err_code);
> rtsx_stor_set_xfer_buf(>err_code,
>min_t(int, scsi_bufflen(srb), 1), srb);
> scsi_set_resid(srb, scsi_bufflen(srb) - 1);
> @@ -543,8 +543,8 @@ int spi_set_parameter(struct scsi_cmnd *srb, struct 
> rtsx_chip *chip)
> spi->clk_div = ((u16)(srb->cmnd[4]) << 8) | srb->cmnd[5];
> spi->write_en = srb->cmnd[6];
>
> -   dev_dbg(rtsx_dev(chip), "spi_set_parameter: spi_clock = %d, clk_div = 
> %d, write_en = %d\n",
> -   spi->spi_clock, spi->clk_div, spi->write_en);
> +   dev_dbg(rtsx_dev(chip), "%s: spi_clock = %d, clk_div = %d, write_en = 
> %d\n",
> +   __func__, spi->spi_clock, spi->clk_div, spi->write_en);
>
> return STATUS_SUCCESS;
>  }
> diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c
> index 74d36f9..dc0baf0 100644
> --- a/drivers/staging/rts5208/xd.c
> +++ b/drivers/staging/rts5208/xd.c
> @@ -885,8 +885,8 @@ static int xd_init_l2p_tbl(struct rtsx_chip *chip)
> struct xd_info *xd_card = >xd_card;
> int size, i;
>
> -   dev_dbg(rtsx_dev(chip), "xd_init_l2p_tbl: zone_cnt = %d\n",
> -   xd_card->zone_cnt);
> +   dev_dbg(rtsx_dev(chip), "%s: zone_cnt = %d\n",
> +   __func__, xd_card->zone_cnt);
>
> if (xd_card->zone_cnt < 1) {
> rtsx_trace(chip);
> @@ -1026,7 +1026,8 @@ static u32 xd_get_l2p_tbl(struct rtsx_chip *chip, int 
> zone_no, u16 log_off)
>  #ifdef XD_DELAY_WRITE
>   

Re: [PATCH] staging: rts5208 : Fixing coding style warnings

2017-06-28 Thread Greg KH
On Wed, Jun 28, 2017 at 02:50:12PM +0200, Simo Koskinen wrote:
> Fixed following warnings found by checkpatch.pl script:
> 
> WARNING: Prefer using '"%s...", __func__' to using '',
> this function's name, in a string
> 
> Signed-off-by: Simo Koskinen 

Is this different from a previous patch?  If so, you need to properly
version your patch, as the documentation descripts how to do.

> ---
>  drivers/staging/rts5208/rtsx.c  |  2 --
>  drivers/staging/rts5208/rtsx_chip.c |  4 ++--
>  drivers/staging/rts5208/sd.c|  8 
>  drivers/staging/rts5208/spi.c   |  8 
>  drivers/staging/rts5208/xd.c| 11 ++-
>  5 files changed, 16 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
> index b8177f5..c7ae702 100644
> --- a/drivers/staging/rts5208/rtsx.c
> +++ b/drivers/staging/rts5208/rtsx.c
> @@ -1009,8 +1009,6 @@ static void rtsx_remove(struct pci_dev *pci)
>  {
>   struct rtsx_dev *dev = pci_get_drvdata(pci);
>  
> - dev_info(>dev, "rtsx_remove() called\n");
> -

This change does not match up with the changelog text :(

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


[PATCH] staging: rts5208 : Fixing coding style warnings

2017-06-28 Thread Simo Koskinen
Fixed following warnings found by checkpatch.pl script:

WARNING: Prefer using '"%s...", __func__' to using '',
this function's name, in a string

Signed-off-by: Simo Koskinen 
---
 drivers/staging/rts5208/rtsx.c  |  2 --
 drivers/staging/rts5208/rtsx_chip.c |  4 ++--
 drivers/staging/rts5208/sd.c|  8 
 drivers/staging/rts5208/spi.c   |  8 
 drivers/staging/rts5208/xd.c| 11 ++-
 5 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index b8177f5..c7ae702 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -1009,8 +1009,6 @@ static void rtsx_remove(struct pci_dev *pci)
 {
struct rtsx_dev *dev = pci_get_drvdata(pci);
 
-   dev_info(>dev, "rtsx_remove() called\n");
-
quiesce_and_remove_host(dev);
release_everything(dev);
 }
diff --git a/drivers/staging/rts5208/rtsx_chip.c 
b/drivers/staging/rts5208/rtsx_chip.c
index 7f4107b..4ad472d 100644
--- a/drivers/staging/rts5208/rtsx_chip.c
+++ b/drivers/staging/rts5208/rtsx_chip.c
@@ -616,8 +616,8 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
else
retval = rtsx_pre_handle_sdio_new(chip);
 
-   dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x 
(rtsx_reset_chip)\n",
-   (unsigned int)(chip->need_reset));
+   dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (%s)\n",
+   (unsigned int)(chip->need_reset), __func__);
 #else  /* HW_AUTO_SWITCH_SD_BUS */
retval = rtsx_pre_handle_sdio_old(chip);
 #endif  /* HW_AUTO_SWITCH_SD_BUS */
diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index c2eb072..ae774ff 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -910,8 +910,8 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 
sample_point, u8 tune_dir)
int retval;
bool ddr_rx = false;
 
-   dev_dbg(rtsx_dev(chip), "sd_change_phase (sample_point = %d, tune_dir = 
%d)\n",
-   sample_point, tune_dir);
+   dev_dbg(rtsx_dev(chip), "%s (sample_point = %d, tune_dir = %d)\n",
+   __func__, sample_point, tune_dir);
 
if (tune_dir == TUNE_RX) {
SD_VP_CTL = SD_VPRX_CTL;
@@ -3575,8 +3575,8 @@ static int reset_mmc_only(struct rtsx_chip *chip)
return STATUS_FAIL;
}
 
-   dev_dbg(rtsx_dev(chip), "In reset_mmc_only, sd_card->sd_type = 0x%x\n",
-   sd_card->sd_type);
+   dev_dbg(rtsx_dev(chip), "In %s, sd_card->sd_type = 0x%x\n",
+   __func__, sd_card->sd_type);
 
return STATUS_SUCCESS;
 }
diff --git a/drivers/staging/rts5208/spi.c b/drivers/staging/rts5208/spi.c
index 8b8cd95..feb9c2b 100644
--- a/drivers/staging/rts5208/spi.c
+++ b/drivers/staging/rts5208/spi.c
@@ -520,8 +520,8 @@ int spi_get_status(struct scsi_cmnd *srb, struct rtsx_chip 
*chip)
 {
struct spi_info *spi = >spi;
 
-   dev_dbg(rtsx_dev(chip), "spi_get_status: err_code = 0x%x\n",
-   spi->err_code);
+   dev_dbg(rtsx_dev(chip), "%s: err_code = 0x%x\n",
+   __func__, spi->err_code);
rtsx_stor_set_xfer_buf(>err_code,
   min_t(int, scsi_bufflen(srb), 1), srb);
scsi_set_resid(srb, scsi_bufflen(srb) - 1);
@@ -543,8 +543,8 @@ int spi_set_parameter(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
spi->clk_div = ((u16)(srb->cmnd[4]) << 8) | srb->cmnd[5];
spi->write_en = srb->cmnd[6];
 
-   dev_dbg(rtsx_dev(chip), "spi_set_parameter: spi_clock = %d, clk_div = 
%d, write_en = %d\n",
-   spi->spi_clock, spi->clk_div, spi->write_en);
+   dev_dbg(rtsx_dev(chip), "%s: spi_clock = %d, clk_div = %d, write_en = 
%d\n",
+   __func__, spi->spi_clock, spi->clk_div, spi->write_en);
 
return STATUS_SUCCESS;
 }
diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c
index 74d36f9..dc0baf0 100644
--- a/drivers/staging/rts5208/xd.c
+++ b/drivers/staging/rts5208/xd.c
@@ -885,8 +885,8 @@ static int xd_init_l2p_tbl(struct rtsx_chip *chip)
struct xd_info *xd_card = >xd_card;
int size, i;
 
-   dev_dbg(rtsx_dev(chip), "xd_init_l2p_tbl: zone_cnt = %d\n",
-   xd_card->zone_cnt);
+   dev_dbg(rtsx_dev(chip), "%s: zone_cnt = %d\n",
+   __func__, xd_card->zone_cnt);
 
if (xd_card->zone_cnt < 1) {
rtsx_trace(chip);
@@ -1026,7 +1026,8 @@ static u32 xd_get_l2p_tbl(struct rtsx_chip *chip, int 
zone_no, u16 log_off)
 #ifdef XD_DELAY_WRITE
retval = xd_delay_write(chip);
if (retval != STATUS_SUCCESS) {
-   dev_dbg(rtsx_dev(chip), "In xd_get_l2p_tbl, delay write 
fail!\n");
+   dev_dbg(rtsx_dev(chip), "In %s, delay write fail!\n",
+   

Re: [PATCH v4] staging: vboxvideo: Add vboxvideo to drivers/staging

2017-06-28 Thread Hans de Goede

Hi Michael,

On 27-06-17 06:25, kbuild test robot wrote:

Hi Hans,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.12-rc7 next-20170626]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Hans-de-Goede/staging-vboxvideo-Add-vboxvideo-to-drivers-staging/20170627-035353
config: x86_64-randconfig-n0-06270721 (attached as .config)
compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
reproduce:
 # save the attached .config to linux build tree
 make ARCH=x86_64

All errors (new ones prefixed by >>):


ERROR: "framebuffer_release" [drivers/staging/vboxvideo/vboxvideo.ko] undefined!
ERROR: "fb_set_suspend" [drivers/staging/vboxvideo/vboxvideo.ko] undefined!
ERROR: "fb_dealloc_cmap" [drivers/staging/vboxvideo/vboxvideo.ko] undefined!
ERROR: "unregister_framebuffer" [drivers/staging/vboxvideo/vboxvideo.ko] 
undefined!


Hmm, this is likely caused by building with a Kconfig with FBDEV disabled.

The attached patch should fix this. I will send out a v5 with this squashed in 
later
today.

Regards,

Hans
>From 6bdabcb9945fcd7bfe8424c60f506a147348e6be Mon Sep 17 00:00:00 2001
From: Hans de Goede 
Date: Wed, 28 Jun 2017 14:40:58 +0200
Subject: [PATCH] staging/vboxvideo: Use various drm_fb_helper funcs instead of
 DIY code

Besides being a nice cleanup, this fixes vobxvideo not building when
fbdev support is disabled in the Kconfig.

Signed-off-by: Hans de Goede 
---
 drivers/staging/vboxvideo/vbox_drv.c | 13 ++---
 drivers/staging/vboxvideo/vbox_drv.h |  1 -
 drivers/staging/vboxvideo/vbox_fb.c  | 16 +---
 3 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/vboxvideo/vbox_drv.c b/drivers/staging/vboxvideo/vbox_drv.c
index 05c973db77a4..92ae1560a16d 100644
--- a/drivers/staging/vboxvideo/vbox_drv.c
+++ b/drivers/staging/vboxvideo/vbox_drv.c
@@ -63,25 +63,24 @@ static void vbox_pci_remove(struct pci_dev *pdev)
 
 static int vbox_drm_freeze(struct drm_device *dev)
 {
+	struct vbox_private *vbox = dev->dev_private;
+
 	drm_kms_helper_poll_disable(dev);
 
 	pci_save_state(dev->pdev);
 
-	console_lock();
-	vbox_fbdev_set_suspend(dev, 1);
-	console_unlock();
+	drm_fb_helper_set_suspend_unlocked(>fbdev->helper, true);
 
 	return 0;
 }
 
 static int vbox_drm_thaw(struct drm_device *dev)
 {
+	struct vbox_private *vbox = dev->dev_private;
+
 	drm_mode_config_reset(dev);
 	drm_helper_resume_force_mode(dev);
-
-	console_lock();
-	vbox_fbdev_set_suspend(dev, 0);
-	console_unlock();
+	drm_fb_helper_set_suspend_unlocked(>fbdev->helper, false);
 
 	return 0;
 }
diff --git a/drivers/staging/vboxvideo/vbox_drv.h b/drivers/staging/vboxvideo/vbox_drv.h
index 10da2232079b..4b9302703b36 100644
--- a/drivers/staging/vboxvideo/vbox_drv.h
+++ b/drivers/staging/vboxvideo/vbox_drv.h
@@ -198,7 +198,6 @@ int vbox_framebuffer_init(struct drm_device *dev,
 
 int vbox_fbdev_init(struct drm_device *dev);
 void vbox_fbdev_fini(struct drm_device *dev);
-void vbox_fbdev_set_suspend(struct drm_device *dev, int state);
 void vbox_fbdev_set_base(struct vbox_private *vbox, unsigned long gpu_addr);
 
 struct vbox_bo {
diff --git a/drivers/staging/vboxvideo/vbox_fb.c b/drivers/staging/vboxvideo/vbox_fb.c
index 3b2657d3b29c..35f6d9f8c203 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -341,15 +341,8 @@ void vbox_fbdev_fini(struct drm_device *dev)
 	struct vbox_private *vbox = dev->dev_private;
 	struct vbox_fbdev *fbdev = vbox->fbdev;
 	struct vbox_framebuffer *afb = >afb;
-	struct fb_info *info;
 
-	if (fbdev->helper.fbdev) {
-		info = fbdev->helper.fbdev;
-		unregister_framebuffer(info);
-		if (info->cmap.len)
-			fb_dealloc_cmap(>cmap);
-		framebuffer_release(info);
-	}
+	drm_fb_helper_unregister_fbi(>helper);
 
 	if (afb->obj) {
 		struct vbox_bo *bo = gem_to_vbox_bo(afb->obj);
@@ -410,13 +403,6 @@ int vbox_fbdev_init(struct drm_device *dev)
 	return ret;
 }
 
-void vbox_fbdev_set_suspend(struct drm_device *dev, int state)
-{
-	struct vbox_private *vbox = dev->dev_private;
-
-	fb_set_suspend(vbox->fbdev->helper.fbdev, state);
-}
-
 void vbox_fbdev_set_base(struct vbox_private *vbox, unsigned long gpu_addr)
 {
 	struct fb_info *fbdev = vbox->fbdev->helper.fbdev;
-- 
2.13.0

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


Re: [PATCH 4/4] Staging: rtl8712 : ieee80211.c: fixed camelcase coding

2017-06-28 Thread Dan Carpenter
On Tue, Jun 27, 2017 at 05:13:39PM +0530, Jaya Durga wrote:
> diff --git a/drivers/staging/rtl8712/osdep_intf.h 
> b/drivers/staging/rtl8712/osdep_intf.h
> index 1985423..dac6aed 100644
> --- a/drivers/staging/rtl8712/osdep_intf.h
> +++ b/drivers/staging/rtl8712/osdep_intf.h
> @@ -29,7 +29,10 @@
>  #include "osdep_service.h"
>  #include "drv_types.h"
>  
> -#define RND4(x)  x) >> 2) + x) & 3) == 0) ?  0 : 1)) << 2)
> +static inline unsigned int RND4(unsigned int x)
> +{
> + return (((x >> 2) + (((x & 3) == 0) ?  0 : 1)) << 2);
> +}
> 

Don't mix unrelated stuff.

regards,
dan carpenter


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


Re: [PATCH] staging: rts5208 : Fixing coding style warnings

2017-06-28 Thread Greg KH
On Wed, Jun 28, 2017 at 11:15:09AM +0200, Simo Koskinen wrote:
> Fixed following warnings found by checkpatch.pl script:
> 
> WARNING: Prefer using '"%s...", __func__' to using '',
> this function's name, in a string
> 
> Signed-off-by: Simo Koskinen 
> ---
>  drivers/staging/rts5208/rtsx.c  |  2 +-
>  drivers/staging/rts5208/rtsx_chip.c |  5 +++--
>  drivers/staging/rts5208/sd.c|  8 +---
>  drivers/staging/rts5208/spi.c   |  9 +
>  drivers/staging/rts5208/xd.c| 11 ++-
>  5 files changed, 20 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
> index b8177f5..6c7485f 100644
> --- a/drivers/staging/rts5208/rtsx.c
> +++ b/drivers/staging/rts5208/rtsx.c
> @@ -1009,7 +1009,7 @@ static void rtsx_remove(struct pci_dev *pci)
>  {
>   struct rtsx_dev *dev = pci_get_drvdata(pci);
>  
> - dev_info(>dev, "rtsx_remove() called\n");
> + dev_info(>dev, "%s() called\n", __func__);

This should just be removed entirely, ftrace provides this functionality
if a developer really needs it.

>  
>   quiesce_and_remove_host(dev);
>   release_everything(dev);
> diff --git a/drivers/staging/rts5208/rtsx_chip.c 
> b/drivers/staging/rts5208/rtsx_chip.c
> index 7f4107b..4895579 100644
> --- a/drivers/staging/rts5208/rtsx_chip.c
> +++ b/drivers/staging/rts5208/rtsx_chip.c
> @@ -616,8 +616,9 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
>   else
>   retval = rtsx_pre_handle_sdio_new(chip);
>  
> - dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x 
> (rtsx_reset_chip)\n",
> - (unsigned int)(chip->need_reset));
> + dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (%s)\n",
> + (unsigned int)(chip->need_reset),
> + __func__);
>  #else  /* HW_AUTO_SWITCH_SD_BUS */
>   retval = rtsx_pre_handle_sdio_old(chip);
>  #endif  /* HW_AUTO_SWITCH_SD_BUS */
> diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
> index c2eb072..e3a92b0 100644
> --- a/drivers/staging/rts5208/sd.c
> +++ b/drivers/staging/rts5208/sd.c
> @@ -910,7 +910,8 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 
> sample_point, u8 tune_dir)
>   int retval;
>   bool ddr_rx = false;
>  
> - dev_dbg(rtsx_dev(chip), "sd_change_phase (sample_point = %d, tune_dir = 
> %d)\n",
> + dev_dbg(rtsx_dev(chip), "%s (sample_point = %d, tune_dir = %d)\n",
> + __func__,
>   sample_point, tune_dir);

Please use your brain when making these changes.  Does that look correct
now?  Hint, it isn't, please merge with the next line...

> @@ -3575,8 +3576,9 @@ static int reset_mmc_only(struct rtsx_chip *chip)
>   return STATUS_FAIL;
>   }
>  
> - dev_dbg(rtsx_dev(chip), "In reset_mmc_only, sd_card->sd_type = 0x%x\n",
> - sd_card->sd_type);
> + dev_dbg(rtsx_dev(chip), "In %s, sd_card->sd_type = 0x%x\n",
> + __func__,
> + sd_card->sd_type);

Same here.  Really, look at what you are doing...

> - dev_dbg(rtsx_dev(chip), "spi_get_status: err_code = 0x%x\n",
> - spi->err_code);
> + dev_dbg(rtsx_dev(chip), "%s: err_code = 0x%x\n",
> + __func__,
> + spi->err_code);

And again...

Please fix up the whole patch and resend.

thanks,

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


Re: [PATCH 0/2] staging: ccree: Fix coding style and remove warnings

2017-06-28 Thread Gilad Ben-Yossef
Thank you Karthik,

On Wed, Jun 28, 2017 at 12:37 PM,   wrote:
> From: Karthik Tummala 
>
> This patch series fixes coding style and removes the following
> checkpatch.pl warnings:
>
> Prefer using '"%s...", __func__' to using the function's name,
> in a string.

This one is good.
>
> Braces {} are not necessary for single statement blocks.

I have already sent a patch addressing this and some other things
yesterday/

>
> Rebased on top of next-20170627.
> Patches were tested and built on next-20170627

Can you please check patch 1 still applies after yesterdays patch series?

>
> Karthik Tummala (2):
>   staging: ccree: Use __func__ instead of function name
>   staging: ccree: Remove braces {} for single statement blocks
>
>  drivers/staging/ccree/ssi_aead.c | 48 
> 
>  1 file changed, 19 insertions(+), 29 deletions(-)
>
> --
> 1.9.1
>

Thanks,
Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: ccree: Remove braces {} for single statement blocks

2017-06-28 Thread karthik
From: Karthik Tummala 

Fixed following checkpatch.pl warning:
WARNING: braces {} are not necessary for single
statement blocks.

Signed-off-by: Karthik Tummala 
---
 drivers/staging/ccree/ssi_aead.c | 38 ++
 1 file changed, 14 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c
index 4004d69..1a4664f 100644
--- a/drivers/staging/ccree/ssi_aead.c
+++ b/drivers/staging/ccree/ssi_aead.c
@@ -243,11 +243,10 @@ static void ssi_aead_complete(struct device *dev, void 
*ssi_req, void __iomem *c
 
/* If an IV was generated, copy it back to the user provided 
buffer. */
if (areq_ctx->backup_giv != NULL) {
-   if (ctx->cipher_mode == DRV_CIPHER_CTR) {
+   if (ctx->cipher_mode == DRV_CIPHER_CTR)
memcpy(areq_ctx->backup_giv, areq_ctx->ctr_iv + 
CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_IV_SIZE);
-   } else if (ctx->cipher_mode == DRV_CIPHER_CCM) {
+   else if (ctx->cipher_mode == DRV_CIPHER_CCM)
memcpy(areq_ctx->backup_giv, areq_ctx->ctr_iv + 
CCM_BLOCK_IV_OFFSET, CCM_BLOCK_IV_SIZE);
-   }
}
}
 
@@ -521,9 +520,8 @@ static int validate_keys_sizes(struct ssi_aead_ctx *ctx)
if (unlikely(rc != 0))
SSI_LOG_ERR("send_request() failed (rc=%d)\n", rc);
 
-   if (likely(key_dma_addr != 0)) {
+   if (likely(key_dma_addr != 0))
dma_unmap_single(dev, key_dma_addr, keylen, DMA_TO_DEVICE);
-   }
 
return rc;
 }
@@ -928,11 +926,10 @@ static inline void ssi_aead_setup_cipher_desc(
set_flow_mode([idx], ctx->flow_mode);
set_din_type([idx], DMA_DLLI, req_ctx->gen_ctx.iv_dma_addr,
 hw_iv_size, NS_BIT);
-   if (ctx->cipher_mode == DRV_CIPHER_CTR) {
+   if (ctx->cipher_mode == DRV_CIPHER_CTR)
set_setup_mode([idx], SETUP_LOAD_STATE1);
-   } else {
+   else
set_setup_mode([idx], SETUP_LOAD_STATE0);
-   }
set_cipher_mode([idx], ctx->cipher_mode);
idx++;
 
@@ -1375,9 +1372,9 @@ static int validate_data_size(struct ssi_aead_ctx *ctx,
 static unsigned int format_ccm_a0(u8 *pA0Buff, u32 headerSize)
 {
unsigned int len = 0;
-   if (headerSize == 0) {
+   if (headerSize == 0)
return 0;
-   }
+
if (headerSize < ((1UL << 16) - (1UL << 8))) {
len = 2;
 
@@ -1498,9 +1495,8 @@ static inline int ssi_aead_ccm(
}
 
/* process the cipher */
-   if (req_ctx->cryptlen != 0) {
+   if (req_ctx->cryptlen != 0)
ssi_aead_process_cipher_data_desc(req, cipher_flow_mode, desc, 
);
-   }
 
/* Read temporal MAC */
hw_desc_init([idx]);
@@ -1579,9 +1575,8 @@ static int config_ccm_adata(struct aead_request *req)
*b0 |= 64;  /* Enable bit 6 if Adata exists. */
 
rc = set_msg_len(b0 + 16 - l, cryptlen, l);  /* Write L'. */
-   if (rc != 0) {
+   if (rc != 0)
return rc;
-   }
 /* END of "taken from crypto/ccm.c" */
 
/* l(a) - size of associated data. */
@@ -1861,9 +1856,8 @@ static inline void ssi_aead_dump_gcm(
SSI_LOG_DEBUG("cipher_mode %d, authsize %d, enc_keylen %d, assoclen %d, 
cryptlen %d \n", \
 ctx->cipher_mode, ctx->authsize, 
ctx->enc_keylen, req->assoclen, req_ctx->cryptlen);
 
-   if (ctx->enckey != NULL) {
+   if (ctx->enckey != NULL)
dump_byte_array("mac key", ctx->enckey, 16);
-   }
 
dump_byte_array("req->iv", req->iv, AES_BLOCK_SIZE);
 
@@ -1877,13 +1871,11 @@ static inline void ssi_aead_dump_gcm(
 
dump_byte_array("gcm_len_block", req_ctx->gcm_len_block.lenA, 
AES_BLOCK_SIZE);
 
-   if (req->src != NULL && req->cryptlen) {
+   if (req->src != NULL && req->cryptlen)
dump_byte_array("req->src", sg_virt(req->src), 
req->cryptlen+req->assoclen);
-   }
 
-   if (req->dst != NULL) {
+   if (req->dst != NULL)
dump_byte_array("req->dst", sg_virt(req->dst), 
req->cryptlen+ctx->authsize+req->assoclen);
-}
 }
 #endif
 
@@ -2084,14 +2076,12 @@ static int ssi_aead_process(struct aead_request *req, 
enum drv_crypto_direction
 #if (SSI_CC_HAS_AES_CCM || SSI_CC_HAS_AES_GCM)
case DRV_HASH_NULL:
 #if SSI_CC_HAS_AES_CCM
-   if (ctx->cipher_mode == DRV_CIPHER_CCM) {
+   if (ctx->cipher_mode == DRV_CIPHER_CCM)
ssi_aead_ccm(req, desc, _len);
-   }
 #endif /*SSI_CC_HAS_AES_CCM*/
 #if SSI_CC_HAS_AES_GCM
-   if (ctx->cipher_mode == DRV_CIPHER_GCTR) {
+   if (ctx->cipher_mode == DRV_CIPHER_GCTR)
ssi_aead_gcm(req, desc, _len);
-  

[PATCH 0/2] staging: ccree: Fix coding style and remove warnings

2017-06-28 Thread karthik
From: Karthik Tummala 

This patch series fixes coding style and removes the following
checkpatch.pl warnings:

Prefer using '"%s...", __func__' to using the function's name,
in a string.

Braces {} are not necessary for single statement blocks.

Rebased on top of next-20170627.
Patches were tested and built on next-20170627

Karthik Tummala (2):
  staging: ccree: Use __func__ instead of function name
  staging: ccree: Remove braces {} for single statement blocks

 drivers/staging/ccree/ssi_aead.c | 48 
 1 file changed, 19 insertions(+), 29 deletions(-)

-- 
1.9.1

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


[PATCH 1/2] staging: ccree: Use __func__ instead of function name

2017-06-28 Thread karthik
From: Karthik Tummala 

Fixed following checkpatch.pl warning:
WARNING: Prefer using '"%s...", __func__' to using
the function's name, in a string

It is prefered to use '%s & __func__' instead of function
name for logging.

Signed-off-by: Karthik Tummala 
---
 drivers/staging/ccree/ssi_aead.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ccree/ssi_aead.c b/drivers/staging/ccree/ssi_aead.c
index c70e450..4004d69 100644
--- a/drivers/staging/ccree/ssi_aead.c
+++ b/drivers/staging/ccree/ssi_aead.c
@@ -1899,7 +1899,7 @@ static int config_gcm_context(struct aead_request *req)
(req->cryptlen - ctx->authsize);
__be32 counter = cpu_to_be32(2);
 
-   SSI_LOG_DEBUG("config_gcm_context() cryptlen = %d, req->assoclen = %d 
ctx->authsize = %d \n", cryptlen, req->assoclen, ctx->authsize);
+   SSI_LOG_DEBUG("%s() cryptlen = %d, req->assoclen = %d ctx->authsize = 
%d \n", __func__, cryptlen, req->assoclen, ctx->authsize);
 
memset(req_ctx->hkey, 0, AES_BLOCK_SIZE);
 
@@ -2220,7 +2220,7 @@ static int ssi_rfc4106_gcm_setkey(struct crypto_aead 
*tfm, const u8 *key, unsign
struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm);
int rc = 0;
 
-   SSI_LOG_DEBUG("ssi_rfc4106_gcm_setkey()  keylen %d, key %p \n", keylen, 
key);
+   SSI_LOG_DEBUG("%s()  keylen %d, key %p \n", __func__, keylen, key);
 
if (keylen < 4)
return -EINVAL;
@@ -2238,7 +2238,7 @@ static int ssi_rfc4543_gcm_setkey(struct crypto_aead 
*tfm, const u8 *key, unsign
struct ssi_aead_ctx *ctx = crypto_aead_ctx(tfm);
int rc = 0;
 
-   SSI_LOG_DEBUG("ssi_rfc4543_gcm_setkey()  keylen %d, key %p \n", keylen, 
key);
+   SSI_LOG_DEBUG("%s()  keylen %d, key %p \n", __func__, keylen, key);
 
if (keylen < 4)
return -EINVAL;
@@ -2273,7 +2273,7 @@ static int ssi_gcm_setauthsize(struct crypto_aead 
*authenc,
 static int ssi_rfc4106_gcm_setauthsize(struct crypto_aead *authenc,
  unsigned int authsize)
 {
-   SSI_LOG_DEBUG("ssi_rfc4106_gcm_setauthsize()  authsize %d \n", 
authsize);
+   SSI_LOG_DEBUG("%s()  authsize %d \n", __func__, authsize);
 
switch (authsize) {
case 8:
@@ -2290,7 +2290,7 @@ static int ssi_rfc4106_gcm_setauthsize(struct crypto_aead 
*authenc,
 static int ssi_rfc4543_gcm_setauthsize(struct crypto_aead *authenc,
   unsigned int authsize)
 {
-   SSI_LOG_DEBUG("ssi_rfc4543_gcm_setauthsize()  authsize %d \n", 
authsize);
+   SSI_LOG_DEBUG("%s()  authsize %d \n", __func__, authsize);
 
if (authsize != 16)
return -EINVAL;
-- 
1.9.1

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


Re: [PATCH v3] staging: vboxvideo: Add vboxvideo to drivers/staging

2017-06-28 Thread Dan Carpenter
On Mon, Jun 26, 2017 at 04:55:46PM +0200, Hans de Goede wrote:
> >> +int vbox_dumb_create(struct drm_file *file,
> >> +   struct drm_device *dev, struct drm_mode_create_dumb *args)
> >> +{
> >> +  int ret;
> >> +  struct drm_gem_object *gobj;
> >> +  u32 handle;
> >> +
> >> +  args->pitch = args->width * ((args->bpp + 7) / 8);
> >> +  args->size = args->pitch * args->height;
> >> +
> >> +  ret = vbox_gem_create(dev, args->size, false, );
> >> +  if (ret)
> >> +  return ret;
> >> +
> >> +  ret = drm_gem_handle_create(file, gobj, );
> >> +  drm_gem_object_unreference_unlocked(gobj);
> >> +  if (ret)
> >> +  return ret;
> >
> > This is a resource leak.
> 
> What makes you say that? Note the unreference done before the
> ret check. I could be missing something here, but I think this is fine ?
> 

You're right.  My bad.

regards,
dan carpenter


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


[PATCH] staging: rts5208 : Fixing coding style warnings

2017-06-28 Thread Simo Koskinen
Fixed following warnings found by checkpatch.pl script:

WARNING: Prefer using '"%s...", __func__' to using '',
this function's name, in a string

Signed-off-by: Simo Koskinen 
---
 drivers/staging/rts5208/rtsx.c  |  2 +-
 drivers/staging/rts5208/rtsx_chip.c |  5 +++--
 drivers/staging/rts5208/sd.c|  8 +---
 drivers/staging/rts5208/spi.c   |  9 +
 drivers/staging/rts5208/xd.c| 11 ++-
 5 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index b8177f5..6c7485f 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -1009,7 +1009,7 @@ static void rtsx_remove(struct pci_dev *pci)
 {
struct rtsx_dev *dev = pci_get_drvdata(pci);
 
-   dev_info(>dev, "rtsx_remove() called\n");
+   dev_info(>dev, "%s() called\n", __func__);
 
quiesce_and_remove_host(dev);
release_everything(dev);
diff --git a/drivers/staging/rts5208/rtsx_chip.c 
b/drivers/staging/rts5208/rtsx_chip.c
index 7f4107b..4895579 100644
--- a/drivers/staging/rts5208/rtsx_chip.c
+++ b/drivers/staging/rts5208/rtsx_chip.c
@@ -616,8 +616,9 @@ int rtsx_reset_chip(struct rtsx_chip *chip)
else
retval = rtsx_pre_handle_sdio_new(chip);
 
-   dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x 
(rtsx_reset_chip)\n",
-   (unsigned int)(chip->need_reset));
+   dev_dbg(rtsx_dev(chip), "chip->need_reset = 0x%x (%s)\n",
+   (unsigned int)(chip->need_reset),
+   __func__);
 #else  /* HW_AUTO_SWITCH_SD_BUS */
retval = rtsx_pre_handle_sdio_old(chip);
 #endif  /* HW_AUTO_SWITCH_SD_BUS */
diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index c2eb072..e3a92b0 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -910,7 +910,8 @@ static int sd_change_phase(struct rtsx_chip *chip, u8 
sample_point, u8 tune_dir)
int retval;
bool ddr_rx = false;
 
-   dev_dbg(rtsx_dev(chip), "sd_change_phase (sample_point = %d, tune_dir = 
%d)\n",
+   dev_dbg(rtsx_dev(chip), "%s (sample_point = %d, tune_dir = %d)\n",
+   __func__,
sample_point, tune_dir);
 
if (tune_dir == TUNE_RX) {
@@ -3575,8 +3576,9 @@ static int reset_mmc_only(struct rtsx_chip *chip)
return STATUS_FAIL;
}
 
-   dev_dbg(rtsx_dev(chip), "In reset_mmc_only, sd_card->sd_type = 0x%x\n",
-   sd_card->sd_type);
+   dev_dbg(rtsx_dev(chip), "In %s, sd_card->sd_type = 0x%x\n",
+   __func__,
+   sd_card->sd_type);
 
return STATUS_SUCCESS;
 }
diff --git a/drivers/staging/rts5208/spi.c b/drivers/staging/rts5208/spi.c
index 8b8cd95..520b52f 100644
--- a/drivers/staging/rts5208/spi.c
+++ b/drivers/staging/rts5208/spi.c
@@ -520,8 +520,9 @@ int spi_get_status(struct scsi_cmnd *srb, struct rtsx_chip 
*chip)
 {
struct spi_info *spi = >spi;
 
-   dev_dbg(rtsx_dev(chip), "spi_get_status: err_code = 0x%x\n",
-   spi->err_code);
+   dev_dbg(rtsx_dev(chip), "%s: err_code = 0x%x\n",
+   __func__,
+   spi->err_code);
rtsx_stor_set_xfer_buf(>err_code,
   min_t(int, scsi_bufflen(srb), 1), srb);
scsi_set_resid(srb, scsi_bufflen(srb) - 1);
@@ -543,8 +544,8 @@ int spi_set_parameter(struct scsi_cmnd *srb, struct 
rtsx_chip *chip)
spi->clk_div = ((u16)(srb->cmnd[4]) << 8) | srb->cmnd[5];
spi->write_en = srb->cmnd[6];
 
-   dev_dbg(rtsx_dev(chip), "spi_set_parameter: spi_clock = %d, clk_div = 
%d, write_en = %d\n",
-   spi->spi_clock, spi->clk_div, spi->write_en);
+   dev_dbg(rtsx_dev(chip), "%s: spi_clock = %d, clk_div = %d, write_en = 
%d\n",
+   __func__, spi->spi_clock, spi->clk_div, spi->write_en);
 
return STATUS_SUCCESS;
 }
diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c
index 74d36f9..dc0baf0 100644
--- a/drivers/staging/rts5208/xd.c
+++ b/drivers/staging/rts5208/xd.c
@@ -885,8 +885,8 @@ static int xd_init_l2p_tbl(struct rtsx_chip *chip)
struct xd_info *xd_card = >xd_card;
int size, i;
 
-   dev_dbg(rtsx_dev(chip), "xd_init_l2p_tbl: zone_cnt = %d\n",
-   xd_card->zone_cnt);
+   dev_dbg(rtsx_dev(chip), "%s: zone_cnt = %d\n",
+   __func__, xd_card->zone_cnt);
 
if (xd_card->zone_cnt < 1) {
rtsx_trace(chip);
@@ -1026,7 +1026,8 @@ static u32 xd_get_l2p_tbl(struct rtsx_chip *chip, int 
zone_no, u16 log_off)
 #ifdef XD_DELAY_WRITE
retval = xd_delay_write(chip);
if (retval != STATUS_SUCCESS) {
-   dev_dbg(rtsx_dev(chip), "In xd_get_l2p_tbl, delay write 
fail!\n");
+   dev_dbg(rtsx_dev(chip), "In %s, delay write fail!\n",
+ 

Re: [PATCH] Staging: unisys: visorbus: Fix coding style warning from checkpatch.pl.

2017-06-28 Thread Frans Klaver
Hi,

On Wed, Jun 28, 2017 at 4:49 AM, Quytelda Kahja  wrote:
> Replace the literal function name "visorbus_create_instance" with the format
> specifier "%s" so it can be dynamically filled by the __func__ macro.

On a general note, I think the actual change or effect is more import
to mention in the subject than the fact that you "fix some issue
highlighted by checkpatch".

Something like

Subject: [PATCH] staging: unisys: visorbus: use __func__ instead of
function name

Of course you can still mention that checkpatch highlighted the issue
for you in the description.

>
> Signed-off-by: Quytelda Kahja 
> ---
>  drivers/staging/unisys/visorbus/visorbus_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
> b/drivers/staging/unisys/visorbus/visorbus_main.c
> index 1c785dd19ddd..1c6dc3a3e64a 100644
> --- a/drivers/staging/unisys/visorbus/visorbus_main.c
> +++ b/drivers/staging/unisys/visorbus/visorbus_main.c
> @@ -1030,7 +1030,7 @@ visorbus_create_instance(struct visor_device *dev)
>  err_debugfs_dir:
> debugfs_remove_recursive(dev->debugfs_dir);
> kfree(hdr_info);
> -   dev_err(>device, "visorbus_create_instance failed: %d\n", err);
> +   dev_err(>device, "%s failed: %d\n", __func__, err);
> return err;
>  }

It looks sane, anyway.

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


答复: [PATCH 1/2] staging: sm750fb: avoid conflicting vesafb

2017-06-28 Thread Teddy Wang 王力强
Hi Greg,

Is the reason Sudip gave you for the question of "why" sufficient ?
This patch is very important for the driver running in the X86 platform.  
Without this patch, many SM750 graphic chip customers complain  the Ubuntu OS 
can't run well. When they install the OS, the screen will be full of garbage in 
xorg.
Ubuntu 16.04.2 LTS and above will enable sm750 staging driver by default.  We 
need this patch. Thanks.

Best Regards,
Teddy Wang


On Sun, Jun 25, 2017 at 04:27:23PM +0200, Greg Kroah-Hartman wrote:
> On Sun, Jun 25, 2017 at 02:54:29PM +0100, Sudip Mukherjee wrote:
> > On Sun, Jun 25, 2017 at 02:54:51PM +0200, Greg Kroah-Hartman wrote:
> > > On Sun, Jun 25, 2017 at 01:43:34PM +0100, Sudip Mukherjee wrote:
> > > > On Mon, Jun 19, 2017 at 09:32:57PM +0100, Sudip Mukherjee wrote:
> > > > > From: Teddy Wang 
> > > > > 
> > > > > If vesafb is enabled in the config then /dev/fb0 is created by 
> > > > > vesa and this sm750 driver gets fb1, fb2. But we need to be 
> > > > > fb0 and fb1 to effectively work with xorg.
> > > > > So if it has been alloted fb1, then try to remove the other fb0.
> > > > > 
> > > > > Signed-off-by: Teddy Wang 
> > > > > Signed-off-by: Sudip Mukherjee 
> > > > > ---
> > > > 
> > > > Hi Greg,
> > > > You applied the second patch but not this one. Did I miss any 
> > > > review comments from you about this one?
> > > 
> > > All of the other complaints about this patch were not sufficient 
> > > for me to justify ignoring it?  Why would I not listen to them?
> > 
> > This patch is doing what all the drm drivers are doing. So you want 
> > us to do something completely new rather than following the 
> > established practice of a drm driver?
> 
> I despise cargo-cult programming.  You could not answer the "why", so 
> why would I accept such a patch?

Did a quick research into "why".
The patch d8801e4df91e ("x86/PCI: Set IORESOURCE_ROM_SHADOW only for the 
default VGA device") has started setting IORESOURCE_ROM_SHADOW in flags for a 
default VGA device and that is being done only for x86.
And so, we will need that #ifdef to check IORESOURCE_ROM_SHADOW as that needs 
to be checked only for a x86 and not for other arch.

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