Re: [PATCH v3 5/8] staging: rtl8192u: Use %s and __func__ instead of hardcoded string - Style
On Wed, Jun 27, 2018 at 09:22:50PM +0100, John Whitmore wrote: > On Tue, Jun 26, 2018 at 11:56:24AM +0800, Greg KH wrote: > > On Sun, Jun 24, 2018 at 04:34:51PM +0100, John Whitmore wrote: > > > Changed a number of hard coded function names to use %s and __func__ > > > > > > Mailing list response suggest that there is a better method for debugging > > > using netdev_dbg(). I can't argue with that, but for the moment this > > > change > > > will clear the checkpatch.pl Warning. > > > > > > Signed-off-by: John Whitmore > > > --- > > > drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 12 ++-- > > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > Did not apply :( > > No worries, can I just ask is that because it should be changed to use > netdev_dbg as was suggested? And should that be across the whole file? "Does not apply" means you save the raw email to email.txt then download the latest code from git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next then `cat email.txt | git am` and it fails. Probably someone else's patch was merged ahead of yours. Fix it up and then resend. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
staging: rtl8723bs: bug or pointless if else ?
Hi, I stumbled upon the following if else construct in drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618 if (pwrpriv->bInternalAutoSuspend) { ret = rtw_resume_process(padapter); } else { if (pwrpriv->wowlan_mode || pwrpriv->wowlan_ap_mode) { ret = rtw_resume_process(padapter); } else { ret = rtw_resume_process(padapter); } } It does not matter if the conditions are true or not, ret is always set to: ret = rtw_resume_process(padapter) Is this a bug or is the if else construct just pointless? Regards, Michael ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging: rtl8723bs: bug or pointless if else ?
Hi, On 28-06-18 09:43, Michael Straube wrote: Hi, I stumbled upon the following if else construct in drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618 if (pwrpriv->bInternalAutoSuspend) { ret = rtw_resume_process(padapter); } else { if (pwrpriv->wowlan_mode || pwrpriv->wowlan_ap_mode) { ret = rtw_resume_process(padapter); } else { ret = rtw_resume_process(padapter); } } It does not matter if the conditions are true or not, ret is always set to: ret = rtw_resume_process(padapter) Is this a bug or is the if else construct just pointless? It probably is just pointless, my guess would be that once upon a time there was a difference in the paths and at some point that difference went away. Regards, Hans ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging: rtl8723bs: bug or pointless if else ?
On Thu, 2018-06-28 at 10:22 +0200, Hans de Goede wrote: > Hi, > > On 28-06-18 09:43, Michael Straube wrote: > > Hi, > > > > I stumbled upon the following if else construct in > > drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618 > > > > if (pwrpriv->bInternalAutoSuspend) > > { > > ret = rtw_resume_process(padapter); > > } > > else > > { > > if (pwrpriv->wowlan_mode || pwrpriv- > > >wowlan_ap_mode) > > { > > ret = rtw_resume_process(padapter); > > } > > else > > { > > ret = rtw_resume_process(padapter); > > } > > } > > > > It does not matter if the conditions are true or not, > > ret is always set to: > > > > ret = rtw_resume_process(padapter) > > > > Is this a bug or is the if else construct just pointless? > > It probably is just pointless, my guess would be that once > upon a time there was a difference in the paths and at some > point that difference went away. Quite: https://github.com/hadess/rtl8723bs/blob/7d36e26f78bbc709844c12ad0c62e3e8503fdbc5/os_dep/linux/sdio_intf.c#L1757 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging: rtl8723bs: bug or pointless if else ?
On Thu, Jun 28, 2018 at 09:43:47AM +0200, Michael Straube wrote: > Hi, > > I stumbled upon the following if else construct in > drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618 > > if (pwrpriv->bInternalAutoSuspend) > { > ret = rtw_resume_process(padapter); > } > else > { > if (pwrpriv->wowlan_mode || pwrpriv->wowlan_ap_mode) > { > ret = rtw_resume_process(padapter); > } > else > { > ret = rtw_resume_process(padapter); > } > } > > It does not matter if the conditions are true or not, > ret is always set to: > > ret = rtw_resume_process(padapter) > > Is this a bug or is the if else construct just pointless? Looks pretty pointless... ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 5/8] staging: rtl8192u: Use %s and __func__ instead of hardcoded string - Style
On Thu, Jun 28, 2018 at 10:38:28AM +0300, Dan Carpenter wrote: > On Wed, Jun 27, 2018 at 09:22:50PM +0100, John Whitmore wrote: > > On Tue, Jun 26, 2018 at 11:56:24AM +0800, Greg KH wrote: > > > On Sun, Jun 24, 2018 at 04:34:51PM +0100, John Whitmore wrote: > > > > Changed a number of hard coded function names to use %s and __func__ > > > > > > > > Mailing list response suggest that there is a better method for > > > > debugging > > > > using netdev_dbg(). I can't argue with that, but for the moment this > > > > change > > > > will clear the checkpatch.pl Warning. > > > > > > > > Signed-off-by: John Whitmore > > > > --- > > > > drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 12 ++-- > > > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > > > Did not apply :( > > > > No worries, can I just ask is that because it should be changed to use > > netdev_dbg as was suggested? And should that be across the whole file? > > "Does not apply" means you save the raw email to email.txt then download > the latest code from > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next > then `cat email.txt | git am` and it fails. > > Probably someone else's patch was merged ahead of yours. Fix it up and > then resend. > > regards, > dan carpenter Thank you for that. I read the sentence and filled in my own pronoun as there wasn't one :( So I read it as "I did not apply" rather then "it did not apply". That's great that 'it' did not apply, thought I'd done something wrong. I'll have another crack at it later if I get a chance. Once again thanks John Whitmore ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 05/18] staging: mt7621-pinctrl: avoid space after if condition
On Fri, Jun 08, 2018 at 02:16:35PM +0200, Sergio Paracuellos wrote: > Adding spaces between if condition and parenthesis are not > needed at all and checkpatch script complains about them. > Fix one in driver code. > > Signed-off-by: Sergio Paracuellos > --- > drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) This patch failed to apply, so I stopped here in the patch series. Please rebase and fix up and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 5/8] staging: rtl8192u: Use %s and __func__ instead of hardcoded string - Style
On Thu, Jun 28, 2018 at 01:32:41PM +0100, John Whitmore wrote: > On Thu, Jun 28, 2018 at 10:38:28AM +0300, Dan Carpenter wrote: > > On Wed, Jun 27, 2018 at 09:22:50PM +0100, John Whitmore wrote: > > > On Tue, Jun 26, 2018 at 11:56:24AM +0800, Greg KH wrote: > > > > On Sun, Jun 24, 2018 at 04:34:51PM +0100, John Whitmore wrote: > > > > > Changed a number of hard coded function names to use %s and __func__ > > > > > > > > > > Mailing list response suggest that there is a better method for > > > > > debugging > > > > > using netdev_dbg(). I can't argue with that, but for the moment this > > > > > change > > > > > will clear the checkpatch.pl Warning. > > > > > > > > > > Signed-off-by: John Whitmore > > > > > --- > > > > > drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 12 ++-- > > > > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > > > > > Did not apply :( > > > > > > No worries, can I just ask is that because it should be changed to use > > > netdev_dbg as was suggested? And should that be across the whole file? > > > > "Does not apply" means you save the raw email to email.txt then download > > the latest code from > > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git > > staging-next > > then `cat email.txt | git am` and it fails. > > > > Probably someone else's patch was merged ahead of yours. Fix it up and > > then resend. > > > > regards, > > dan carpenter > > Thank you for that. I read the sentence and filled in my own pronoun as there > wasn't one :( So I read it as "I did not apply" rather then "it did not > apply". That's great that 'it' did not apply, thought I'd done something > wrong. I'll have another crack at it later if I get a chance. Ick, sorry for being terse, my fault. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging: rtl8723bs: bug or pointless if else ?
On 06/28/18 11:34, Bastien Nocera wrote: On Thu, 2018-06-28 at 10:22 +0200, Hans de Goede wrote: Hi, On 28-06-18 09:43, Michael Straube wrote: Hi, I stumbled upon the following if else construct in drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618 if (pwrpriv->bInternalAutoSuspend) { ret = rtw_resume_process(padapter); } else { if (pwrpriv->wowlan_mode || pwrpriv- wowlan_ap_mode) { ret = rtw_resume_process(padapter); } else { ret = rtw_resume_process(padapter); } } It does not matter if the conditions are true or not, ret is always set to: ret = rtw_resume_process(padapter) Is this a bug or is the if else construct just pointless? It probably is just pointless, my guess would be that once upon a time there was a difference in the paths and at some point that difference went away. Quite: https://github.com/hadess/rtl8723bs/blob/7d36e26f78bbc709844c12ad0c62e3e8503fdbc5/os_dep/linux/sdio_intf.c#L1757 So it can be safly removed? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging: rtl8723bs: bug or pointless if else ?
Hi, On 28-06-18 17:00, Michael Straube wrote: On 06/28/18 11:34, Bastien Nocera wrote: On Thu, 2018-06-28 at 10:22 +0200, Hans de Goede wrote: Hi, On 28-06-18 09:43, Michael Straube wrote: Hi, I stumbled upon the following if else construct in drivers/staging/rtl8723bs/os_dep/sdio_intf.c:618 if (pwrpriv->bInternalAutoSuspend) { ret = rtw_resume_process(padapter); } else { if (pwrpriv->wowlan_mode || pwrpriv- wowlan_ap_mode) { ret = rtw_resume_process(padapter); } else { ret = rtw_resume_process(padapter); } } It does not matter if the conditions are true or not, ret is always set to: ret = rtw_resume_process(padapter) Is this a bug or is the if else construct just pointless? It probably is just pointless, my guess would be that once upon a time there was a difference in the paths and at some point that difference went away. Quite: https://github.com/hadess/rtl8723bs/blob/7d36e26f78bbc709844c12ad0c62e3e8503fdbc5/os_dep/linux/sdio_intf.c#L1757 So it can be safly removed? Simplified to a single: ret = rtw_resume_process(padapter); Yes that should be fine. Regards, Hans ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: fix operator '=' coding style issue
On Tue, Jun 19, 2018 at 06:23:52PM +0200, Vitor Fernandes Ferreira wrote: > Signed-off-by: Vitor Fernandes Ferreira > --- > drivers/staging/comedi/comedi_fops.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - You did not specify a description of why the patch is needed, or possibly, any description at all, in the email body. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/SubmittingPatches for what is needed in order to properly describe the change. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] goldfish: Add functions to simplify goldfish related MMIO
On Wed, Jun 27, 2018 at 02:47:55PM -0700, r...@google.com wrote: > From: Roman Kiryanov > > Add functions > * to read and write u64 to be used in the goldfish sync driver. Why not just keep these in the sync driver? No need to put them in a .h file if only one .c file uses it, right? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: goldfish: Add goldfish sync driver
On Wed, Jun 27, 2018 at 02:50:52PM -0700, r...@google.com wrote: > From: Roman Kiryanov > > This is kernel driver for controlling the Goldfish sync > device on the host. It is used to maintain ordering > in critical OpenGL state changes while using > GPU emulation. Why are you adding new features and drivers and not spending the time to get the existing code cleaned up and out of the staging tree? Please work on that, I don't want to keep taking new code without any time being spent on the existing stuff. Staging is not a dumping ground, work needs to be done on the code in it to get it out of the tree. If that doesn't happen, I will remove it. Also, this code causes a bunch of build warnings, I could not take it anyway. Please be more careful in the future. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: goldfish: Add goldfish sync driver
Try building this on a 32 bit system. I bet that's the build warnings which Greg saw... On Wed, Jun 27, 2018 at 02:50:52PM -0700, r...@google.com wrote: > From: Roman Kiryanov > > This is kernel driver for controlling the Goldfish sync > device on the host. It is used to maintain ordering > in critical OpenGL state changes while using > GPU emulation. > > The guest open()'s the Goldfish sync device to create > a context for possibly maintaining sync timeline and fences. > There is a 1:1 correspondence between such sync contexts > and OpenGL contexts in the guest that need synchronization > (which in turn, is anything involving swapping buffers, > SurfaceFlinger, or Hardware Composer). > > The ioctl QUEUE_WORK takes a handle to a sync object > and attempts to tell the host GPU to wait on the sync object > and deal with signaling it. It possibly outputs > a fence FD on which the Android systems that use them > (GLConsumer, SurfaceFlinger, anything employing > EGL_ANDROID_native_fence_sync) can use to wait. > > Signed-off-by: Roman Kiryanov > --- > drivers/staging/goldfish/Kconfig | 7 + > drivers/staging/goldfish/Makefile | 4 + > .../staging/goldfish/goldfish_sync_timeline.c | 985 ++ > .../goldfish/goldfish_sync_timeline_fence.c | 260 + > .../goldfish/goldfish_sync_timeline_fence.h | 58 ++ > include/uapi/linux/goldfish/goldfish_sync.h | 49 + > 6 files changed, 1363 insertions(+) > create mode 100644 drivers/staging/goldfish/goldfish_sync_timeline.c > create mode 100644 drivers/staging/goldfish/goldfish_sync_timeline_fence.c > create mode 100644 drivers/staging/goldfish/goldfish_sync_timeline_fence.h > create mode 100644 include/uapi/linux/goldfish/goldfish_sync.h > > diff --git a/drivers/staging/goldfish/Kconfig > b/drivers/staging/goldfish/Kconfig > index 9165385df9de..59a7d26f5d3f 100644 > --- a/drivers/staging/goldfish/Kconfig > +++ b/drivers/staging/goldfish/Kconfig > @@ -4,3 +4,10 @@ config GOLDFISH_AUDIO > help > Emulated audio channel for the Goldfish Android Virtual Device > > +config GOLDFISH_SYNC > +tristate "Goldfish AVD Sync Driver" > +depends on GOLDFISH > +depends on SW_SYNC > +depends on SYNC_FILE > + ---help--- > + Emulated sync fences for the Goldfish Android Virtual Device > diff --git a/drivers/staging/goldfish/Makefile > b/drivers/staging/goldfish/Makefile > index 054eeb82151e..781a81730d15 100644 > --- a/drivers/staging/goldfish/Makefile > +++ b/drivers/staging/goldfish/Makefile > @@ -3,3 +3,7 @@ > # > > obj-$(CONFIG_GOLDFISH_AUDIO) += goldfish_audio.o > + > +ccflags-y := -Idrivers/staging/android > +goldfish_sync-objs := goldfish_sync_timeline_fence.o goldfish_sync_timeline.o > +obj-$(CONFIG_GOLDFISH_SYNC) += goldfish_sync.o > diff --git a/drivers/staging/goldfish/goldfish_sync_timeline.c > b/drivers/staging/goldfish/goldfish_sync_timeline.c > new file mode 100644 > index ..33b17fd97499 > --- /dev/null > +++ b/drivers/staging/goldfish/goldfish_sync_timeline.c > @@ -0,0 +1,985 @@ > +/* > + * Copyright (C) 2018 Google, Inc. > + * > + * This software is licensed under the terms of the GNU General Public > + * License version 2, as published by the Free Software Foundation, and > + * may be copied, distributed, and modified under those terms. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + > +#include > + > +#include > +#include > +#include > +#include > + > +#include > + > +#include > + > +#include "goldfish_sync_timeline_fence.h" > + > +/* The Goldfish sync driver is designed to provide a interface > + * between the underlying host's sync device and the kernel's > + * fence sync framework.. > + * The purpose of the device/driver is to enable lightweight > + * creation and signaling of timelines and fences > + * in order to synchronize the guest with host-side graphics events. > + * > + * Each time the interrupt trips, the driver > + * may perform a sync operation. > + */ > + > +/* The operations are: */ > +enum cmd_id { > + /* Ready signal - used to mark when irq should lower */ > + CMD_SYNC_READY = 0, > + > + /* Create a new timeline. writes timeline handle */ > + CMD_CREATE_SYNC_TIMELINE= 1, > + > + /* Create a fence object. reads timeline handle and time argument. > + * Writes fence fd to the SYNC_REG_HANDLE register. > + */ > + CMD_CREATE_SYNC_FENCE = 2, > + > + /* Increments timeline. reads timeline handle and time argument */ > + CMD_SYNC_TIMELINE
Re: [PATCH 0/4] x86/hyper-v: optimize PV IPIs
Vitaly Kuznetsov writes: > Wanpeng Li writes: > >> Hi Vitaly, (fix my reply mess this time) >> On Sat, 23 Jun 2018 at 01:09, Vitaly Kuznetsov wrote: >>> >>> When reviewing my "x86/hyper-v: use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_ >>> {LIST,SPACE} hypercalls when possible" patch Michael suggested to apply the >>> same idea to PV IPIs. Here we go! >>> >>> Despite what Hyper-V TLFS says about HVCALL_SEND_IPI hypercall, it can >>> actually be 'fast' (passing parameters through registers). Use that too. >>> >>> This series can collide with my "KVM: x86: hyperv: PV IPI support for >>> Windows guests" series as I rename ipi_arg_non_ex/ipi_arg_ex structures >>> there. Depending on which one gets in first we may need to do tiny >>> adjustments. >> >> As hyperv PV TLB flush has already been merged, is there any other >> obvious multicast IPIs scenarios? qemu supports interrupt remapping >> since two years ago, I think windows guest can switch to cluster mode >> after entering x2APIC, so sending IPI per cluster. In addition, you >> can also post the benchmark result for this PV IPI optimization, >> although it also fixes the bug which you mentioned above. > > I got confused, which of my patch series are you actually looking at? > :-) > > This particular one ("x86/hyper-v: optimize PV IPIs") is not about > KVM/qemu, it is for Linux running on top on real Hyper-V server. We > already support PV IPIs and here I'm just trying to optimize the way how > we send them by switching to a cheaper hypercall (and using 'fast' > version of it) when possible. I don't actually have a good benchmark > (and I don't remember seeing one when K.Y. posted PV IPI support) but > this can be arranged I guess: I can write a dump 'IPI sender' in kernel > and send e.g. 1000 IPIs. So I used the IPI benchmark (https://lkml.org/lkml/2017/12/19/141, thanks for the tip!) on this series. On a 16 vCPU guest (WS2016) I'm getting the following: Before: Dry-run:0 203110 Self-IPI: 6167430 11645550 Normal IPI: 380479300 475881820 Broadcast IPI: 0 2557371420 After: Dry-run:0 214280 (not interesting) Self-IPI: 5706210 10697640 (- 8%) Normal IPI: 379330010 450158830 (- 5%) Broadcast IPI: 0 2340427160 (- 8%) -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: remove pointless if else in rtw_sdio_resume()
Whether any of the conditions is true or not, the return variable is always set to rtw_resume_process(padapter). Replace the if else construct with a single call to rtw_resume_process(). Also remove the now unused local variable pwrpriv. Signed-off-by: Michael Straube --- drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 19 ++- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c index 22191c9584ad..6d02904de63f 100644 --- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c +++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c @@ -605,7 +605,6 @@ static int rtw_sdio_resume(struct device *dev) { struct sdio_func *func =dev_to_sdio_func(dev); struct dvobj_priv *psdpriv = sdio_get_drvdata(func); - struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(psdpriv); struct adapter *padapter = psdpriv->if1; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; int ret = 0; @@ -615,25 +614,11 @@ static int rtw_sdio_resume(struct device *dev) pdbgpriv->dbg_resume_cnt++; - if (pwrpriv->bInternalAutoSuspend) - { - ret = rtw_resume_process(padapter); - } - else - { - if (pwrpriv->wowlan_mode || pwrpriv->wowlan_ap_mode) - { - ret = rtw_resume_process(padapter); - } - else - { - ret = rtw_resume_process(padapter); - } - } + ret = rtw_resume_process(padapter); + pmlmeext->last_scan_time = jiffies; DBG_871X("< %s return %d\n", __func__, ret); return ret; - } static int __init rtw_drv_entry(void) -- 2.18.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] PCI: hv: fix spelling mistake: "reqquest" -> "request"
On Tue, May 08, 2018 at 10:49:46PM +0100, Colin King wrote: > From: Colin Ian King > > Trivial fix to spelling mistake in dev_err error message > > Signed-off-by: Colin Ian King > --- > drivers/pci/host/pci-hyperv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Hi Colin, patch change was superseded, I will drop it from patchwork, thanks for sending it anyway. Lorenzo > diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c > index 50cdefe3f6d3..7e93b4ffb162 100644 > --- a/drivers/pci/host/pci-hyperv.c > +++ b/drivers/pci/host/pci-hyperv.c > @@ -2071,7 +2071,7 @@ static int hv_pci_protocol_negotiation(struct hv_device > *hdev) > VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); > if (ret) { > dev_err(&hdev->device, > - "PCI Pass-through VSP failed sending version > reqquest: %#x", > + "PCI Pass-through VSP failed sending version > request: %#x", > ret); > goto exit; > } > -- > 2.17.0 > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: goldfish: Add goldfish sync driver
Hi Greg, we wanted to include our changes into this year LTS. > get the existing code cleaned up and out of the staging tree? Is this drivers/staging/goldfish? After I deleted the nand driver I see only goldfish_audio there. > Also, this code causes a bunch of build warnings, I could not take it anyway. Yes, I saw them. Regards, Roman. On Thu, Jun 28, 2018 at 8:37 AM Greg KH wrote: > > On Wed, Jun 27, 2018 at 02:50:52PM -0700, r...@google.com wrote: > > From: Roman Kiryanov > > > > This is kernel driver for controlling the Goldfish sync > > device on the host. It is used to maintain ordering > > in critical OpenGL state changes while using > > GPU emulation. > > Why are you adding new features and drivers and not spending the time to > get the existing code cleaned up and out of the staging tree? Please > work on that, I don't want to keep taking new code without any time > being spent on the existing stuff. > > Staging is not a dumping ground, work needs to be done on the code in it > to get it out of the tree. If that doesn't happen, I will remove it. > > Also, this code causes a bunch of build warnings, I could not take it > anyway. Please be more careful in the future. > > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/13] staging: mt7621-pinctrl: avoid space after if condition
Adding spaces between if condition and parenthesis are not needed at all and checkpatch script complains about them. Fix one in driver code. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index 1e49a7b..6c9517f 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -357,7 +357,7 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p) p->pads = devm_kcalloc(p->dev, p->max_pins, sizeof(struct pinctrl_pin_desc), GFP_KERNEL); - if (!p->pads || !p->gpio ) { + if (!p->pads || !p->gpio) { dev_err(p->dev, "Failed to allocate gpio data\n"); return -ENOMEM; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/13] staging: mt7621-pinctrl: some cleanups
This patch series add remaining cleanups from previous series which had problems to applied from here: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-June/121744.html Just send remaining patches in a new patch serie. Hope this helps. Best regards, Sergio Paracuellos Sergio Paracuellos (13): staging: mt7621-pinctrl: avoid space after if condition staging: mt7621-pinctrl: avoid lines over 80 chars staging: mt7621-pinctrl: replace seq_printf with seq_puts staging: mt7621-pinctrl: align function parameters in some functions staging: mt7621-pinctrl: use tabs instead of spaces in some indentations staging: mt7621-pinctrl: make use of pinctrl_utils_free_map staging: mt7621-pinctrl: replace uint8_t type with u8 for 'gpio' field staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map staging: mt7621-dts: use 'function' and 'group' for pinctrl bindings staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function staging: mt7621-pinctrl: use ternary operator return in rt2880_get_group_name staging: mt7621-pinctrl: remove 'rt2880_pinctrl_pin_dbg_show' callback staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver drivers/staging/mt7621-dts/mt7621.dtsi | 48 +++ drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 160 +--- 2 files changed, 80 insertions(+), 128 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/13] staging: mt7621-pinctrl: avoid lines over 80 chars
This commit silence checkpatch warnings about lines which exceeds 80 chars. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 26 ++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index 6c9517f..849af87 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -205,7 +205,8 @@ static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev, /* dont allow double use */ if (p->groups[group].enabled) { - dev_err(p->dev, "%s is already enabled\n", p->groups[group].name); + dev_err(p->dev, "%s is already enabled\n", + p->groups[group].name); return -EBUSY; } @@ -283,8 +284,8 @@ static int rt2880_pinmux_index(struct rt2880_priv *p) } /* allocate the group names array needed by the gpio function */ - p->group_names = devm_kcalloc(p->dev, p->group_count, sizeof(char *), - GFP_KERNEL); + p->group_names = devm_kcalloc(p->dev, p->group_count, + sizeof(char *), GFP_KERNEL); if (!p->group_names) return -1; @@ -318,7 +319,8 @@ static int rt2880_pinmux_index(struct rt2880_priv *p) for (i = 0; i < p->group_count; i++) { for (j = 0; j < p->groups[i].func_count; j++) { f[c] = &p->groups[i].func[j]; - f[c]->groups = devm_kzalloc(p->dev, sizeof(int), GFP_KERNEL); + f[c]->groups = devm_kzalloc(p->dev, sizeof(int), + GFP_KERNEL); f[c]->groups[0] = i; f[c]->group_count = 1; c++; @@ -331,7 +333,10 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p) { int i, j; - /* loop over the functions and initialize the pins array. also work out the highest pin used */ + /* +* loop over the functions and initialize the pins array. +* also work out the highest pin used. +*/ for (i = 0; i < p->func_count; i++) { int pin; @@ -351,12 +356,11 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p) } /* the buffer that tells us which pins are gpio */ - p->gpio = devm_kcalloc(p->dev,p->max_pins, sizeof(uint8_t), - GFP_KERNEL); + p->gpio = devm_kcalloc(p->dev, p->max_pins, + sizeof(uint8_t), GFP_KERNEL); /* the pads needed to tell pinctrl about our pins */ - p->pads = devm_kcalloc(p->dev, - p->max_pins, sizeof(struct pinctrl_pin_desc), - GFP_KERNEL); + p->pads = devm_kcalloc(p->dev, p->max_pins, + sizeof(struct pinctrl_pin_desc), GFP_KERNEL); if (!p->pads || !p->gpio) { dev_err(p->dev, "Failed to allocate gpio data\n"); return -ENOMEM; @@ -439,7 +443,7 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) return -EINVAL; } - range = devm_kzalloc(p->dev, sizeof(struct pinctrl_gpio_range) + 4, GFP_KERNEL); + range = devm_kzalloc(p->dev, sizeof(*range) + 4, GFP_KERNEL); range->name = name = (char *) &range[1]; sprintf(name, "pio"); range->npins = __be32_to_cpu(*ngpio); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/13] staging: mt7621-pinctrl: use tabs instead of spaces in some indentations
Kernel coding style use tabs for indent code instead of spaces. Fix some places where spaces were being used silencing also checkpatch script complains. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index 52d4951..bdee65c 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -99,7 +99,7 @@ static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev, struct device_node *np, struct pinctrl_map **map) { -const char *function; + const char *function; int func = of_property_read_string(np, "ralink,function", &function); int grps = of_property_count_strings(np, "ralink,group"); int i; @@ -108,7 +108,7 @@ static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev, return; for (i = 0; i < grps; i++) { - const char *group; + const char *group; of_property_read_string_index(np, "ralink,group", i, &group); @@ -197,7 +197,7 @@ static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev, unsigned int func, unsigned int group) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); -u32 mode = 0; + u32 mode = 0; u32 reg = SYSC_REG_GPIO_MODE; int i; int shift; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/13] staging: mt7621-pinctrl: align function parameters in some functions
Function parameters along the code has different alignment styles. Just unify all of them making style consistent. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 29 - 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index ea37ae4..52d4951 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -76,8 +76,8 @@ static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev, } static void rt2880_pinctrl_dt_free_map(struct pinctrl_dev *pctrldev, - struct pinctrl_map *map, - unsigned int num_maps) + struct pinctrl_map *map, + unsigned int num_maps) { int i; @@ -96,8 +96,8 @@ static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev, } static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev, - struct device_node *np, - struct pinctrl_map **map) +struct device_node *np, +struct pinctrl_map **map) { const char *function; int func = of_property_read_string(np, "ralink,function", &function); @@ -121,9 +121,9 @@ static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev, } static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev, - struct device_node *np_config, - struct pinctrl_map **map, - unsigned int *num_maps) +struct device_node *np_config, +struct pinctrl_map **map, +unsigned int *num_maps) { int max_maps = 0; struct pinctrl_map *tmp; @@ -169,7 +169,7 @@ static int rt2880_pmx_func_count(struct pinctrl_dev *pctrldev) } static const char *rt2880_pmx_func_name(struct pinctrl_dev *pctrldev, -unsigned int func) + unsigned int func) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); @@ -177,9 +177,9 @@ static const char *rt2880_pmx_func_name(struct pinctrl_dev *pctrldev, } static int rt2880_pmx_group_get_groups(struct pinctrl_dev *pctrldev, - unsigned int func, - const char * const **groups, - unsigned int * const num_groups) + unsigned int func, + const char * const **groups, + unsigned int * const num_groups) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); @@ -194,8 +194,7 @@ static int rt2880_pmx_group_get_groups(struct pinctrl_dev *pctrldev, } static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev, - unsigned int func, - unsigned int group) + unsigned int func, unsigned int group) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); u32 mode = 0; @@ -239,8 +238,8 @@ static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev, } static int rt2880_pmx_group_gpio_request_enable(struct pinctrl_dev *pctrldev, - struct pinctrl_gpio_range *range, - unsigned int pin) + struct pinctrl_gpio_range *range, + unsigned int pin) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/13] staging: mt7621-pinctrl: replace seq_printf with seq_puts
For a constant format without additional arguments, use seq_puts() instead of seq_printf() fixing also the following checkpatch.pl warning: 'Prefer seq_puts to seq_printf' Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index 849af87..ea37ae4 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -92,7 +92,7 @@ static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev, struct seq_file *s, unsigned int offset) { - seq_printf(s, "ralink pio"); + seq_puts(s, "ralink pio"); } static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/13] staging: mt7621-dts: use 'function' and 'group' for pinctrl bindings
According to documentation 'pinctrl-bindings.txt' bindings 'group' and 'function' can be used directly. So replace all of them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 48 +- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi index a87fcc6..4610403 100644 --- a/drivers/staging/mt7621-dts/mt7621.dtsi +++ b/drivers/staging/mt7621-dts/mt7621.dtsi @@ -204,83 +204,83 @@ i2c_pins: i2c { i2c { - ralink,group = "i2c"; - ralink,function = "i2c"; + group = "i2c"; + function = "i2c"; }; }; spi_pins: spi { spi { - ralink,group = "spi"; - ralink,function = "spi"; + group = "spi"; + function = "spi"; }; }; uart1_pins: uart1 { uart1 { - ralink,group = "uart1"; - ralink,function = "uart1"; + group = "uart1"; + function = "uart1"; }; }; uart2_pins: uart2 { uart2 { - ralink,group = "uart2"; - ralink,function = "uart2"; + group = "uart2"; + function = "uart2"; }; }; uart3_pins: uart3 { uart3 { - ralink,group = "uart3"; - ralink,function = "uart3"; + group = "uart3"; + function = "uart3"; }; }; rgmii1_pins: rgmii1 { rgmii1 { - ralink,group = "rgmii1"; - ralink,function = "rgmii1"; + group = "rgmii1"; + function = "rgmii1"; }; }; rgmii2_pins: rgmii2 { rgmii2 { - ralink,group = "rgmii2"; - ralink,function = "rgmii2"; + group = "rgmii2"; + function = "rgmii2"; }; }; mdio_pins: mdio { mdio { - ralink,group = "mdio"; - ralink,function = "mdio"; + group = "mdio"; + function = "mdio"; }; }; pcie_pins: pcie { pcie { - ralink,group = "pcie"; - ralink,function = "pcie rst"; + group = "pcie"; + function = "pcie rst"; }; }; nand_pins: nand { spi-nand { - ralink,group = "spi"; - ralink,function = "nand1"; + group = "spi"; + function = "nand1"; }; sdhci-nand { - ralink,group = "sdhci"; - ralink,function = "nand2"; + group = "sdhci"; + function = "nand2"; }; }; sdhci_pins: sdhci { sdhci { - ralink,group = "sdhci"; - ralink,function = "sdhci"; + group = "sdhci"; + function = "sdhci"; }; }; }; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/13] staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map
Function rt2880_pinctrl_dt_node_to_map was using 'kzalloc' to reserve map memory. There is a 'pinctrl_utils_reserve_map' to do this function. Just use it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index 65c6b5a..8a196d3 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -113,7 +113,10 @@ static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev, struct pinctrl_map **map, unsigned int *num_maps) { + struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); + int ret; int max_maps = 0; + unsigned int reserved_maps = 0; struct pinctrl_map *tmp; struct device_node *np; @@ -127,9 +130,12 @@ static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev, if (!max_maps) return max_maps; - *map = kcalloc(max_maps, sizeof(struct pinctrl_map), GFP_KERNEL); - if (!*map) - return -ENOMEM; + ret = pinctrl_utils_reserve_map(pctrldev, map, &reserved_maps, + num_maps, max_maps); + if (ret) { + dev_err(p->dev, "can't reserve map: %d\n", ret); + return ret; + } tmp = *map; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/13] staging: mt7621-pinctrl: replace uint8_t type with u8 for 'gpio' field
Struct 'rt2880_priv' contains a field 'gpio' which is defined as uint8_t and should be defined with 'u8' which is preferred. Update some cast along the code related with this new change. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index d083866..65c6b5a 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -38,7 +38,7 @@ struct rt2880_priv { const char **group_names; int group_count; - uint8_t *gpio; + u8 *gpio; int max_pins; }; @@ -343,8 +343,7 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p) } /* the buffer that tells us which pins are gpio */ - p->gpio = devm_kcalloc(p->dev, p->max_pins, - sizeof(uint8_t), GFP_KERNEL); + p->gpio = devm_kcalloc(p->dev, p->max_pins, sizeof(u8), GFP_KERNEL); /* the pads needed to tell pinctrl about our pins */ p->pads = devm_kcalloc(p->dev, p->max_pins, sizeof(struct pinctrl_pin_desc), GFP_KERNEL); @@ -353,7 +352,7 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p) return -ENOMEM; } - memset(p->gpio, 1, sizeof(uint8_t) * p->max_pins); + memset(p->gpio, 1, sizeof(u8) * p->max_pins); for (i = 0; i < p->func_count; i++) { if (!p->func[i]->pin_count) continue; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 10/13] staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function
Using 'function' and 'group' bindings in the device tree give the posibility of refactor 'rt2880_pinctrl_dt_node_to_map' and simplify it a lot. Make use of 'for_each_node_with_property' function to count number of groups for the node and iterate over the groups using 'of_property_for_each_string' calling 'pinctrl_utils_add_map_mux' function which is the same of the custom function in this driver code 'rt2880_pinctrl_dt_subnode_to_map' which is not needed anymore. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 58 +++-- 1 file changed, 15 insertions(+), 43 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index 8a196d3..c022718 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -83,65 +83,37 @@ static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev, seq_puts(s, "ralink pio"); } -static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev, -struct device_node *np, -struct pinctrl_map **map) -{ - const char *function; - int func = of_property_read_string(np, "ralink,function", &function); - int grps = of_property_count_strings(np, "ralink,group"); - int i; - - if (func || !grps) - return; - - for (i = 0; i < grps; i++) { - const char *group; - - of_property_read_string_index(np, "ralink,group", i, &group); - - (*map)->type = PIN_MAP_TYPE_MUX_GROUP; - (*map)->name = function; - (*map)->data.mux.group = group; - (*map)->data.mux.function = function; - (*map)++; - } -} - static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev, struct device_node *np_config, struct pinctrl_map **map, unsigned int *num_maps) { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); + struct property *prop; + const char *function_name, *group_name; int ret; - int max_maps = 0; + int ngroups; unsigned int reserved_maps = 0; - struct pinctrl_map *tmp; - struct device_node *np; - - for_each_child_of_node(np_config, np) { - int ret = of_property_count_strings(np, "ralink,group"); - - if (ret >= 0) - max_maps += ret; - } - if (!max_maps) - return max_maps; + for_each_node_with_property(np_config, "group") + ngroups++; ret = pinctrl_utils_reserve_map(pctrldev, map, &reserved_maps, - num_maps, max_maps); + num_maps, ngroups); if (ret) { dev_err(p->dev, "can't reserve map: %d\n", ret); return ret; } - tmp = *map; - - for_each_child_of_node(np_config, np) - rt2880_pinctrl_dt_subnode_to_map(pctrldev, np, &tmp); - *num_maps = max_maps; + of_property_for_each_string(np_config, "group", prop, group_name) { + ret = pinctrl_utils_add_map_mux(pctrldev, map, &reserved_maps, + num_maps, group_name, + function_name); + if (ret) { + dev_err(p->dev, "can't add map: %d\n", ret); + return ret; + } + } return 0; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/13] staging: mt7621-pinctrl: make use of pinctrl_utils_free_map
There was a custom 'rt2880_pinctrl_dt_free_map' function which it was doing the same as pinctrl_utils_free_map defined in 'pinctrl-utils.h' header file. Use it instead avoiding code duplications. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index bdee65c..d083866 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -20,6 +20,7 @@ #include #include "core.h" +#include "pinctrl-utils.h" #define SYSC_REG_GPIO_MODE 0x60 #define SYSC_REG_GPIO_MODE20x64 @@ -75,19 +76,6 @@ static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev, return 0; } -static void rt2880_pinctrl_dt_free_map(struct pinctrl_dev *pctrldev, - struct pinctrl_map *map, - unsigned int num_maps) -{ - int i; - - for (i = 0; i < num_maps; i++) - if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN || - map[i].type == PIN_MAP_TYPE_CONFIGS_GROUP) - kfree(map[i].data.configs.configs); - kfree(map); -} - static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev, struct seq_file *s, unsigned int offset) @@ -158,7 +146,7 @@ static const struct pinctrl_ops rt2880_pctrl_ops = { .get_group_pins = rt2880_get_group_pins, .pin_dbg_show = rt2880_pinctrl_pin_dbg_show, .dt_node_to_map = rt2880_pinctrl_dt_node_to_map, - .dt_free_map= rt2880_pinctrl_dt_free_map, + .dt_free_map= pinctrl_utils_free_map, }; static int rt2880_pmx_func_count(struct pinctrl_dev *pctrldev) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/13] staging: mt7621-pinctrl: use ternary operator return in rt2880_get_group_name
Trivial change to have only one return in 'rt2880_get_group_name' function using a ternary operator instead of an if statement and two returns. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index c022718..a15e8e8 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -54,10 +54,7 @@ static const char *rt2880_get_group_name(struct pinctrl_dev *pctrldev, { struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev); - if (group >= p->group_count) - return NULL; - - return p->group_names[group]; + return (group >= p->group_count) ? NULL : p->group_names[group]; } static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/13] staging: mt7621-pinctrl: remove 'rt2880_pinctrl_pin_dbg_show' callback
The debug information provided by this function does not make sense at all, so just remove it. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index a15e8e8..2cce212 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -73,13 +73,6 @@ static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev, return 0; } -static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev, - struct seq_file *s, - unsigned int offset) -{ - seq_puts(s, "ralink pio"); -} - static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev, struct device_node *np_config, struct pinctrl_map **map, @@ -119,7 +112,6 @@ static const struct pinctrl_ops rt2880_pctrl_ops = { .get_groups_count = rt2880_get_group_count, .get_group_name = rt2880_get_group_name, .get_group_pins = rt2880_get_group_pins, - .pin_dbg_show = rt2880_pinctrl_pin_dbg_show, .dt_node_to_map = rt2880_pinctrl_dt_node_to_map, .dt_free_map= pinctrl_utils_free_map, }; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/13] staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver
We don't really need initialization of this at such an early stage. Just use builtin_platform_driver to initialize this driver. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c index 2cce212..7025942 100644 --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c @@ -422,9 +422,4 @@ static struct platform_driver rt2880_pinmux_driver = { }, }; -int __init rt2880_pinmux_init(void) -{ - return platform_driver_register(&rt2880_pinmux_driver); -} - -core_initcall_sync(rt2880_pinmux_init); +builtin_platform_driver(rt2880_pinmux_driver); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: goldfish: Add goldfish sync driver
On Thu, Jun 28, 2018 at 11:39:53AM -0700, Roman Kiryanov wrote: > Hi Greg, > > we wanted to include our changes into this year LTS. Great, then get the audio driver cleaned up this week and all is fine, it shouldn't take you very long, right? > > get the existing code cleaned up and out of the staging tree? > > Is this drivers/staging/goldfish? After I deleted the nand driver I > see only goldfish_audio there. Yes, what is the plans for that? And the TODO file is a bit outdated now, right? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging: rtl8723bs: bug or pointless if else ?
On Thu, 2018-06-28 at 11:34 +0200, Bastien Nocera wrote: > On Thu, 2018-06-28 at 10:22 +0200, Hans de Goede wrote: > > On 28-06-18 09:43, Michael Straube wrote: > > > ret = rtw_resume_process(padapter) > > > Is this a bug or is the if else construct just pointless? > > It probably is just pointless, my guess would be that once > > upon a time there was a difference in the paths and at some > > point that difference went away. > > Quite: > https://github.com/hadess/rtl8723bs/blob/7d36e26f78bbc709844c12ad0c62e3e8503fdbc5/os_dep/linux/sdio_intf.c#L1757 That #ifdef forest is/was quite unsightly. No wonder the realtek code is unmaintainable. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging:iio:adc:ad7280a: Use GFP_ATOMIC in interrupt handler
Use GFP_ATOMIC rather GFP_KERNEL in interrupt handler, as GFP_KERNEL may sleep according to slab allocator. Signed-off-by: Karim Eshapa --- drivers/staging/iio/adc/ad7280a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index b736275c10f5..25c4fbc303f7 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -692,7 +692,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) unsigned int *channels; int i, ret; - channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_KERNEL); + channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_ATOMIC); if (!channels) return IRQ_HANDLED; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:iio:adc:ad7280a: Use GFP_ATOMIC in interrupt handler
Use GFP_ATOMIC rather GFP_KERNEL in interrupt handler, as GFP_KERNEL may sleep according to slab allocator. Signed-off-by: Karim Eshapa --- drivers/staging/iio/adc/ad7280a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index b736275c10f5..25c4fbc303f7 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -692,7 +692,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) unsigned int *channels; int i, ret; - channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_KERNEL); + channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_ATOMIC); if (!channels) return IRQ_HANDLED; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:iio:adc:ad7280a: Use GFP_ATOMIC in interrupt handler
Use GFP_ATOMIC rather GFP_KERNEL in interrupt handler, as GFP_KERNEL may sleep according to slab allocator. Signed-off-by: Karim Eshapa --- drivers/staging/iio/adc/ad7280a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index b736275c10f5..25c4fbc303f7 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -692,7 +692,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) unsigned int *channels; int i, ret; - channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_KERNEL); + channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_ATOMIC); if (!channels) return IRQ_HANDLED; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging:iio:adc:ad7280a: Use GFP_ATOMIC in interrupt handler
On 06/29/2018 01:55 AM, Karim Eshapa wrote: > Use GFP_ATOMIC rather GFP_KERNEL in interrupt handler, > as GFP_KERNEL may sleep according to slab allocator. This is a threaded interrupt. Sleeping is OK. > > Signed-off-by: Karim Eshapa > --- > drivers/staging/iio/adc/ad7280a.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/iio/adc/ad7280a.c > b/drivers/staging/iio/adc/ad7280a.c > index b736275c10f5..25c4fbc303f7 100644 > --- a/drivers/staging/iio/adc/ad7280a.c > +++ b/drivers/staging/iio/adc/ad7280a.c > @@ -692,7 +692,7 @@ static irqreturn_t ad7280_event_handler(int irq, void > *private) > unsigned int *channels; > int i, ret; > > - channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_KERNEL); > + channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_ATOMIC); > if (!channels) > return IRQ_HANDLED; > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel