[PATCH] hyperv: make HYPERV a menuconfig to ease disabling it all

2017-12-16 Thread Vincent Legoll
No need to get into the submenu to disable all HYPERV-related
config entries.

This makes it easier to disable all HYPERV config options
without entering the submenu. It will also enable one
to see that en/dis-abled state from the outside menu.

This is only intended to change menuconfig UI, not change
the config dependencies.

v2: added "default y" to avoid breaking existing configs

Signed-off-by: Vincent Legoll 
---
 drivers/hv/Kconfig | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
index 50b89ea0e60f..a6cda712135f 100644
--- a/drivers/hv/Kconfig
+++ b/drivers/hv/Kconfig
@@ -1,4 +1,8 @@
-menu "Microsoft Hyper-V guest support"
+menuconfig HYPERV_MENU
+   bool "Microsoft Hyper-V guest support"
+   default y
+
+if HYPERV_MENU
 
 config HYPERV
tristate "Microsoft Hyper-V client drivers"
@@ -23,4 +27,4 @@ config HYPERV_BALLOON
help
  Select this option to enable Hyper-V Balloon driver.
 
-endmenu
+endif # HYPERV_MENU
-- 
2.14.1

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


[PATCH,v2] hyperv: make HYPERV a menuconfig to ease disabling it al

2017-12-16 Thread Vincent Legoll

Hello,

The following patch add a "default y" to the menuconfig to avoid breaking
existing configs.

Please advise if this is better, and sufficient.

Tell me if these kind of changes are not welcome in the kernel, so that I
won't continue with other similar work. I am an actual user of menuconfig,
and find it really harder to use than necessary. A lot of new drivers and
config options have been added, with only a few relevant to my HW.

It is getting very hard to go through menuconfig and disable all the
unneeded stuff.

I use distro kernels on some of my HW, but for the smaller armels or i686s,
I actually want to strip the kernel config.

I find the existing menuconfigs a good solution for that problem, because
they allow me to disable huge lists of stuff when I know I don't need them
without even bothering to enter the menu, an go to each one disabling it.

I may not doing it all right, but I think this kind of patch helps at least
some of us. Please advise if there's a better way.

Thanks

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


Re: [PATCH v2] staging: wilc1000: Fix problems reported by checkpatch

2017-12-16 Thread Morgan Freeman
Hi Aditya,

On Sat, Dec 16, 2017 at 01:24:24PM +0530, Aditya Shankar wrote:
> This commit fixes below style problems in multiple lines
> Fix checkpatch WARNING: line over 80 characters
> 
> Signed-off-by: Aditya Shankar 
> ---

The patch subject is not correct!
I'm pretty sure checkpatch will complain if you run it through:

WARNING: A patch subject line should describe the change not the tool
that found it

Take a look at:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes


Thanks
Himanshu Jha

>  drivers/staging/wilc1000/linux_mon.c | 18 --
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/linux_mon.c 
> b/drivers/staging/wilc1000/linux_mon.c
> index 91d49c4..1c740af 100644
> --- a/drivers/staging/wilc1000/linux_mon.c
> +++ b/drivers/staging/wilc1000/linux_mon.c
> @@ -69,7 +69,8 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
>   if (pkt_offset & IS_MANAGMEMENT_CALLBACK) {
>   /* hostapd callback mgmt frame */
>  
> - skb = dev_alloc_skb(size + sizeof(struct 
> wilc_wfi_radiotap_cb_hdr));
> + skb = dev_alloc_skb(size +
> + sizeof(struct wilc_wfi_radiotap_cb_hdr));
>   if (!skb)
>   return;
>  
> @@ -80,7 +81,8 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
>  
>   cb_hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */
>  
> - cb_hdr->hdr.it_len = cpu_to_le16(sizeof(struct 
> wilc_wfi_radiotap_cb_hdr));
> + cb_hdr->hdr.it_len =
> + cpu_to_le16(sizeof(struct wilc_wfi_radiotap_cb_hdr));
>  
>   cb_hdr->hdr.it_present = cpu_to_le32(
>   (1 << IEEE80211_RADIOTAP_RATE) |
> @@ -96,7 +98,8 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
>   }
>  
>   } else {
> - skb = dev_alloc_skb(size + sizeof(struct 
> wilc_wfi_radiotap_hdr));
> + skb = dev_alloc_skb(size +
> + sizeof(struct wilc_wfi_radiotap_hdr));
>  
>   if (!skb)
>   return;
> @@ -105,7 +108,8 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
>   hdr = skb_push(skb, sizeof(*hdr));
>   memset(hdr, 0, sizeof(struct wilc_wfi_radiotap_hdr));
>   hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */
> - hdr->hdr.it_len = cpu_to_le16(sizeof(struct 
> wilc_wfi_radiotap_hdr));
> + hdr->hdr.it_len =
> + cpu_to_le16(sizeof(struct wilc_wfi_radiotap_hdr));
>   hdr->hdr.it_present = cpu_to_le32
>   (1 << IEEE80211_RADIOTAP_RATE); /* | */
>   hdr->rate = 5; /* txrate->bitrate / 5; */
> @@ -197,7 +201,8 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
>   skb_pull(skb, rtap_len);
>  
>   if (skb->data[0] == 0xc0 && (!(memcmp(broadcast, &skb->data[4], 6 {
> - skb2 = dev_alloc_skb(skb->len + sizeof(struct 
> wilc_wfi_radiotap_cb_hdr));
> + skb2 = dev_alloc_skb(skb->len +
> +  sizeof(struct wilc_wfi_radiotap_cb_hdr));
>   if (!skb2)
>   return -ENOMEM;
>  
> @@ -208,7 +213,8 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
>  
>   cb_hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */
>  
> - cb_hdr->hdr.it_len = cpu_to_le16(sizeof(struct 
> wilc_wfi_radiotap_cb_hdr));
> + cb_hdr->hdr.it_len =
> + cpu_to_le16(sizeof(struct wilc_wfi_radiotap_cb_hdr));
>  
>   cb_hdr->hdr.it_present = cpu_to_le32(
>   (1 << IEEE80211_RADIOTAP_RATE) |
> -- 
> 2.7.4
> 
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192u: ieee80211: ieee80211_rx.c fix checkpatch space prohibited before that '++'

2017-12-16 Thread Abdul Rauf
Fix the following errors:
space prohibited before that '++' (ctx:WxO)

Signed-off-by: Abdul Rauf 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index cbf8eb4a049d..37a610d05ad2 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -110,12 +110,12 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
  hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)hdr;
  tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
- tid ++;
+ tid++;
} else if (IEEE80211_QOS_HAS_SEQ(fc)) {
  hdr_3addrqos = (struct rtl_80211_hdr_3addrqos *)hdr;
  tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
- tid ++;
+ tid++;
} else {
  tid = 0;
}
@@ -177,12 +177,12 @@ static int ieee80211_frag_cache_invalidate(struct 
ieee80211_device *ieee,
  hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)hdr;
  tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
- tid ++;
+ tid++;
} else if (IEEE80211_QOS_HAS_SEQ(fc)) {
  hdr_3addrqos = (struct rtl_80211_hdr_3addrqos *)hdr;
  tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
- tid ++;
+ tid++;
} else {
  tid = 0;
}
@@ -434,12 +434,12 @@ static int is_duplicate_packet(struct ieee80211_device 
*ieee,
  hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)header;
  tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
- tid ++;
+ tid++;
} else if(IEEE80211_QOS_HAS_SEQ(fc)) { //QoS
  hdr_3addrqos = (struct rtl_80211_hdr_3addrqos *)header;
  tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QCTL_TID;
  tid = UP2AC(tid);
- tid ++;
+ tid++;
} else { // no QoS
  tid = 0;
}
-- 
2.15.0

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


Re: [PATCH] hyperv: make HYPERV a menuconfig to ease disabling it all

2017-12-16 Thread Stephen Hemminger
On Thu, 14 Dec 2017 09:43:48 -0800
Randy Dunlap  wrote:

> On 12/13/2017 11:51 PM, Greg KH wrote:
> > On Wed, Dec 13, 2017 at 01:23:38PM -0800, Stephen Hemminger wrote:  
> >> On Wed, 13 Dec 2017 09:54:19 +0100
> >> Vincent Legoll  wrote:
> >>  
> >>> Hello,
> >>>
> >>> On Sun, Dec 10, 2017 at 6:50 AM, Stephen Hemminger
> >>>  wrote:  
>  Will this break existing configs?
> >>>
> >>> I don't think so. Last time I did some similar changes, the kbuild
> >>> test robot found some warnings on some configurations, I hope
> >>> it will find problems (if any) for that series too (this one is not alone,
> >>> I've got a bunch of other similar patches in-flight)
> >>>
> >>> Thanks  
> >>
> >> NAK
> >>
> >> Let me give a concrete example of how this will break users.
> >>
> >> 1. Assume user has a working .config file in their kernel build directory
> >> which builds a kernel that works on Hyper-V.
> >>
> >> 2. Add your patch (or assume it makes into a later version).
> >>
> >> 3. User then does
> >>
> >> $ make oldconfig
> >> scripts/kconfig/conf  --oldconfig Kconfig
> >> *
> >> * Restart config...
> >> *
> >> *
> >> * Microsoft Hyper-V guest support
> >> *
> >> Microsoft Hyper-V guest support (HYPERV_MENU) [N/y] (NEW) 
> >>
> >> If they hit return, the default value is not enabling HyperV and they
> >> will then go on to build a kernel that will not boot on your system.
> >>
> >> The default MUST be set to Yes.  
> 
> That should work.
> 
> > Or you can just not take these types of odd and silly changes to the
> > Kconfig files, and leave it as-is.  I have yet to see the good reason
> > why these are needed at all.  
> 
> Some of us would like to be able to disable many like drivers at one time
> instead of having to go down a list of say 20-30 drivers and disable them
> one at a time.
> 

It makes sense to organize the config if you dont break old configs.
It would be more logical to group and treat all para-virtualized guest
support in same way.  Hyper-V should be next to KVM and Xen.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/3] staging: dgnc: Remove unnecessary parentheses

2017-12-16 Thread Kamal Heib
This patchset cleanup the "Unnecessary parentheses around "
checkpatch.pl error from the dgnc driver.

Kamal Heib (3):
  staging: dgnc: dgnc_tty.c: remove unnecessary parentheses
  staging: dgnc: dgnc_cls.c: remove unnecessary parentheses
  staging: dgnc: dgnc_neo.c: remove unnecessary parentheses

 drivers/staging/dgnc/dgnc_cls.c | 16 
 drivers/staging/dgnc/dgnc_neo.c | 22 +++---
 drivers/staging/dgnc/dgnc_tty.c | 38 +++---
 3 files changed, 38 insertions(+), 38 deletions(-)

-- 
2.14.3

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


[PATCH 2/3] staging: dgnc: dgnc_cls.c: remove unnecessary parentheses

2017-12-16 Thread Kamal Heib
Cleanup the "Unnecessary parentheses around " checkpatch.pl error.

Signed-off-by: Kamal Heib 
---
 drivers/staging/dgnc/dgnc_cls.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index e264fe11cba4..aed6e9cb24a6 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -706,7 +706,7 @@ static void cls_param(struct tty_struct *tty)
 * unit is NOT open
 */
if (!(ch->ch_tun.un_flags & UN_ISOPEN) &&
-   (un->un_type == DGNC_PRINT))
+   un->un_type == DGNC_PRINT)
baud = C_BAUD(ch->ch_pun.un_tty) & 0xff;
else
baud = C_BAUD(ch->ch_tun.un_tty) & 0xff;
@@ -719,8 +719,8 @@ static void cls_param(struct tty_struct *tty)
 
jindex = baud;
 
-   if ((iindex >= 0) && (iindex < 4) && (jindex >= 0) &&
-   (jindex < 16)) {
+   if (iindex >= 0 && iindex < 4 && jindex >= 0 &&
+   jindex < 16) {
baud = bauds[iindex][jindex];
} else {
baud = 0;
@@ -820,8 +820,8 @@ static void cls_param(struct tty_struct *tty)
if (ch->ch_digi.digi_flags & CTSPACE || ch->ch_c_cflag & CRTSCTS) {
cls_set_cts_flow_control(ch);
} else if (ch->ch_c_iflag & IXON) {
-   if ((ch->ch_startc == _POSIX_VDISABLE) ||
-   (ch->ch_stopc == _POSIX_VDISABLE))
+   if (ch->ch_startc == _POSIX_VDISABLE ||
+   ch->ch_stopc == _POSIX_VDISABLE)
cls_set_no_output_flow_control(ch);
else
cls_set_ixon_flow_control(ch);
@@ -832,8 +832,8 @@ static void cls_param(struct tty_struct *tty)
if (ch->ch_digi.digi_flags & RTSPACE || ch->ch_c_cflag & CRTSCTS) {
cls_set_rts_flow_control(ch);
} else if (ch->ch_c_iflag & IXOFF) {
-   if ((ch->ch_startc == _POSIX_VDISABLE) ||
-   (ch->ch_stopc == _POSIX_VDISABLE))
+   if (ch->ch_startc == _POSIX_VDISABLE ||
+   ch->ch_stopc == _POSIX_VDISABLE)
cls_set_no_input_flow_control(ch);
else
cls_set_ixoff_flow_control(ch);
@@ -870,7 +870,7 @@ static void cls_tasklet(unsigned long data)
 */
spin_lock_irqsave(&bd->bd_intr_lock, flags);
 
-   if ((state == BOARD_READY) && (ports > 0)) {
+   if (state == BOARD_READY && ports > 0) {
for (i = 0; i < ports; i++) {
ch = bd->channels[i];
 
-- 
2.14.3

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


[PATCH 1/3] staging: dgnc: dgnc_tty.c: remove unnecessary parentheses

2017-12-16 Thread Kamal Heib
Cleanup the "Unnecessary parentheses around " checkpatch.pl error.

Signed-off-by: Kamal Heib 
---
 drivers/staging/dgnc/dgnc_tty.c | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index d3736daf8cf2..4bf2ae3bf3be 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -525,7 +525,7 @@ void dgnc_carrier(struct channel_t *ch)
 
/* Test for a VIRTUAL carrier transition to HIGH. */
 
-   if (((ch->ch_flags & CH_FCAR) == 0) && (virt_carrier == 1)) {
+   if (((ch->ch_flags & CH_FCAR) == 0) && virt_carrier == 1) {
/*
 * When carrier rises, wake any threads waiting
 * for carrier in the open routine.
@@ -536,7 +536,7 @@ void dgnc_carrier(struct channel_t *ch)
 
/* Test for a PHYSICAL carrier transition to HIGH. */
 
-   if (((ch->ch_flags & CH_CD) == 0) && (phys_carrier == 1)) {
+   if (((ch->ch_flags & CH_CD) == 0) && phys_carrier == 1) {
/*
 * When carrier rises, wake any threads waiting
 * for carrier in the open routine.
@@ -554,8 +554,8 @@ void dgnc_carrier(struct channel_t *ch)
 *  matter... it really only means "ignore carrier state", not
 *  "make pretend that carrier is there".
 */
-   if ((virt_carrier == 0) && ((ch->ch_flags & CH_CD) != 0) &&
-   (phys_carrier == 0)) {
+   if (virt_carrier == 0 && ((ch->ch_flags & CH_CD) != 0) &&
+   phys_carrier == 0) {
/*
 *   When carrier drops:
 *
@@ -759,8 +759,8 @@ void dgnc_wakeup_writes(struct channel_t *ch)
 * the queue AND FIFO are both empty.
 */
if (ch->ch_tun.un_flags & UN_EMPTY) {
-   if ((qlen == 0) &&
-   (ch->ch_bd->bd_ops->get_uart_bytes_left(ch) == 0)) {
+   if (qlen == 0 &&
+   ch->ch_bd->bd_ops->get_uart_bytes_left(ch) == 0) {
ch->ch_tun.un_flags &= ~(UN_EMPTY);
 
/*
@@ -790,8 +790,8 @@ void dgnc_wakeup_writes(struct channel_t *ch)
 * the queue AND FIFO are both empty.
 */
if (ch->ch_pun.un_flags & UN_EMPTY) {
-   if ((qlen == 0) &&
-   (ch->ch_bd->bd_ops->get_uart_bytes_left(ch) == 0))
+   if (qlen == 0 &&
+   ch->ch_bd->bd_ops->get_uart_bytes_left(ch) == 0)
ch->ch_pun.un_flags &= ~(UN_EMPTY);
}
 
@@ -1162,7 +1162,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct 
file *file)
 * Determine if this is the last close or not - and if we agree about
 * which type of close it is with the Line Discipline
 */
-   if ((tty->count == 1) && (un->un_open_count != 1)) {
+   if (tty->count == 1 && un->un_open_count != 1) {
/*
 * Uh, oh.  tty->count is 1, which means that the tty
 * structure will be freed.  un_open_count should always
@@ -1199,13 +1199,13 @@ static void dgnc_tty_close(struct tty_struct *tty, 
struct file *file)
 * Only officially close channel if count is 0 and
 * DIGI_PRINTER bit is not set.
 */
-   if ((ch->ch_open_count == 0) &&
+   if (ch->ch_open_count == 0 &&
!(ch->ch_digi.digi_flags & DIGI_PRINTER)) {
ch->ch_flags &= ~(CH_STOPI | CH_FORCED_STOPI);
 
/* turn off print device when closing print device. */
 
-   if ((un->un_type == DGNC_PRINT) && (ch->ch_flags & CH_PRON)) {
+   if (un->un_type == DGNC_PRINT && (ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_offstr,
   (int)ch->ch_digi.digi_offlen);
ch->ch_flags &= ~CH_PRON;
@@ -1250,7 +1250,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct 
file *file)
} else {
/* turn off print device when closing print device. */
 
-   if ((un->un_type == DGNC_PRINT) && (ch->ch_flags & CH_PRON)) {
+   if (un->un_type == DGNC_PRINT && (ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_offstr,
   (int)ch->ch_digi.digi_offlen);
ch->ch_flags &= ~CH_PRON;
@@ -1474,7 +1474,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
 * Output the printer ON string, if we are in terminal mode, but
 * need to be in printer mode.
 */
-   if ((un->un_type == DGNC_PRINT) && !(ch->ch_flags & CH_PRON)) {
+   if (un->un_type == DGNC_PRINT && !(ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_

[PATCH 3/3] staging: dgnc: dgnc_neo.c: remove unnecessary parentheses

2017-12-16 Thread Kamal Heib
Cleanup the "Unnecessary parentheses around " checkpatch.pl error.

Signed-off-by: Kamal Heib 
---
 drivers/staging/dgnc/dgnc_neo.c | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 0ae229c3..45bf2dd01bb9 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -651,7 +651,7 @@ static void neo_param(struct tty_struct *tty)
 * is NOT open
 */
if (!(ch->ch_tun.un_flags & UN_ISOPEN) &&
-   (un->un_type == DGNC_PRINT))
+   un->un_type == DGNC_PRINT)
baud = C_BAUD(ch->ch_pun.un_tty) & 0xff;
else
baud = C_BAUD(ch->ch_tun.un_tty) & 0xff;
@@ -664,8 +664,8 @@ static void neo_param(struct tty_struct *tty)
 
jindex = baud;
 
-   if ((iindex >= 0) && (iindex < 4) &&
-   (jindex >= 0) && (jindex < 16))
+   if (iindex >= 0 && iindex < 4 &&
+   jindex >= 0 && jindex < 16)
baud = bauds[iindex][jindex];
else
baud = 0;
@@ -767,8 +767,8 @@ static void neo_param(struct tty_struct *tty)
if (ch->ch_digi.digi_flags & CTSPACE || ch->ch_c_cflag & CRTSCTS) {
neo_set_cts_flow_control(ch);
} else if (ch->ch_c_iflag & IXON) {
-   if ((ch->ch_startc == _POSIX_VDISABLE) ||
-   (ch->ch_stopc == _POSIX_VDISABLE))
+   if (ch->ch_startc == _POSIX_VDISABLE ||
+   ch->ch_stopc == _POSIX_VDISABLE)
neo_set_no_output_flow_control(ch);
else
neo_set_ixon_flow_control(ch);
@@ -779,8 +779,8 @@ static void neo_param(struct tty_struct *tty)
if (ch->ch_digi.digi_flags & RTSPACE || ch->ch_c_cflag & CRTSCTS) {
neo_set_rts_flow_control(ch);
} else if (ch->ch_c_iflag & IXOFF) {
-   if ((ch->ch_startc == _POSIX_VDISABLE) ||
-   (ch->ch_stopc == _POSIX_VDISABLE))
+   if (ch->ch_startc == _POSIX_VDISABLE ||
+   ch->ch_stopc == _POSIX_VDISABLE)
neo_set_no_input_flow_control(ch);
else
neo_set_ixoff_flow_control(ch);
@@ -827,7 +827,7 @@ static void neo_tasklet(unsigned long data)
 */
spin_lock_irqsave(&bd->bd_intr_lock, flags);
 
-   if ((state == BOARD_READY) && (ports > 0)) {
+   if (state == BOARD_READY && ports > 0) {
for (i = 0; i < ports; i++) {
ch = bd->channels[i];
if (!ch)
@@ -1677,9 +1677,9 @@ static void neo_vpd(struct dgnc_board *brd)
 * 0x10 : long resource name tage (PCI-66 files)
 * 0x7F : small resource end tag
 */
-   if  (((brd->vpd[0x08] != 0x82) &&
- (brd->vpd[0x10] != 0x82)) ||
-(brd->vpd[0x7F] != 0x78)) {
+   if  ((brd->vpd[0x08] != 0x82 &&
+ brd->vpd[0x10] != 0x82) ||
+brd->vpd[0x7F] != 0x78) {
memset(brd->vpd, '\0', NEO_VPD_IMAGESIZE);
} else {
/* Search for the serial number */
-- 
2.14.3

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


[PATCH 1/1] drivers: android: Cleanup warnings

2017-12-16 Thread Harsh Shandilya
Ran checkpatch across the entire drivers/android
directory and fixed all relevant warnings. Summary
of changes done:

 -> Convert all symbolic permissions into their
octal equivalents.
 -> Use "%s", __func__ in logging macros where the
function name was previously hard-coded.
 -> Add a blank line to separate declarations from
statements according to the kernel coding style
guidelines.
 -> Fix linelength issues wherever possible.
 -> Fix-up a commented out statement to use // in place
of /* */ to silence checkpatch.

Most line-length warnings were ignored in favor
of code readability.

Cc: Greg Kroah-Hartman 
Cc: Todd Kjos 
Cc: Martijn Coenen 
Cc: de...@driverdev.osuosl.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Harsh Shandilya 
---
 drivers/android/binder.c   | 39 ++-
 drivers/android/binder_alloc.c |  1 +
 2 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index bccec9de0533..2c06a42a6d9a 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -141,7 +141,7 @@ enum {
 };
 static uint32_t binder_debug_mask = BINDER_DEBUG_USER_ERROR |
BINDER_DEBUG_FAILED_TRANSACTION | BINDER_DEBUG_DEAD_TRANSACTION;
-module_param_named(debug_mask, binder_debug_mask, uint, S_IWUSR | S_IRUGO);
+module_param_named(debug_mask, binder_debug_mask, uint, 0644);
 
 static char *binder_devices_param = CONFIG_ANDROID_BINDER_DEVICES;
 module_param_named(devices, binder_devices_param, charp, 0444);
@@ -160,7 +160,7 @@ static int binder_set_stop_on_user_error(const char *val,
return ret;
 }
 module_param_call(stop_on_user_error, binder_set_stop_on_user_error,
-   param_get_int, &binder_stop_on_user_error, S_IWUSR | S_IRUGO);
+   param_get_int, &binder_stop_on_user_error, 0644);
 
 #define binder_debug(mask, x...) \
do { \
@@ -3250,6 +3250,7 @@ static int binder_thread_write(struct binder_proc *proc,
ret = -1;
if (increment && !target) {
struct binder_node *ctx_mgr_node;
+
mutex_lock(&context->context_mgr_node_lock);
ctx_mgr_node = context->binder_context_mgr_node;
if (ctx_mgr_node)
@@ -3356,7 +3357,8 @@ static int binder_thread_write(struct binder_proc *proc,
binder_debug(BINDER_DEBUG_USER_REFS,
 "%d:%d %s node %d ls %d lw %d tr %d\n",
 proc->pid, thread->pid,
-cmd == BC_INCREFS_DONE ? "BC_INCREFS_DONE" 
: "BC_ACQUIRE_DONE",
+cmd == BC_INCREFS_DONE ? "BC_INCREFS_DONE" 
:
+"BC_ACQUIRE_DONE",
 node->debug_id, node->local_strong_refs,
 node->local_weak_refs, node->tmp_refs);
binder_node_inner_unlock(node);
@@ -3394,7 +3396,8 @@ static int binder_thread_write(struct binder_proc *proc,
 "%d:%d BC_FREE_BUFFER u%016llx found 
buffer %d for %s transaction\n",
 proc->pid, thread->pid, (u64)data_ptr,
 buffer->debug_id,
-buffer->transaction ? "active" : 
"finished");
+buffer->transaction ? "active" :
+"finished");
 
if (buffer->transaction) {
buffer->transaction->buffer = NULL;
@@ -3858,7 +3861,8 @@ static int binder_thread_read(struct binder_proc *proc,
binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE);
} break;
case BINDER_WORK_NODE: {
-   struct binder_node *node = container_of(w, struct 
binder_node, work);
+   struct binder_node *node =
+   container_of(w, struct binder_node, work);
int strong, weak;
binder_uintptr_t node_ptr = node->ptr;
binder_uintptr_t node_cookie = node->cookie;
@@ -4467,8 +4471,8 @@ static long binder_ioctl(struct file *filp, unsigned int 
cmd, unsigned long arg)
unsigned int size = _IOC_SIZE(cmd);
void __user *ubuf = (void __user *)arg;
 
-   /*pr_info("binder_ioctl: %d:%d %x %lx\n",
-   proc->pid, current->pid, cmd, arg);*/
+   // pr_info("%s: %d:%d %x %lx\n",
+   //  __func__, proc->pid, current->pid, cmd, arg);
 
binder_selftest_alloc(&proc->alloc);
 
@@ -4631,8 +4635,9 @@ static int binder_mmap(struct file *filp, struct 
vm_area_struct *vma)
return 0;
 
 err_bad_arg:
-   pr_err("binder_mmap: %d %lx-%lx %s failed %d\n",
-

Re: [PATCH 04/10] staging: ccree: staging: ccree: replace sysfs by debugfs interface

2017-12-16 Thread Gilad Ben-Yossef
On Thu, Dec 14, 2017 at 4:30 PM, Philippe Ombredanne
 wrote:
> Gilad,
>
> On Thu, Dec 14, 2017 at 3:02 PM, Gilad Ben-Yossef  wrote:
>> The ccree driver has had a none standard sysfs interface for debugging.
>> Replace it with a proper debugfs interface.
>>
>> Signed-off-by: Gilad Ben-Yossef 
>
> 
>
>> --- /dev/null
>> +++ b/drivers/staging/ccree/cc_debugfs.c
>> @@ -0,0 +1,114 @@
>> +/*
>> + * Copyright (C) 2012-2017 ARM Limited or its affiliates.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + *
>> + * 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.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program; if not, see .
>> + */
>
> Could you use the new SPDX tags instead of this fine and long
> boilerplate? See Thomas doc for details [1]


That's a good idea. I'll prepare a patch set to turn the entire driver.

Thanks,
Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

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