CONTACT
My Dearest, I am writing this message from my hospital bed, I appeal to you to exercise a little patience and go through this message. I am Mrs.Grace Laboso; I''m 49 yrs old, from Burkina Faso (west Africa) I was married to Late Dr. Walid Ahmed Juffali, Citizen of Saudi Arabia and Billionaire Saudi businessman. Who was the chairman of E. A. Juffali and Brothers, one of Saudi Arabia''s largest companies. Meanwhile, I decided to contact you due to my health condition, I am having diagnosed with Breast Cancer. I have decided to bring it back because I am faced with a new chapter in my life. On July 14th I was told that I have breast cancer. Having known my condition, I decided to donate a sum Twenty Million Two Hundred Thousand dollars Only ($25,200.000.00 USD) to Charity Organizations or Christian individuals to support the Orphans, Motherless Babies, Less privileged and free Medical & Medicine Poor People''s around the World, After I was told by my Doctor that I have only some time to live because of the stage of my cancer problem. I need a reliable person who will handle this project accordingly. I took this decision to donate this fund because I grew up as an Orphan, that?s why I''m taking this decision to contact you to help and carry out this Godly project. I am not afraid of death hence I know where I am going after i died. Please all I need from you is trust and sincere to utilize this fund as I instructed here. I will give you more information on how the fund will be transferred from my bank to your account over there in your country. I will send you my pictures in my next mail, Remain blessed in the name of the Lord. I am waiting for your urgent reply. Best regards, Mrs.Grace Laboso, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] media: imx: Don't initialize vars that won't be used
As reported by gcc: + drivers/staging/media/imx/imx-media-csi.c: warning: variable 'input_fi' set but not used [-Wunused-but-set-variable]: => 671:33 + drivers/staging/media/imx/imx-media-csi.c: warning: variable 'pinctrl' set but not used [-Wunused-but-set-variable]: => 1742:18 input_fi is not used, so just remove it. However, pinctrl should be used, as it devm_pinctrl_get_select_default() is declared with attribute warn_unused_result. What's missing there is an error handling code, in case it fails. Add it. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/imx/imx-media-csi.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index eb7be5093a9d..49b57466e88d 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -668,11 +668,10 @@ static int csi_setup(struct csi_priv *priv) static int csi_start(struct csi_priv *priv) { - struct v4l2_fract *output_fi, *input_fi; + struct v4l2_fract *output_fi; int ret; output_fi = &priv->frame_interval[priv->active_output_pad]; - input_fi = &priv->frame_interval[CSI_SINK_PAD]; if (priv->dest == IPU_CSI_DEST_IDMAC) { ret = csi_idmac_start(priv); @@ -1797,6 +1796,10 @@ static int imx_csi_probe(struct platform_device *pdev) */ priv->dev->of_node = pdata->of_node; pinctrl = devm_pinctrl_get_select_default(priv->dev); + if (IS_ERR(pinctrl)) { + ret = PTR_ERR(priv->vdev); + goto free; + } ret = v4l2_async_register_subdev(&priv->sd); if (ret) -- 2.14.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] Staging: bcm2048: Fix function argument alignment in radio-bcm2048.c.
On 02/20/2018 07:53 AM, Quytelda Kahja wrote: > Fix a coding style problem. What coding style problem? You should give a short description of what you are fixing. > > Signed-off-by: Quytelda Kahja > --- > This is the patch without the unnecessary fixes for line length. > > drivers/staging/media/bcm2048/radio-bcm2048.c | 22 +++--- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c > b/drivers/staging/media/bcm2048/radio-bcm2048.c > index 06d1920150da..f38a4f2acdde 100644 > --- a/drivers/staging/media/bcm2048/radio-bcm2048.c > +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c > @@ -1864,7 +1864,7 @@ static int bcm2048_probe(struct bcm2048_device *bdev) > goto unlock; > > err = bcm2048_set_fm_search_rssi_threshold(bdev, > - BCM2048_DEFAULT_RSSI_THRESHOLD); > + > BCM2048_DEFAULT_RSSI_THRESHOLD); > if (err < 0) > goto unlock; > Just drop this change: it will replace one warning (non-aligned) with another (> 80 cols). This code is fine as it is. Regards, Hans > @@ -1942,9 +1942,9 @@ static irqreturn_t bcm2048_handler(int irq, void *dev) > */ > #define property_write(prop, type, mask, check) > \ > static ssize_t bcm2048_##prop##_write(struct device *dev,\ > - struct device_attribute *attr, \ > - const char *buf,\ > - size_t count) \ > + struct device_attribute *attr,\ > + const char *buf, \ > + size_t count) \ > {\ > struct bcm2048_device *bdev = dev_get_drvdata(dev); \ > type value; \ > @@ -1966,8 +1966,8 @@ static ssize_t bcm2048_##prop##_write(struct device > *dev, \ > > #define property_read(prop, mask)\ > static ssize_t bcm2048_##prop##_read(struct device *dev, \ > - struct device_attribute *attr, \ > - char *buf) \ > + struct device_attribute *attr, \ > + char *buf) \ > {\ > struct bcm2048_device *bdev = dev_get_drvdata(dev); \ > int value; \ > @@ -1985,8 +1985,8 @@ static ssize_t bcm2048_##prop##_read(struct device > *dev,\ > > #define property_signed_read(prop, size, mask) > \ > static ssize_t bcm2048_##prop##_read(struct device *dev, \ > - struct device_attribute *attr, \ > - char *buf) \ > + struct device_attribute *attr, \ > + char *buf) \ > {\ > struct bcm2048_device *bdev = dev_get_drvdata(dev); \ > size value; \ > @@ -2005,8 +2005,8 @@ property_read(prop, mask) > \ > > #define property_str_read(prop, size) > \ > static ssize_t bcm2048_##prop##_read(struct device *dev, \ > - struct device_attribute *attr, \ > - char *buf) \ > + struct device_attribute *attr, \ > + char *buf) \ > {\ > struct bcm2048_device *bdev = dev_get_drvdata(dev); \ > int count; \ > @@ -2175,7 +2175,7 @@ static int bcm2048_fops_release(struct file *file) > } > > static __poll_t bcm2048_fops_poll(struct file *file, > - struct poll_table_struct *pts) > + struct poll_table_struct *pts) > { > struct bcm2048_device *bdev = video_drvdata(file); > __poll_t retval = 0; > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/3] staging: lustre: lov: use correct env in lov_io_data_version_end()
> lov - the logical object volume manager - is responsible for > striping data across multiple volumes. > > So when it is given a request, it creates one or more > sub-requests, one for each target volume. Each sub_io > request has a sub_env environment which it operates in. > > When lov_io_data_version_end() calls lov_io_end_wrapper() to > wait for and close off a sub_io, it passes the wrong > environment. > > This causes an LINVRNT() to fail in cl2osc_io(), and may > cause other problems. > > This patch changes the call to use ->sub_env, much like > other code in the same file. > > Fixes: f0cf21ab ("staging: lustre: clio: add CIT_DATA_VERSION and remove > IOC_LOV_GETINFO") > Signed-off-by: NeilBrown Reviewed-by: James Simmons > --- > drivers/staging/lustre/lustre/lov/lov_io.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c > b/drivers/staging/lustre/lustre/lov/lov_io.c > index c0dbf6cd53b4..b823f8a21856 100644 > --- a/drivers/staging/lustre/lustre/lov/lov_io.c > +++ b/drivers/staging/lustre/lustre/lov/lov_io.c > @@ -483,7 +483,7 @@ lov_io_data_version_end(const struct lu_env *env, const > struct cl_io_slice *ios) > struct lov_io_sub *sub; > > list_for_each_entry(sub, &lio->lis_active, sub_linkage) { > - lov_io_end_wrapper(env, sub->sub_io); > + lov_io_end_wrapper(sub->sub_env, sub->sub_io); > > parent->u.ci_data_version.dv_data_version += > sub->sub_io->u.ci_data_version.dv_data_version; > > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add
> If lstcon_test_add sets 'ret' (passed by reference) to 1, > then lst_test_add_ioctl() ignores the return value. > This isn't justified - the return value must be zero for 'ret' > to be meaningful. > > Signed-off-by: NeilBrown Reviewed-by: James Simmons > --- > drivers/staging/lustre/lnet/selftest/conctl.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c > b/drivers/staging/lustre/lnet/selftest/conctl.c > index 51497cf9a832..a2d8092bdeb7 100644 > --- a/drivers/staging/lustre/lnet/selftest/conctl.c > +++ b/drivers/staging/lustre/lnet/selftest/conctl.c > @@ -670,7 +670,7 @@ static int lst_test_add_ioctl(struct lstio_test_args > *args) >args->lstio_tes_param_len, >&ret, args->lstio_tes_resultp); > > - if (ret) > + if (!rc && ret) > rc = (copy_to_user(args->lstio_tes_retp, &ret, > sizeof(ret))) ? -EFAULT : 0; > out: > > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/3] staging: lustre: lmv: correctly iput lmo_root
> Commit 8f18c8a48b73 ("staging: lustre: lmv: separate master object > with master stripe") changed how lmo_root inodes were managed, > particularly when LMV_HASH_FLAG_MIGRATION is not set. > Previously lsm_md_oinfo[0].lmo_root was always a borrowed > inode reference and didn't need to by iput(). > Since the change, that special case only applies when > LMV_HASH_FLAG_MIGRATION is set > > In the upstream (lustre-release) version of this patch [Commit > 60e07b972114 ("LU-4690 lod: separate master object with master > stripe")] the for loop in the lmv_unpack_md() was changed to count > from 0 and to ignore entry 0 if LMV_HASH_FLAG_MIGRATION is set. > In the patch that got applied to Linux, that change was missing, > so lsm_md_oinfo[0].lmo_root is never iput(). > This results in a "VFS: Busy inodes" warning at unmount. > > Fixes: 8f18c8a48b73 ("staging: lustre: lmv: separate master object with > master stripe") > Signed-off-by: NeilBrown Reviewed-by: James Simmons > --- > drivers/staging/lustre/lustre/lmv/lmv_obd.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c > b/drivers/staging/lustre/lustre/lmv/lmv_obd.c > index 179651531862..e8a9b9902c37 100644 > --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c > +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c > @@ -2695,7 +2695,7 @@ static int lmv_unpackmd(struct obd_export *exp, struct > lmv_stripe_md **lsmp, > if (lsm && !lmm) { > int i; > > - for (i = 1; i < lsm->lsm_md_stripe_count; i++) { > + for (i = 0; i < lsm->lsm_md_stripe_count; i++) { > /* >* For migrating inode, the master stripe and master >* object will be the same, so do not need iput, see > > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: fsl-dpaa2/eth: allow the driver to compile multi-arch
Drop dependency on ARCH_LAYERSCAPE (which in turn depends on ARM64), thus allowing this driver to compile on all architectures supported by the fsl-mc bus driver. This was compile tested on: - powerpc (corenet_basic_defconfig, ppc64_defconfig) - x86 (i386_defconfig, x86_64_defconfig, needs CONFIG_OF) - arm64 (defconfig) Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/fsl-dpaa2/Kconfig b/drivers/staging/fsl-dpaa2/Kconfig index dfff675..730fd6d 100644 --- a/drivers/staging/fsl-dpaa2/Kconfig +++ b/drivers/staging/fsl-dpaa2/Kconfig @@ -4,7 +4,7 @@ config FSL_DPAA2 bool "Freescale DPAA2 devices" - depends on FSL_MC_BUS && ARCH_LAYERSCAPE + depends on FSL_MC_BUS ---help--- Build drivers for Freescale DataPath Acceleration Architecture (DPAA2) family of SoCs. -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: fsl-mc/dpio: allow the driver to compile multi-arch
Drop dependency on ARCH_LAYERSCAPE (which in turn depends on ARM64), thus allowing this driver to compile on all architectures supported by the fsl-mc bus driver. This was compile tested on: - powerpc (corenet_basic_defconfig, ppc64_defconfig) - x86 (i386_defconfig, x86_64_defconfig, needs CONFIG_OF) - arm64 (defconfig) Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-mc/bus/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig index 5f4115d..3424530 100644 --- a/drivers/staging/fsl-mc/bus/Kconfig +++ b/drivers/staging/fsl-mc/bus/Kconfig @@ -7,7 +7,7 @@ config FSL_MC_DPIO tristate "QorIQ DPAA2 DPIO driver" -depends on FSL_MC_BUS && ARCH_LAYERSCAPE +depends on FSL_MC_BUS help Driver for the DPAA2 DPIO object. A DPIO provides queue and buffer management facilities for software to interact with -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: fsl-mc/dpio: Fix incorrect casts
The DPIO driver incorrectly assumes virtual addresses are always 64b long, which causes compiler errors when building for a 32b platform. Fix this by using explicit casts to uintptr_t where necessary. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-mc/bus/dpio/dpio-service.c | 4 ++-- drivers/staging/fsl-mc/bus/dpio/qbman-portal.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-service.c b/drivers/staging/fsl-mc/bus/dpio/dpio-service.c index 1acff7e..14ed2be 100644 --- a/drivers/staging/fsl-mc/bus/dpio/dpio-service.c +++ b/drivers/staging/fsl-mc/bus/dpio/dpio-service.c @@ -192,7 +192,7 @@ irqreturn_t dpaa2_io_irq(struct dpaa2_io *obj) u64 q64; q64 = qbman_result_SCN_ctx(dq); - ctx = (void *)q64; + ctx = (void *)(uintptr_t)q64; ctx->cb(ctx); } else { pr_crit("fsl-mc-dpio: Unrecognised/ignored DQRR entry\n"); @@ -237,7 +237,7 @@ int dpaa2_io_service_register(struct dpaa2_io *d, return -ENODEV; ctx->dpio_id = d->dpio_desc.dpio_id; - ctx->qman64 = (u64)ctx; + ctx->qman64 = (u64)(uintptr_t)ctx; ctx->dpio_private = d; spin_lock_irqsave(&d->lock_notifications, irqflags); list_add(&ctx->node, &d->notifications); diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c index 376e9ed..f57c151 100644 --- a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c +++ b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c @@ -497,7 +497,7 @@ void qbman_pull_desc_set_storage(struct qbman_pull_desc *d, int stash) { /* save the virtual address */ - d->rsp_addr_virt = (u64)storage; + d->rsp_addr_virt = (u64)(uintptr_t)storage; if (!storage) { d->verb &= ~(1 << QB_VDQCR_VERB_RLS_SHIFT); @@ -590,7 +590,7 @@ int qbman_swp_pull(struct qbman_swp *s, struct qbman_pull_desc *d) atomic_inc(&s->vdq.available); return -EBUSY; } - s->vdq.storage = (void *)d->rsp_addr_virt; + s->vdq.storage = (void *)(uintptr_t)d->rsp_addr_virt; p = qbman_get_cmd(s, QBMAN_CENA_SWP_VDQCR); p->numf = d->numf; p->tok = QMAN_DQ_TOKEN_VALID; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: fsl-dpaa2/eth: Fix incorrect casts
The DPAA2 Ethernet driver incorrectly assumes virtual addresses are always 64b long, which causes compiler errors when building for a 32b platform. Fix this by using explicit casts to uintptr_t where necessary. Signed-off-by: Ioana Radulescu --- drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c index dc7be538..c81a01f 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c @@ -324,7 +324,7 @@ static int consume_frames(struct dpaa2_eth_channel *ch) } fd = dpaa2_dq_fd(dq); - fq = (struct dpaa2_eth_fq *)dpaa2_dq_fqd_ctx(dq); + fq = (struct dpaa2_eth_fq *)(uintptr_t)dpaa2_dq_fqd_ctx(dq); fq->stats.frames++; fq->consume(priv, ch, fd, &ch->napi, fq->flowid); @@ -1905,7 +1905,7 @@ static int setup_rx_flow(struct dpaa2_eth_priv *priv, queue.destination.id = fq->channel->dpcon_id; queue.destination.type = DPNI_DEST_DPCON; queue.destination.priority = 1; - queue.user_context = (u64)fq; + queue.user_context = (u64)(uintptr_t)fq; err = dpni_set_queue(priv->mc_io, 0, priv->mc_token, DPNI_QUEUE_RX, 0, fq->flowid, DPNI_QUEUE_OPT_USER_CTX | DPNI_QUEUE_OPT_DEST, @@ -1957,7 +1957,7 @@ static int setup_tx_flow(struct dpaa2_eth_priv *priv, queue.destination.id = fq->channel->dpcon_id; queue.destination.type = DPNI_DEST_DPCON; queue.destination.priority = 0; - queue.user_context = (u64)fq; + queue.user_context = (u64)(uintptr_t)fq; err = dpni_set_queue(priv->mc_io, 0, priv->mc_token, DPNI_QUEUE_TX_CONFIRM, 0, fq->flowid, DPNI_QUEUE_OPT_USER_CTX | DPNI_QUEUE_OPT_DEST, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/4] staging: fsl-mc/dpio, fsl-dpaa2/eth: Enable multi-arch compile
The DPAA2 DPIO and Ethernet drivers need only a couple of small fixes in order to compile correctly for 32b platforms. Update the drivers and remove ARCH_LAYERSCAPE from their Kconfig dependencies. Ioana Radulescu (4): staging: fsl-mc/dpio: Fix incorrect casts staging: fsl-mc/dpio: allow the driver to compile multi-arch staging: fsl-dpaa2/eth: Fix incorrect casts staging: fsl-dpaa2/eth: allow the driver to compile multi-arch drivers/staging/fsl-dpaa2/Kconfig | 2 +- drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 6 +++--- drivers/staging/fsl-mc/bus/Kconfig | 2 +- drivers/staging/fsl-mc/bus/dpio/dpio-service.c | 4 ++-- drivers/staging/fsl-mc/bus/dpio/qbman-portal.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/8] staging: wilc1000: remove unnecessary while(0) in wilc_wlan_handle_txq()
Refactor wilc_wlan_handle_txq() by removing unnecessary while(0) loop. "Line over 80 char" issues in wilc_wlan_handle_txq() are fix by reducing extra leading tab. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_wlan.c | 295 +-- 1 file changed, 141 insertions(+), 154 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 1a9ef1a..37d6d87 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -583,200 +583,187 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) txb = wilc->tx_buffer; wilc->txq_exit = 0; + + if (wilc->quit) + goto out; + + mutex_lock(&wilc->txq_add_to_head_cs); + wilc_wlan_txq_filter_dup_tcp_ack(dev); + tqe = wilc_wlan_txq_get_first(wilc); + i = 0; + sum = 0; do { - if (wilc->quit) - break; + if (tqe && (i < (WILC_VMM_TBL_SIZE - 1))) { + if (tqe->type == WILC_CFG_PKT) + vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET; - mutex_lock(&wilc->txq_add_to_head_cs); - wilc_wlan_txq_filter_dup_tcp_ack(dev); - tqe = wilc_wlan_txq_get_first(wilc); - i = 0; - sum = 0; - do { - if (tqe && (i < (WILC_VMM_TBL_SIZE - 1))) { - if (tqe->type == WILC_CFG_PKT) - vmm_sz = ETH_CONFIG_PKT_HDR_OFFSET; + else if (tqe->type == WILC_NET_PKT) + vmm_sz = ETH_ETHERNET_HDR_OFFSET; - else if (tqe->type == WILC_NET_PKT) - vmm_sz = ETH_ETHERNET_HDR_OFFSET; + else + vmm_sz = HOST_HDR_OFFSET; - else - vmm_sz = HOST_HDR_OFFSET; + vmm_sz += tqe->buffer_size; - vmm_sz += tqe->buffer_size; + if (vmm_sz & 0x3) + vmm_sz = (vmm_sz + 4) & ~0x3; - if (vmm_sz & 0x3) - vmm_sz = (vmm_sz + 4) & ~0x3; + if ((sum + vmm_sz) > LINUX_TX_SIZE) + break; - if ((sum + vmm_sz) > LINUX_TX_SIZE) - break; + vmm_table[i] = vmm_sz / 4; + if (tqe->type == WILC_CFG_PKT) + vmm_table[i] |= BIT(10); + vmm_table[i] = cpu_to_le32(vmm_table[i]); - vmm_table[i] = vmm_sz / 4; - if (tqe->type == WILC_CFG_PKT) - vmm_table[i] |= BIT(10); - vmm_table[i] = cpu_to_le32(vmm_table[i]); + i++; + sum += vmm_sz; + tqe = wilc_wlan_txq_get_next(wilc, tqe); + } else { + break; + } + } while (1); - i++; - sum += vmm_sz; - tqe = wilc_wlan_txq_get_next(wilc, tqe); - } else { - break; - } - } while (1); + if (i == 0) + goto out; + vmm_table[i] = 0x0; - if (i == 0) + acquire_bus(wilc, ACQUIRE_AND_WAKEUP); + counter = 0; + func = wilc->hif_func; + do { + ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, ®); + if (!ret) break; - vmm_table[i] = 0x0; - acquire_bus(wilc, ACQUIRE_AND_WAKEUP); - counter = 0; - func = wilc->hif_func; - do { - ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, ®); - if (!ret) - break; + if ((reg & 0x1) == 0) + break; - if ((reg & 0x1) == 0) - break; + counter++; + if (counter > 200) { + counter = 0; + ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, 0); + break; + } + } while (!wilc->quit); - counter++; - if (counter > 200) { - counter = 0; - ret = func->hif_write_reg(wilc, - WILC_HOST_TX_CTRL, 0);
[PATCH 0/8] staging: wilc1000: fix coding style & checkpatch reported issues
Cleanup patch series to fix checkpatch.pl reported issue & code modification to follow linux coding style. Ajay Singh (8): staging: wilc1000: remove unnecessary while(0) in wilc_wlan_handle_txq() staging: wilc1000: rename label _end_ in wilc_wlan_handle_txq() staging: wilc1000: fix line over 80 char in wilc_wlan_handle_txq() staging: wilc1000: move multiple definition of same macro to common header staging: wilc1000: rename WILC_WFI_mgmt_rx() to avoid camelCase staging: wilc1000: fix line over 80 char in wilc_wlan_handle_rxq() staging: wilc1000: fix line over 80 char in wilc_wlan_cfg_set() staging: wilc1000: fix open parenthesis mismatch issue in wilc_wlan_cfg_set() drivers/staging/wilc1000/linux_mon.c | 3 - drivers/staging/wilc1000/linux_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 - drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 361 +++--- drivers/staging/wilc1000/wilc_wlan.h | 5 + 6 files changed, 183 insertions(+), 193 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/8] staging: wilc1000: rename label _end_ in wilc_wlan_handle_txq()
Rename label name starting with '_' to follow as per linux coding style. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_wlan.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 37d6d87..5422359 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -648,7 +648,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) } while (!wilc->quit); if (!ret) - goto _end_; + goto out_release_bus; timeout = 200; do { @@ -695,11 +695,11 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) } while (1); if (!ret) - goto _end_; + goto out_release_bus; if (entries == 0) { ret = WILC_TX_ERR_NO_BUF; - goto _end_; + goto out_release_bus; } release_bus(wilc, RELEASE_ALLOW_SLEEP); @@ -756,11 +756,11 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) ret = func->hif_clear_int_ext(wilc, ENABLE_TX_VMM); if (!ret) - goto _end_; + goto out_release_bus; ret = func->hif_block_tx_ext(wilc, 0, txb, offset); -_end_: +out_release_bus: release_bus(wilc, RELEASE_ALLOW_SLEEP); out: -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/8] staging: wilc1000: fix line over 80 char in wilc_wlan_cfg_set()
Fix 'line over 80 character' issue found by checkpatch.pl script. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_wlan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 223bf8b..acf7591 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1230,6 +1230,8 @@ int wilc_wlan_cfg_set(struct wilc_vif *vif, int start, u16 wid, u8 *buffer, wilc->cfg_frame_offset = offset; if (commit) { + unsigned long tmp = msecs_to_jiffies(CFG_PKTS_TIMEOUT); + netdev_dbg(vif->ndev, "[WILC]PACKET Commit with sequence number %d\n", wilc->cfg_seq_no); @@ -1239,8 +1241,7 @@ int wilc_wlan_cfg_set(struct wilc_vif *vif, int start, u16 wid, u8 *buffer, if (wilc_wlan_cfg_commit(vif, WILC_CFG_SET, drv_handler)) ret_size = 0; - if (!wait_for_completion_timeout(&wilc->cfg_event, - msecs_to_jiffies(CFG_PKTS_TIMEOUT))) { + if (!wait_for_completion_timeout(&wilc->cfg_event, tmp)) { netdev_dbg(vif->ndev, "Set Timed Out\n"); ret_size = 0; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/8] staging: wilc1000: rename WILC_WFI_mgmt_rx() to avoid camelCase
Fix "Avoid camelCase" issue found by checkpatch.pl script. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_wlan.c | 2 +- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +- drivers/staging/wilc1000/wilc_wlan.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index cf746f2..fe19bf3 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1149,7 +1149,7 @@ void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset) } } -void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) +void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size) { int i = 0; struct wilc_vif *vif; diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 3337fb2..d62c4f1 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -230,7 +230,7 @@ void wilc_netdev_cleanup(struct wilc *wilc); int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, int gpio, const struct wilc_hif_func *ops); void wilc1000_wlan_deinit(struct net_device *dev); -void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); +void wilc_wfi_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); int wilc_wlan_get_firmware(struct net_device *dev); int wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode); diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index f762785..74b80ad 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -815,7 +815,7 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) IS_MANAGMEMENT_CALLBACK | IS_MGMT_STATUS_SUCCES); - WILC_WFI_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len); + wilc_wfi_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len); } else { if (!is_cfg_packet) { if (pkt_len > 0) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/8] staging: wilc1000: fix line over 80 char in wilc_wlan_handle_rxq()
Fix 'line over 80 character' issue found by checkpatch.pl script. Refactor wilc_wlan_handle_rxq() code to remove the checkpatch.pl warnings. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_wlan.c | 46 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 74b80ad..223bf8b 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -798,6 +798,7 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) u32 header; u32 pkt_len, pkt_offset, tp_len; int is_cfg_packet; + int tmp; memcpy(&header, &buffer[offset], 4); header = cpu_to_le32(header); @@ -815,28 +816,31 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) IS_MANAGMEMENT_CALLBACK | IS_MGMT_STATUS_SUCCES); - wilc_wfi_mgmt_rx(wilc, &buffer[offset + HOST_HDR_OFFSET], pkt_len); + tmp = offset + HOST_HDR_OFFSET; + wilc_wfi_mgmt_rx(wilc, &buffer[tmp], pkt_len); + } else if (!is_cfg_packet) { + if (pkt_len > 0) { + wilc_frmw_to_linux(wilc, + &buffer[offset], + pkt_len, + pkt_offset); + } } else { - if (!is_cfg_packet) { - if (pkt_len > 0) { - wilc_frmw_to_linux(wilc, - &buffer[offset], - pkt_len, - pkt_offset); - } - } else { - struct wilc_cfg_rsp rsp; - - wilc_wlan_cfg_indicate_rx(wilc, &buffer[pkt_offset + offset], pkt_len, &rsp); - if (rsp.type == WILC_CFG_RSP) { - if (wilc->cfg_seq_no == rsp.seq_no) - complete(&wilc->cfg_event); - } else if (rsp.type == WILC_CFG_RSP_STATUS) { - wilc_mac_indicate(wilc, WILC_MAC_INDICATE_STATUS); - - } else if (rsp.type == WILC_CFG_RSP_SCAN) { - wilc_mac_indicate(wilc, WILC_MAC_INDICATE_SCAN); - } + struct wilc_cfg_rsp rsp; + + tmp = pkt_offset + offset; + wilc_wlan_cfg_indicate_rx(wilc, &buffer[tmp], + pkt_len, &rsp); + if (rsp.type == WILC_CFG_RSP) { + if (wilc->cfg_seq_no == rsp.seq_no) + complete(&wilc->cfg_event); + } else if (rsp.type == WILC_CFG_RSP_STATUS) { + tmp = WILC_MAC_INDICATE_STATUS; + wilc_mac_indicate(wilc, tmp); + + } else if (rsp.type == WILC_CFG_RSP_SCAN) { + tmp = WILC_MAC_INDICATE_SCAN; + wilc_mac_indicate(wilc, tmp); } } offset += tp_len; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/8] staging: wilc1000: fix line over 80 char in wilc_wlan_handle_txq()
Refactor wilc_wlan_handle_txq() to fix 'line over 80 char' issue found by checkpatch.pl script. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_wlan.c | 76 ++-- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 5422359..ee7102d 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -707,49 +707,51 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) offset = 0; i = 0; do { + u32 header, buffer_offset; + char *bssid; + tqe = wilc_wlan_txq_remove_from_head(dev); - if (tqe && vmm_table[i] != 0) { - u32 header, buffer_offset; + if (!tqe) + break; - vmm_table[i] = cpu_to_le32(vmm_table[i]); - vmm_sz = (vmm_table[i] & 0x3ff); - vmm_sz *= 4; - header = (tqe->type << 31) | -(tqe->buffer_size << 15) | -vmm_sz; - if (tqe->type == WILC_MGMT_PKT) - header |= BIT(30); - else - header &= ~BIT(30); + if (vmm_table[i] == 0) + break; - header = cpu_to_le32(header); - memcpy(&txb[offset], &header, 4); - if (tqe->type == WILC_CFG_PKT) { - buffer_offset = ETH_CONFIG_PKT_HDR_OFFSET; - } else if (tqe->type == WILC_NET_PKT) { - char *bssid = ((struct tx_complete_data *)(tqe->priv))->bssid; - - buffer_offset = ETH_ETHERNET_HDR_OFFSET; - memcpy(&txb[offset + 8], bssid, 6); - } else { - buffer_offset = HOST_HDR_OFFSET; - } + vmm_table[i] = cpu_to_le32(vmm_table[i]); + vmm_sz = (vmm_table[i] & 0x3ff); + vmm_sz *= 4; + header = (tqe->type << 31) | +(tqe->buffer_size << 15) | +vmm_sz; + if (tqe->type == WILC_MGMT_PKT) + header |= BIT(30); + else + header &= ~BIT(30); - memcpy(&txb[offset + buffer_offset], - tqe->buffer, tqe->buffer_size); - offset += vmm_sz; - i++; - tqe->status = 1; - if (tqe->tx_complete_func) - tqe->tx_complete_func(tqe->priv, - tqe->status); - if (tqe->tcp_pending_ack_idx != NOT_TCP_ACK && - tqe->tcp_pending_ack_idx < MAX_PENDING_ACKS) - pending_acks_info[tqe->tcp_pending_ack_idx].txqe = NULL; - kfree(tqe); + header = cpu_to_le32(header); + memcpy(&txb[offset], &header, 4); + if (tqe->type == WILC_CFG_PKT) { + buffer_offset = ETH_CONFIG_PKT_HDR_OFFSET; + } else if (tqe->type == WILC_NET_PKT) { + bssid = ((struct tx_complete_data *)(tqe->priv))->bssid; + + buffer_offset = ETH_ETHERNET_HDR_OFFSET; + memcpy(&txb[offset + 8], bssid, 6); } else { - break; + buffer_offset = HOST_HDR_OFFSET; } + + memcpy(&txb[offset + buffer_offset], + tqe->buffer, tqe->buffer_size); + offset += vmm_sz; + i++; + tqe->status = 1; + if (tqe->tx_complete_func) + tqe->tx_complete_func(tqe->priv, tqe->status); + if (tqe->tcp_pending_ack_idx != NOT_TCP_ACK && + tqe->tcp_pending_ack_idx < MAX_PENDING_ACKS) + pending_acks_info[tqe->tcp_pending_ack_idx].txqe = NULL; + kfree(tqe); } while (--entries); acquire_bus(wilc, ACQUIRE_AND_WAKEUP); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 8/8] staging: wilc1000: fix open parenthesis mismatch issue in wilc_wlan_cfg_set()
Fix 'Alignment should match open parenthesis' issue found by checkpatch.pl script. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/wilc_wlan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index acf7591..971e61d2 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -1273,13 +1273,14 @@ int wilc_wlan_cfg_get(struct wilc_vif *vif, int start, u16 wid, int commit, wilc->cfg_frame_offset = offset; if (commit) { + unsigned long tmp = msecs_to_jiffies(CFG_PKTS_TIMEOUT); + wilc->cfg_frame_in_use = 1; if (wilc_wlan_cfg_commit(vif, WILC_CFG_QUERY, drv_handler)) ret_size = 0; - if (!wait_for_completion_timeout(&wilc->cfg_event, - msecs_to_jiffies(CFG_PKTS_TIMEOUT))) { + if (!wait_for_completion_timeout(&wilc->cfg_event, tmp)) { netdev_dbg(vif->ndev, "Get Timed Out\n"); ret_size = 0; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/8] staging: wilc1000: move multiple definition of same macro to common header
Move the same #define from multiple '.c' files to common header file. Instead of having same macro in different '.c' files, now kept in common '.h' file. Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/linux_mon.c | 3 --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 --- drivers/staging/wilc1000/wilc_wlan.c | 4 drivers/staging/wilc1000/wilc_wlan.h | 5 + 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 91d49c4..bbdfc7a 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -40,9 +40,6 @@ static u8 broadcast[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; #define IEEE80211_RADIOTAP_F_TX_RTS0x0004 /* used rts/cts handshake */ #define IEEE80211_RADIOTAP_F_TX_FAIL 0x0001 /* failed due to excessive*/ -#define IS_MANAGMEMENT 0x100 -#define IS_MANAGMEMENT_CALLBACK0x080 -#define IS_MGMT_STATUS_SUCCES 0x040 #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff) void WILC_WFI_monitor_rx(u8 *buff, u32 size) diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 621810d..3f78abc 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -85,9 +85,6 @@ static const struct wiphy_wowlan_support wowlan_support = { #define TCP_ACK_FILTER_LINK_SPEED_THRESH 54 #define DEFAULT_LINK_SPEED 72 -#define IS_MANAGMEMENT 0x100 -#define IS_MANAGMEMENT_CALLBACK0x080 -#define IS_MGMT_STATUS_SUCCES 0x040 #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff) static struct network_info last_scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW]; diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index ee7102d..f762785 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -810,10 +810,6 @@ static void wilc_wlan_handle_rxq(struct wilc *wilc) if (pkt_len == 0 || tp_len == 0) break; - #define IS_MANAGMEMENT 0x100 - #define IS_MANAGMEMENT_CALLBACK 0x080 - #define IS_MGMT_STATUS_SUCCES 0x040 - if (pkt_offset & IS_MANAGMEMENT) { pkt_offset &= ~(IS_MANAGMEMENT | IS_MANAGMEMENT_CALLBACK | diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h index da71731..fa157a6 100644 --- a/drivers/staging/wilc1000/wilc_wlan.h +++ b/drivers/staging/wilc1000/wilc_wlan.h @@ -195,6 +195,11 @@ #define ENABLE_TX_VMM (SEL_VMM_TBL0 | EN_VMM) /*time for expiring the completion of cfg packets*/ #define CFG_PKTS_TIMEOUT 2000 + +#define IS_MANAGMEMENT 0x100 +#define IS_MANAGMEMENT_CALLBACK0x080 +#define IS_MGMT_STATUS_SUCCES 0x040 + / * * Debug Type -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] selftests: ion: Remove some prints
On 02/15/2018 06:24 PM, Laura Abbott wrote: > There's no need to print messages each time we alloc and free. Remove them. > > Signed-off-by: Laura Abbott > --- > tools/testing/selftests/android/ion/ionutils.c | 6 -- > 1 file changed, 6 deletions(-) > > diff --git a/tools/testing/selftests/android/ion/ionutils.c > b/tools/testing/selftests/android/ion/ionutils.c > index ce69c14f51fa..7d1d37c4ef6a 100644 > --- a/tools/testing/selftests/android/ion/ionutils.c > +++ b/tools/testing/selftests/android/ion/ionutils.c > @@ -80,11 +80,6 @@ int ion_export_buffer_fd(struct ion_buffer_info *ion_info) > heap_id = MAX_HEAP_COUNT + 1; > for (i = 0; i < query.cnt; i++) { > if (heap_data[i].type == ion_info->heap_type) { > - printf("--\n"); > - printf("heap type: %d\n", heap_data[i].type); > - printf(" heap id: %d\n", heap_data[i].heap_id); > - printf("heap name: %s\n", heap_data[i].name); > - printf("--\n"); > heap_id = heap_data[i].heap_id; > break; > } > @@ -204,7 +199,6 @@ void ion_close_buffer_fd(struct ion_buffer_info *ion_info) > /* Finally, close the client fd */ > if (ion_info->ionfd > 0) > close(ion_info->ionfd); > - printf("<%s>: buffer release successfully\n", __func__); > } > } > > Thanks Laura. I will queue this up for 4.17-rc1. thanks, -- Shuah ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] selftests: ion: Add simple test with the vgem driver
On 02/19/2018 11:33 AM, Daniel Vetter wrote: > On Mon, Feb 19, 2018 at 10:18:21AM -0800, Laura Abbott wrote: >> On 02/19/2018 07:31 AM, Daniel Vetter wrote: >>> On Thu, Feb 15, 2018 at 05:24:45PM -0800, Laura Abbott wrote: Ion is designed to be a framework used by other clients who perform operations on the buffer. Use the DRM vgem client as a simple consumer. In conjunction with the dma-buf sync ioctls, this tests the full attach/map path for the system heap. Signed-off-by: Laura Abbott --- tools/testing/selftests/android/ion/Makefile | 3 +- tools/testing/selftests/android/ion/config| 1 + tools/testing/selftests/android/ion/ionmap_test.c | 136 ++ 3 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/android/ion/ionmap_test.c diff --git a/tools/testing/selftests/android/ion/Makefile b/tools/testing/selftests/android/ion/Makefile index 96e0c448b39d..d23b6d537d8b 100644 --- a/tools/testing/selftests/android/ion/Makefile +++ b/tools/testing/selftests/android/ion/Makefile @@ -2,7 +2,7 @@ INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g -TEST_GEN_FILES := ionapp_export ionapp_import +TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test all: $(TEST_GEN_FILES) @@ -14,3 +14,4 @@ include ../../lib.mk $(OUTPUT)/ionapp_export: ionapp_export.c ipcsocket.c ionutils.c $(OUTPUT)/ionapp_import: ionapp_import.c ipcsocket.c ionutils.c +$(OUTPUT)/ionmap_test: ionmap_test.c ionutils.c diff --git a/tools/testing/selftests/android/ion/config b/tools/testing/selftests/android/ion/config index 19db6ca9aa2b..b4ad748a9dd9 100644 --- a/tools/testing/selftests/android/ion/config +++ b/tools/testing/selftests/android/ion/config @@ -2,3 +2,4 @@ CONFIG_ANDROID=y CONFIG_STAGING=y CONFIG_ION=y CONFIG_ION_SYSTEM_HEAP=y +CONFIG_DRM_VGEM=y diff --git a/tools/testing/selftests/android/ion/ionmap_test.c b/tools/testing/selftests/android/ion/ionmap_test.c new file mode 100644 index ..dab36b06b37d --- /dev/null +++ b/tools/testing/selftests/android/ion/ionmap_test.c @@ -0,0 +1,136 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include "ion.h" +#include "ionutils.h" + +int check_vgem(int fd) +{ + drm_version_t version = { 0 }; + char name[5]; + int ret; + + version.name_len = 4; + version.name = name; + + ret = ioctl(fd, DRM_IOCTL_VERSION, &version); + if (ret) + return 1; + + return strcmp(name, "vgem"); +} + +int open_vgem(void) +{ + int i, fd; + const char *drmstr = "/dev/dri/card"; + + fd = -1; + for (i = 0; i < 16; i++) { + char name[80]; + + sprintf(name, "%s%u", drmstr, i); + + fd = open(name, O_RDWR); + if (fd < 0) + continue; + + if (check_vgem(fd)) { + close(fd); + continue; + } else { + break; + } + + } + return fd; +} + +int import_vgem_fd(int vgem_fd, int dma_buf_fd, uint32_t *handle) +{ + struct drm_prime_handle import_handle = { 0 }; + int ret; + + import_handle.fd = dma_buf_fd; + import_handle.flags = 0; + import_handle.handle = 0; + + ret = ioctl(vgem_fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &import_handle); + if (ret == 0) + *handle = import_handle.handle; + return ret; +} + +void close_handle(int vgem_fd, uint32_t handle) +{ + struct drm_gem_close close = { 0 }; + + close.handle = handle; + ioctl(vgem_fd, DRM_IOCTL_GEM_CLOSE, &close); +} + +int main() +{ + int ret, vgem_fd; + struct ion_buffer_info info; + uint32_t handle = 0; + struct dma_buf_sync sync = { 0 }; + + info.heap_type = ION_HEAP_TYPE_SYSTEM; + info.heap_size = 4096; + info.flag_type = ION_FLAG_CACHED; + + ret = ion_export_buffer_fd(&info); + if (ret < 0) { + printf("ion buffer alloc failed\n"); + return -1; + } + + vgem_fd = open_vgem(); + if (vgem_fd < 0) { + ret = vgem_fd; + printf("Failed to open vgem\n"); + goto out_ion; + } + + ret = import_vgem_fd(vgem_fd, info.buffd, &handle); + + if (ret < 0) { +
[PATCH 3.16] staging: usbip stub_rx fix static checker warning on unnecessary checks
Upstream commit 10c901209306 ("usbip: stub_rx: fix static checker warning on unnecessary checks") Back-port fix for static checker warning on unnecessary checks smatch warnings: drivers/staging/usbip/stub_rx.c:360 get_pipe() warn: impossible condition '(pdu->u.cmd_submit.transfer_buffer_length > ((~0 >> 1))) => (s32min-s32max > s32max)' drivers/staging/usbip/stub_rx.c:501 stub_recv_cmd_submit() warn: always true condition '(pdu->u.cmd_submit.transfer_buffer_length <= ((~0 >> 1))) => (s32min-s32max <= s32max)' Reported-by: Dan Carpenter Signed-off-by: Shuah Khan --- drivers/staging/usbip/stub_rx.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/staging/usbip/stub_rx.c b/drivers/staging/usbip/stub_rx.c index 35f59747122a..d8544ab9577b 100644 --- a/drivers/staging/usbip/stub_rx.c +++ b/drivers/staging/usbip/stub_rx.c @@ -356,14 +356,6 @@ static int get_pipe(struct stub_device *sdev, struct usbip_header *pdu) epd = &ep->desc; - /* validate transfer_buffer_length */ - if (pdu->u.cmd_submit.transfer_buffer_length > INT_MAX) { - dev_err(&sdev->udev->dev, - "CMD_SUBMIT: -EMSGSIZE transfer_buffer_length %d\n", - pdu->u.cmd_submit.transfer_buffer_length); - return -1; - } - if (usb_endpoint_xfer_control(epd)) { if (dir == USBIP_DIR_OUT) return usb_sndctrlpipe(udev, epnum); @@ -497,8 +489,7 @@ static void stub_recv_cmd_submit(struct stub_device *sdev, } /* allocate urb transfer buffer, if needed */ - if (pdu->u.cmd_submit.transfer_buffer_length > 0 && - pdu->u.cmd_submit.transfer_buffer_length <= INT_MAX) { + if (pdu->u.cmd_submit.transfer_buffer_length > 0) { priv->urb->transfer_buffer = kzalloc(pdu->u.cmd_submit.transfer_buffer_length, GFP_KERNEL); -- 2.14.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 char-misc 1/1] Drivers: hv: vmbus: Fix ring buffer signaling
On Fri, 16 Feb 2018 23:05:33 + Michael Kelley wrote: > Fix bugs in signaling the Hyper-V host when freeing space in the > host->guest ring buffer: > > 1. The interrupt_mask must not be used to determine whether to signal >on the host->guest ring buffer > 2. The ring buffer write_index must be read (via hv_get_bytes_to_write) >*after* pending_send_sz is read in order to avoid a race condition > 3. Comparisons with pending_send_sz must treat the "equals" case as >not-enough-space > 4. Don't signal if the pending_send_sz feature is not present. Older >versions of Hyper-V that don't implement this feature will poll. > > Fixes: 03bad714a161 ("vmbus: more host signalling avoidance") > Signed-off-by: Michael Kelley Signed-off-by: Stephen Hemminger ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] selftests: ion: Add simple test with the vgem driver
On 02/26/2018 09:07 AM, Shuah Khan wrote: On 02/19/2018 11:33 AM, Daniel Vetter wrote: On Mon, Feb 19, 2018 at 10:18:21AM -0800, Laura Abbott wrote: On 02/19/2018 07:31 AM, Daniel Vetter wrote: On Thu, Feb 15, 2018 at 05:24:45PM -0800, Laura Abbott wrote: Ion is designed to be a framework used by other clients who perform operations on the buffer. Use the DRM vgem client as a simple consumer. In conjunction with the dma-buf sync ioctls, this tests the full attach/map path for the system heap. Signed-off-by: Laura Abbott --- tools/testing/selftests/android/ion/Makefile | 3 +- tools/testing/selftests/android/ion/config| 1 + tools/testing/selftests/android/ion/ionmap_test.c | 136 ++ 3 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/android/ion/ionmap_test.c diff --git a/tools/testing/selftests/android/ion/Makefile b/tools/testing/selftests/android/ion/Makefile index 96e0c448b39d..d23b6d537d8b 100644 --- a/tools/testing/selftests/android/ion/Makefile +++ b/tools/testing/selftests/android/ion/Makefile @@ -2,7 +2,7 @@ INCLUDEDIR := -I. -I../../../../../drivers/staging/android/uapi/ CFLAGS := $(CFLAGS) $(INCLUDEDIR) -Wall -O2 -g -TEST_GEN_FILES := ionapp_export ionapp_import +TEST_GEN_FILES := ionapp_export ionapp_import ionmap_test all: $(TEST_GEN_FILES) @@ -14,3 +14,4 @@ include ../../lib.mk $(OUTPUT)/ionapp_export: ionapp_export.c ipcsocket.c ionutils.c $(OUTPUT)/ionapp_import: ionapp_import.c ipcsocket.c ionutils.c +$(OUTPUT)/ionmap_test: ionmap_test.c ionutils.c diff --git a/tools/testing/selftests/android/ion/config b/tools/testing/selftests/android/ion/config index 19db6ca9aa2b..b4ad748a9dd9 100644 --- a/tools/testing/selftests/android/ion/config +++ b/tools/testing/selftests/android/ion/config @@ -2,3 +2,4 @@ CONFIG_ANDROID=y CONFIG_STAGING=y CONFIG_ION=y CONFIG_ION_SYSTEM_HEAP=y +CONFIG_DRM_VGEM=y diff --git a/tools/testing/selftests/android/ion/ionmap_test.c b/tools/testing/selftests/android/ion/ionmap_test.c new file mode 100644 index ..dab36b06b37d --- /dev/null +++ b/tools/testing/selftests/android/ion/ionmap_test.c @@ -0,0 +1,136 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +#include "ion.h" +#include "ionutils.h" + +int check_vgem(int fd) +{ + drm_version_t version = { 0 }; + char name[5]; + int ret; + + version.name_len = 4; + version.name = name; + + ret = ioctl(fd, DRM_IOCTL_VERSION, &version); + if (ret) + return 1; + + return strcmp(name, "vgem"); +} + +int open_vgem(void) +{ + int i, fd; + const char *drmstr = "/dev/dri/card"; + + fd = -1; + for (i = 0; i < 16; i++) { + char name[80]; + + sprintf(name, "%s%u", drmstr, i); + + fd = open(name, O_RDWR); + if (fd < 0) + continue; + + if (check_vgem(fd)) { + close(fd); + continue; + } else { + break; + } + + } + return fd; +} + +int import_vgem_fd(int vgem_fd, int dma_buf_fd, uint32_t *handle) +{ + struct drm_prime_handle import_handle = { 0 }; + int ret; + + import_handle.fd = dma_buf_fd; + import_handle.flags = 0; + import_handle.handle = 0; + + ret = ioctl(vgem_fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &import_handle); + if (ret == 0) + *handle = import_handle.handle; + return ret; +} + +void close_handle(int vgem_fd, uint32_t handle) +{ + struct drm_gem_close close = { 0 }; + + close.handle = handle; + ioctl(vgem_fd, DRM_IOCTL_GEM_CLOSE, &close); +} + +int main() +{ + int ret, vgem_fd; + struct ion_buffer_info info; + uint32_t handle = 0; + struct dma_buf_sync sync = { 0 }; + + info.heap_type = ION_HEAP_TYPE_SYSTEM; + info.heap_size = 4096; + info.flag_type = ION_FLAG_CACHED; + + ret = ion_export_buffer_fd(&info); + if (ret < 0) { + printf("ion buffer alloc failed\n"); + return -1; + } + + vgem_fd = open_vgem(); + if (vgem_fd < 0) { + ret = vgem_fd; + printf("Failed to open vgem\n"); + goto out_ion; + } + + ret = import_vgem_fd(vgem_fd, info.buffd, &handle); + + if (ret < 0) { + printf("Failed to import buffer\n"); + goto out_vgem; + } + + sync.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW; + ret = ioctl(info.buffd, DMA_BUF_IOCTL_SYNC, &sync); + if (ret) + printf("sync start failed %d\n", errno); + + memset(info.buffer, 0xff, 4096); + + sync.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW; + ret = ioctl(info.buffd, DMA_BUF_IOCTL_SYNC,
Re: [PATCH v2] Staging: bcm2048: Fix function argument alignment in radio-bcm2048.c.
Hans, Thank you very much for your input on the patch; however this patch has already been applied to the staging tree. Additionally: > What coding style problem? You should give a short description of > what you are fixing. The subject of the patch (which becomes the subject of the email when using `git format-patch`) describes the change more fully: "Staging: bcm2048: Fix function argument alignment in radio-bcm2048.c". It's a really trivial patch, so there's not too much to say. That extra comment is just redundant, I suppose. > Just drop this change: it will replace one warning (non-aligned) with > another (> 80 cols). Breaking the 80 character line limit is arguably excusable for this code because of the 36 character function name and 30 character constant name; additionally, it has been said that the 80 character line limit will probably be increased in the future since we run modern machines that aren't limited to 80 character terminals anymore, so this warning may soon be irrelevant anyway. Thank you, Quytelda Kahja On Mon, Feb 26, 2018 at 5:51 AM, Hans Verkuil wrote: > On 02/20/2018 07:53 AM, Quytelda Kahja wrote: >> Fix a coding style problem. > > What coding style problem? You should give a short description of > what you are fixing. > >> >> Signed-off-by: Quytelda Kahja >> --- >> This is the patch without the unnecessary fixes for line length. >> >> drivers/staging/media/bcm2048/radio-bcm2048.c | 22 +++--- >> 1 file changed, 11 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c >> b/drivers/staging/media/bcm2048/radio-bcm2048.c >> index 06d1920150da..f38a4f2acdde 100644 >> --- a/drivers/staging/media/bcm2048/radio-bcm2048.c >> +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c >> @@ -1864,7 +1864,7 @@ static int bcm2048_probe(struct bcm2048_device *bdev) >> goto unlock; >> >> err = bcm2048_set_fm_search_rssi_threshold(bdev, >> - BCM2048_DEFAULT_RSSI_THRESHOLD); >> + >> BCM2048_DEFAULT_RSSI_THRESHOLD); >> if (err < 0) >> goto unlock; >> > > Just drop this change: it will replace one warning (non-aligned) with > another (> 80 cols). > > This code is fine as it is. > > Regards, > > Hans > >> @@ -1942,9 +1942,9 @@ static irqreturn_t bcm2048_handler(int irq, void *dev) >> */ >> #define property_write(prop, type, mask, check) >> \ >> static ssize_t bcm2048_##prop##_write(struct device *dev,\ >> - struct device_attribute *attr, \ >> - const char *buf,\ >> - size_t count) \ >> + struct device_attribute *attr,\ >> + const char *buf, \ >> + size_t count) \ >> {\ >> struct bcm2048_device *bdev = dev_get_drvdata(dev); \ >> type value; \ >> @@ -1966,8 +1966,8 @@ static ssize_t bcm2048_##prop##_write(struct device >> *dev, \ >> >> #define property_read(prop, mask)\ >> static ssize_t bcm2048_##prop##_read(struct device *dev, \ >> - struct device_attribute *attr, \ >> - char *buf) \ >> + struct device_attribute *attr, \ >> + char *buf) \ >> {\ >> struct bcm2048_device *bdev = dev_get_drvdata(dev); \ >> int value; \ >> @@ -1985,8 +1985,8 @@ static ssize_t bcm2048_##prop##_read(struct device >> *dev,\ >> >> #define property_signed_read(prop, size, mask) >> \ >> static ssize_t bcm2048_##prop##_read(struct device *dev, \ >> - struct device_attribute *attr, \ >> - char *buf) \ >> + struct device_attribute *attr, \ >> + char *buf) \ >> {\ >> struct bcm2048_device *bdev = dev_get_drvdata(dev); \ >> size value; \ >> @@ -2005,8 +2005,8 @@ property_read(prop, mask) >> \ >> >> #define property_str_read(prop, size)
Re: [PATCH v2] Staging: bcm2048: Fix function argument alignment in radio-bcm2048.c.
On 02/27/2018 02:53 AM, Quytelda Kahja wrote: > Hans, > > Thank you very much for your input on the patch; however this patch > has already been applied to the staging tree. Additionally: I have no record of this being applied through linux-media. Did someone else pick this up? Greg perhaps? >> What coding style problem? You should give a short description of >> what you are fixing. > The subject of the patch (which becomes the subject of the email when > using `git format-patch`) describes the change more fully: "Staging: > bcm2048: Fix function argument alignment in radio-bcm2048.c". It's a > really trivial patch, so there's not too much to say. That extra > comment is just redundant, I suppose. Usually you just show the warnings that gcc or sparse or whatever produced. > >> Just drop this change: it will replace one warning (non-aligned) with >> another (> 80 cols). > Breaking the 80 character line limit is arguably excusable for this > code because of the 36 character function name and 30 character > constant name; additionally, it has been said that the 80 character > line limit will probably be increased in the future since we run > modern machines that aren't limited to 80 character terminals anymore, > so this warning may soon be irrelevant anyway. I know people who would be very annoyed if the 80 char limit is lifted. Anyway, in the end you look at whether a patch is worth it or not, and this part isn't. But if it is already applied by someone then this is all moot. Regards, Hans > > Thank you, > Quytelda Kahja > > On Mon, Feb 26, 2018 at 5:51 AM, Hans Verkuil wrote: >> On 02/20/2018 07:53 AM, Quytelda Kahja wrote: >>> Fix a coding style problem. >> >> What coding style problem? You should give a short description of >> what you are fixing. >> >>> >>> Signed-off-by: Quytelda Kahja >>> --- >>> This is the patch without the unnecessary fixes for line length. >>> >>> drivers/staging/media/bcm2048/radio-bcm2048.c | 22 +++--- >>> 1 file changed, 11 insertions(+), 11 deletions(-) >>> >>> diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c >>> b/drivers/staging/media/bcm2048/radio-bcm2048.c >>> index 06d1920150da..f38a4f2acdde 100644 >>> --- a/drivers/staging/media/bcm2048/radio-bcm2048.c >>> +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c >>> @@ -1864,7 +1864,7 @@ static int bcm2048_probe(struct bcm2048_device *bdev) >>> goto unlock; >>> >>> err = bcm2048_set_fm_search_rssi_threshold(bdev, >>> - BCM2048_DEFAULT_RSSI_THRESHOLD); >>> + >>> BCM2048_DEFAULT_RSSI_THRESHOLD); >>> if (err < 0) >>> goto unlock; >>> >> >> Just drop this change: it will replace one warning (non-aligned) with >> another (> 80 cols). >> >> This code is fine as it is. >> >> Regards, >> >> Hans >> >>> @@ -1942,9 +1942,9 @@ static irqreturn_t bcm2048_handler(int irq, void *dev) >>> */ >>> #define property_write(prop, type, mask, check) >>> \ >>> static ssize_t bcm2048_##prop##_write(struct device *dev,\ >>> - struct device_attribute *attr, \ >>> - const char *buf,\ >>> - size_t count) \ >>> + struct device_attribute *attr,\ >>> + const char *buf, \ >>> + size_t count) \ >>> {\ >>> struct bcm2048_device *bdev = dev_get_drvdata(dev); \ >>> type value; \ >>> @@ -1966,8 +1966,8 @@ static ssize_t bcm2048_##prop##_write(struct device >>> *dev, \ >>> >>> #define property_read(prop, mask)\ >>> static ssize_t bcm2048_##prop##_read(struct device *dev, \ >>> - struct device_attribute *attr, \ >>> - char *buf) \ >>> + struct device_attribute *attr, \ >>> + char *buf) \ >>> {\ >>> struct bcm2048_device *bdev = dev_get_drvdata(dev); \ >>> int value; \ >>> @@ -1985,8 +1985,8 @@ static ssize_t bcm2048_##prop##_read(struct device >>> *dev,\ >>> >>> #define property_signed_read(prop, size, mask) >>> \ >>> static ssize_t bcm2048_##prop##_read(struct device *dev, \ >>> - struct device_attribute *attr, \ >>> -