Re: [PATCH] staging: ks7010: clean up code

2017-03-04 Thread Joe Perches
On Sat, 2017-03-04 at 08:49 +0200, Ernestas Kulik wrote:
> On Fri, 2017-03-03 at 22:37-0800, Joe Perches wrote:
> > 
> > struct hostif_hdr.event is declared at uint16_t
> > and not as __le16 so I believe this is incorrect
> > and actually introduces a sparse error.
> 
> Sure, but I change that in the patch. :)

More stuff the changelog doesn't show :(

On Fri, 2017-03-03 at 22:58 +0200, Ernestas Kulik wrote:
> This fixes type warnings generated by sparse, replaces instances of
> ntohs() with be16_to_cpu() and removes unused fields in structs.

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


Re: [PATCH linux-next] staging: vchiq_arm: coding style

2017-03-04 Thread Stefan Wahren

> Sergiy Redko  hat am 4. März 2017 um 06:15 geschrieben:
> 
> 
> On 03/03, Stefan Wahren wrote:
> > Hi Sergiy,
> > 
> > Am 03.03.2017 um 09:05 schrieb Sergiy Redko:
> > > fix coding style: move brace to the line above
> > 
> > please make the subject of your patch more distinct. We get a lot of
> > coding style fixes for vchiq.
> > 
> > Btw it looks you missed to add Greg as staging maintainer.
> > 
> > >
> > > Signed-off-by: Sergiy Redko 
> > > ---
> > >  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git 
> > > a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c 
> > > b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c
> > > index 48984abc3854..ca896a518e15 100644
> > > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c
> > > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c
> > > @@ -797,8 +797,7 @@ int32_t vchi_get_peer_version(const 
> > > VCHI_SERVICE_HANDLE_T handle, short *peer_ve
> > >  {
> > >   int32_t ret = -1;
> > >   SHIM_SERVICE_T *service = (SHIM_SERVICE_T *)handle;
> > > - if (service)
> > > - {
> > > + if (service) {
> > 
> > Since you want to fix coding stlye i think it's better to leave an empty
> > line between the declaration and the if statement.
> > 
> > Stefan
> > 
> > >   VCHIQ_STATUS_T status;
> > >  
> > >   status = vchiq_get_peer_version(service->handle, peer_version);
> > 
> > 
> Hi Stefan, 
> 
> Thanks for the feedback.
> 
> I'm not sure what to do next.
> I'm guessing I should update my patch with your suggestion and
> resubmit it with Greg in CC.

Yes

> 
> Should I send it as next message in this thread or start a new
> thread with a better subject.

Please start a new thread for V2 of your patch and don't forget the changelog.

Thanks

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


Re: [patch 2/3] speakup: convert screen reading to 16bit characters

2017-03-04 Thread Okash Khawaja
On Thu, Mar 02, 2017 at 02:53:55AM +0100, Samuel Thibault wrote:
> This adds 16bit character support to most of the screen reading by
> extending characters to u16 throughout the code.
> 
> Non-latin1 characters are assumed to be alphabetic type for now.
> 
> non-latin1 vt_notifier_call-provided characters are not ignored any
> more, and the 16bit character returned by get_char is not truncated any
> more. For simplicity, speak_char still only supports latin1 characters.
> Its direct mode however does support 16bit characters, so in practice
> this will not be a limitation, non-latin1 languages will be handled by
> the synthesizer. spelling words does not support direct mode yet, for
> simplicity for now it will ignore 16bit characters.
> 
> For simplicity again, speakup messages are left in latin1 for now.
> 
> Some coding style is fixed along the way.
> 
> Signed-off-by: Samuel Thibault 
> 
> Index: linux-4.10/drivers/staging/speakup/main.c
> ===
> --- linux-4.10.orig/drivers/staging/speakup/main.c
> +++ linux-4.10/drivers/staging/speakup/main.c
> @@ -67,7 +67,7 @@ MODULE_PARM_DESC(quiet, "Do not announce
>  special_func spk_special_handler;
>  
>  short spk_pitch_shift, synth_flags;
> -static char buf[256];
> +static u16 buf[256];
>  int spk_attrib_bleep, spk_bleeps, spk_bleep_time = 10;
>  int spk_no_intr, spk_spell_delay;
>  int spk_key_echo, spk_say_word_ctl;
> @@ -112,7 +112,7 @@ enum {
>  
>  static struct tty_struct *tty;
>  
> -static void spkup_write(const char *in_buf, int count);
> +static void spkup_write(const u16 *in_buf, int count);
>  
>  static char *phonetic[] = {
>   "alfa", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel",
> @@ -238,7 +238,8 @@ static u_short default_chartab[256] = {
>  struct task_struct *speakup_task;
>  struct bleep spk_unprocessed_sound;
>  static int spk_keydown;
> -static u_char spk_lastkey, spk_close_press, keymap_flags;
> +static u16 spk_lastkey;
> +static u_char spk_close_press, keymap_flags;
>  static u_char last_keycode, this_speakup_key;
>  static u_long last_spk_jiffy;
>  
> @@ -426,9 +427,9 @@ static void announce_edge(struct vc_data
>   spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1));
>  }
>  
> -static void speak_char(u_char ch)
> +static void speak_char(u16 ch)
>  {
> - char *cp = spk_characters[ch];
> + char *cp;
>   struct var_t *direct = spk_get_var(DIRECT);
>  
>   if (direct && direct->u.n.value) {
> @@ -436,11 +437,15 @@ static void speak_char(u_char ch)
>   spk_pitch_shift++;
>   synth_printf("%s", spk_str_caps_start);
>   }
> - synth_printf("%c", ch);
> + synth_putwc_s(ch);
>   if (IS_CHAR(ch, B_CAP))
>   synth_printf("%s", spk_str_caps_stop);
>   return;
>   }
> +
> + if (ch >= 0x100)
> + return;
> + cp = spk_characters[ch];
>   if (cp == NULL) {
>   pr_info("speak_char: cp == NULL!\n");
>   return;
> @@ -486,7 +491,7 @@ static u16 get_char(struct vc_data *vc,
>  
>  static void say_char(struct vc_data *vc)
>  {
> - u_short ch;
> + u16 ch;
>  
>   spk_old_attr = spk_attr;
>   ch = get_char(vc, (u_short *)spk_pos, &spk_attr);
> @@ -496,20 +501,20 @@ static void say_char(struct vc_data *vc)
>   if (spk_attrib_bleep & 2)
>   say_attributes(vc);
>   }
> - speak_char(ch & 0xff);
> + speak_char(ch);
>  }
>  
>  static void say_phonetic_char(struct vc_data *vc)
>  {
> - u_short ch;
> + u16 ch;
>  
>   spk_old_attr = spk_attr;
>   ch = get_char(vc, (u_short *)spk_pos, &spk_attr);
> - if (isascii(ch) && isalpha(ch)) {
> + if (ch <= 0x7f && isalpha(ch)) {
>   ch &= 0x1f;
>   synth_printf("%s\n", phonetic[--ch]);
>   } else {
> - if (IS_CHAR(ch, B_NUM))
> + if (ch < 0x100 && IS_CHAR(ch, B_NUM))
>   synth_printf("%s ", spk_msg_get(MSG_NUMBER));
>   speak_char(ch);
>   }
> @@ -551,42 +556,42 @@ static void say_next_char(struct vc_data
>  static u_long get_word(struct vc_data *vc)
>  {
>   u_long cnt = 0, tmpx = spk_x, tmp_pos = spk_pos;
> - char ch;
> - u_short attr_ch;
> + u16 ch;
> + u16 attr_ch;
>   u_char temp;
>  
>   spk_old_attr = spk_attr;
> - ch = (char)get_char(vc, (u_short *)tmp_pos, &temp);
> + ch = get_char(vc, (u_short *)tmp_pos, &temp);
>  
>  /* decided to take out the sayword if on a space (mis-information */
>   if (spk_say_word_ctl && ch == SPACE) {
>   *buf = '\0';
>   synth_printf("%s\n", spk_msg_get(MSG_SPACE));
>   return 0;
> - } else if ((tmpx < vc->vc_cols - 2)
> -&& (ch == SPACE || ch == 0 || IS_WDLM(ch))
> -&& ((char)get_char(vc, (u_short *)&tmp_pos + 1, &temp) >
>

[PATCH v2] staging: ks7010: fix sparse warnings

2017-03-04 Thread Ernestas Kulik
Currently, sparse generates many warnings for the driver. This commit
changes the types of struct fields/function variables to match the
endianness at their assignment.

Signed-off-by: Ernestas Kulik 
---
Changes from v1:
* Change the type of the variable being passed to ntohs() instead of casting it
* Don’t remove any struct fields

 drivers/staging/ks7010/eap_packet.h  |  4 +-
 drivers/staging/ks7010/ks7010_sdio.c | 12 +++--
 drivers/staging/ks7010/ks_hostif.c   | 24 +-
 drivers/staging/ks7010/ks_hostif.h   | 90 ++--
 drivers/staging/ks7010/ks_wlan.h |  2 +-
 5 files changed, 68 insertions(+), 64 deletions(-)

diff --git a/drivers/staging/ks7010/eap_packet.h 
b/drivers/staging/ks7010/eap_packet.h
index df7f760e4110..fd39d28be834 100644
--- a/drivers/staging/ks7010/eap_packet.h
+++ b/drivers/staging/ks7010/eap_packet.h
@@ -16,7 +16,7 @@ struct ether_hdr {
unsigned char h_source_snap;
unsigned char h_command;
unsigned char h_vendor_id[3];
-   unsigned short h_proto; /* packet type ID field */
+   __be16 h_proto; /* packet type ID field */
 #define ETHER_PROTOCOL_TYPE_EAP0x888e
 #define ETHER_PROTOCOL_TYPE_IP 0x0800
 #define ETHER_PROTOCOL_TYPE_ARP0x0806
@@ -86,7 +86,7 @@ struct ieee802_1x_eapol_key {
 
 struct wpa_eapol_key {
unsigned char type;
-   unsigned short key_info;
+   __be16 key_info;
unsigned short key_length;
unsigned char replay_counter[WPA_REPLAY_COUNTER_LEN];
unsigned char key_nonce[WPA_NONCE_LEN];
diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
b/drivers/staging/ks7010/ks7010_sdio.c
index 6f9f746a3a61..8e644ff8eca8 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -297,7 +297,8 @@ static int write_to_device(struct ks_wlan_private *priv, 
unsigned char *buffer,
hdr = (struct hostif_hdr *)buffer;
 
DPRINTK(4, "size=%d\n", hdr->size);
-   if (hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event) {
+   if (le16_to_cpu(hdr->event) < HIF_DATA_REQ ||
+   HIF_REQ_MAX < le16_to_cpu(hdr->event)) {
DPRINTK(1, "unknown event=%04X\n", hdr->event);
return 0;
}
@@ -361,13 +362,14 @@ int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, 
unsigned long size,
 
hdr = (struct hostif_hdr *)p;
 
-   if (hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event) {
+   if (le16_to_cpu(hdr->event) < HIF_DATA_REQ ||
+   HIF_REQ_MAX < le16_to_cpu(hdr->event)) {
DPRINTK(1, "unknown event=%04X\n", hdr->event);
return 0;
}
 
/* add event to hostt buffer */
-   priv->hostt.buff[priv->hostt.qtail] = hdr->event;
+   priv->hostt.buff[priv->hostt.qtail] = le16_to_cpu(hdr->event);
priv->hostt.qtail = (priv->hostt.qtail + 1) % SME_EVENT_BUFF_SIZE;
 
DPRINTK(4, "event=%04X\n", hdr->event);
@@ -406,7 +408,7 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
struct rx_device_buffer *rx_buffer;
struct hostif_hdr *hdr;
unsigned char read_status;
-   unsigned short event = 0;
+   __le16 event = 0;
 
DPRINTK(4, "\n");
 
@@ -459,7 +461,7 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
DPRINTK(4, "READ_STATUS=%02X\n", read_status);
 
if (atomic_read(&priv->psstatus.confirm_wait)) {
-   if (IS_HIF_CONF(event)) {
+   if (IS_HIF_CONF(le16_to_cpu(event))) {
DPRINTK(4, "IS_HIF_CONF true !!\n");
atomic_dec(&priv->psstatus.confirm_wait);
}
diff --git a/drivers/staging/ks7010/ks_hostif.c 
b/drivers/staging/ks7010/ks_hostif.c
index da7c42ef05f5..6ffc505d2cd8 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -1867,7 +1867,7 @@ void hostif_receive(struct ks_wlan_private *priv, 
unsigned char *p,
 static
 void hostif_sme_set_wep(struct ks_wlan_private *priv, int type)
 {
-   uint32_t val;
+   __le32 val;
 
switch (type) {
case SME_WEP_INDEX_REQUEST:
@@ -1916,13 +1916,13 @@ void hostif_sme_set_wep(struct ks_wlan_private *priv, 
int type)
 }
 
 struct wpa_suite_t {
-   unsigned short size;
+   __le16 size;
unsigned char suite[4][CIPHER_ID_LEN];
 } __packed;
 
 struct rsn_mode_t {
-   uint32_t rsn_mode;
-   uint16_t rsn_capability;
+   __le32 rsn_mode;
+   __le16 rsn_capability;
 } __packed;
 
 static
@@ -1930,7 +1930,7 @@ void hostif_sme_set_rsn(struct ks_wlan_private *priv, int 
type)
 {
struct wpa_suite_t wpa_suite;
struct rsn_mode_t rsn_mode;
-   uint32_t val;
+   __le32 val;
 
memset(&wpa_suite, 0, sizeof(wpa_suite));
 
@@ -1982,7 +1982,8 @@ void hostif_sme_set_rsn(struct ks_wlan_private *priv, int 
type)
 
hostif_mib_set_request(priv, DOT11_RSN_CONFIG_UNICAST_CIPHER,
   

Re: [patch 2/3] speakup: convert screen reading to 16bit characters

2017-03-04 Thread Okash Khawaja
On Thu, Mar 02, 2017 at 02:53:55AM +0100, Samuel Thibault wrote:
> This adds 16bit character support to most of the screen reading by
> extending characters to u16 throughout the code.
> 
> Non-latin1 characters are assumed to be alphabetic type for now.
> 
> non-latin1 vt_notifier_call-provided characters are not ignored any
> more, and the 16bit character returned by get_char is not truncated any
> more. For simplicity, speak_char still only supports latin1 characters.
> Its direct mode however does support 16bit characters, so in practice
> this will not be a limitation, non-latin1 languages will be handled by
> the synthesizer. spelling words does not support direct mode yet, for
> simplicity for now it will ignore 16bit characters.
> 
> For simplicity again, speakup messages are left in latin1 for now.
> 
> Some coding style is fixed along the way.
> 
> Signed-off-by: Samuel Thibault 
> 
> Index: linux-4.10/drivers/staging/speakup/main.c
> ===
> --- linux-4.10.orig/drivers/staging/speakup/main.c
> +++ linux-4.10/drivers/staging/speakup/main.c
> @@ -67,7 +67,7 @@ MODULE_PARM_DESC(quiet, "Do not announce
>  special_func spk_special_handler;
>  
>  short spk_pitch_shift, synth_flags;
> -static char buf[256];
> +static u16 buf[256];
>  int spk_attrib_bleep, spk_bleeps, spk_bleep_time = 10;
>  int spk_no_intr, spk_spell_delay;
>  int spk_key_echo, spk_say_word_ctl;
> @@ -112,7 +112,7 @@ enum {
>  
>  static struct tty_struct *tty;
>  
> -static void spkup_write(const char *in_buf, int count);
> +static void spkup_write(const u16 *in_buf, int count);
>  
>  static char *phonetic[] = {
>   "alfa", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel",
> @@ -238,7 +238,8 @@ static u_short default_chartab[256] = {
>  struct task_struct *speakup_task;
>  struct bleep spk_unprocessed_sound;
>  static int spk_keydown;
> -static u_char spk_lastkey, spk_close_press, keymap_flags;
> +static u16 spk_lastkey;
> +static u_char spk_close_press, keymap_flags;
>  static u_char last_keycode, this_speakup_key;
>  static u_long last_spk_jiffy;
>  
> @@ -426,9 +427,9 @@ static void announce_edge(struct vc_data
>   spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1));
>  }
>  
> -static void speak_char(u_char ch)
> +static void speak_char(u16 ch)
>  {
> - char *cp = spk_characters[ch];
> + char *cp;
>   struct var_t *direct = spk_get_var(DIRECT);
>  
>   if (direct && direct->u.n.value) {
> @@ -436,11 +437,15 @@ static void speak_char(u_char ch)
>   spk_pitch_shift++;
>   synth_printf("%s", spk_str_caps_start);
>   }
> - synth_printf("%c", ch);
> + synth_putwc_s(ch);
>   if (IS_CHAR(ch, B_CAP))
>   synth_printf("%s", spk_str_caps_stop);
>   return;
>   }
> +
> + if (ch >= 0x100)
> + return;
> + cp = spk_characters[ch];
>   if (cp == NULL) {
>   pr_info("speak_char: cp == NULL!\n");
>   return;
> @@ -486,7 +491,7 @@ static u16 get_char(struct vc_data *vc,
>  
>  static void say_char(struct vc_data *vc)
>  {
> - u_short ch;
> + u16 ch;
>  
>   spk_old_attr = spk_attr;
>   ch = get_char(vc, (u_short *)spk_pos, &spk_attr);
> @@ -496,20 +501,20 @@ static void say_char(struct vc_data *vc)
>   if (spk_attrib_bleep & 2)
>   say_attributes(vc);
>   }
> - speak_char(ch & 0xff);
> + speak_char(ch);
>  }
>  
>  static void say_phonetic_char(struct vc_data *vc)
>  {
> - u_short ch;
> + u16 ch;
>  
>   spk_old_attr = spk_attr;
>   ch = get_char(vc, (u_short *)spk_pos, &spk_attr);
> - if (isascii(ch) && isalpha(ch)) {
> + if (ch <= 0x7f && isalpha(ch)) {
>   ch &= 0x1f;
>   synth_printf("%s\n", phonetic[--ch]);
>   } else {
> - if (IS_CHAR(ch, B_NUM))
> + if (ch < 0x100 && IS_CHAR(ch, B_NUM))
>   synth_printf("%s ", spk_msg_get(MSG_NUMBER));
>   speak_char(ch);
>   }
> @@ -551,42 +556,42 @@ static void say_next_char(struct vc_data
>  static u_long get_word(struct vc_data *vc)
>  {
>   u_long cnt = 0, tmpx = spk_x, tmp_pos = spk_pos;
> - char ch;
> - u_short attr_ch;
> + u16 ch;
> + u16 attr_ch;
>   u_char temp;
>  
>   spk_old_attr = spk_attr;
> - ch = (char)get_char(vc, (u_short *)tmp_pos, &temp);
> + ch = get_char(vc, (u_short *)tmp_pos, &temp);
>  
>  /* decided to take out the sayword if on a space (mis-information */
>   if (spk_say_word_ctl && ch == SPACE) {
>   *buf = '\0';
>   synth_printf("%s\n", spk_msg_get(MSG_SPACE));
>   return 0;
> - } else if ((tmpx < vc->vc_cols - 2)
> -&& (ch == SPACE || ch == 0 || IS_WDLM(ch))
> -&& ((char)get_char(vc, (u_short *)&tmp_pos + 1, &temp) >
>

[PATCH] staging/fbtft: Hush checkpatch.pl warning about unnecessary line continuations

2017-03-04 Thread Alexander Kapshuk
Use a single string literal as the fmt argument passed to dev_err()
instead of multiple string literals split with an embedded backslash
character.

Signed-off-by: Alexander Kapshuk 
---
 drivers/staging/fbtft/fb_ssd1331.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fbtft/fb_ssd1331.c 
b/drivers/staging/fbtft/fb_ssd1331.c
index 26f24e3..9aa9864 100644
--- a/drivers/staging/fbtft/fb_ssd1331.c
+++ b/drivers/staging/fbtft/fb_ssd1331.c
@@ -130,16 +130,16 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)
for (i = 0; i < 63; i++) {
if (i > 0 && curves[i] < 2) {
dev_err(par->info->device,
-   "Illegal value in Grayscale Lookup Table at 
index %d. " \
-   "Must be greater than 1\n", i);
+   "Illegal value in Grayscale Lookup Table at 
index %d. Must be greater than 1\n",
+   i);
return -EINVAL;
}
acc += curves[i];
tmp[i] = acc;
if (acc > 180) {
dev_err(par->info->device,
-   "Illegal value(s) in Grayscale Lookup Table. " \
-   "At index=%d, the accumulated value has 
exceeded 180\n", i);
+   "Illegal value(s) in Grayscale Lookup Table. At 
index=%d, the accumulated value has exceeded 180\n",
+   i);
return -EINVAL;
}
}
-- 
2.10.2

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


Re: [PATCH] staging: ks7010: clean up code

2017-03-04 Thread Ernestas Kulik
On Fri, 2017-03-03 at 23:24-0800, Joe Perches wrote:
>
> More stuff the changelog doesn't show :(
>
> On Fri, 2017-03-03 at 22:58 +0200, Ernestas Kulik wrote:
> > This fixes type warnings generated by sparse, replaces instances of
> > ntohs() with be16_to_cpu() and removes unused fields in structs.

I’ve posted a v2 of the patch, reducing the scope so as to not
inadvertently break something.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 2/3] x86/hyperv: move TSC reading method to asm/mshyperv.h

2017-03-04 Thread Thomas Gleixner
On Fri, 3 Mar 2017, Stephen Hemminger wrote:
> static inline u64 hv_read_tsc_page(const struct ms_hyperv_tsc_page *tsc_pg)
> {
>   u64 scale, offset, cur_tsc;
>   u32 start;
> 
>   /*
>* The protocol for reading Hyper-V TSC page is specified in Hypervisor
>* Top-Level Functional Specification ver. 3.0 and above. To get the
>* reference time we must do the following:
>* - READ ReferenceTscSequence
>*   A special '0' value indicates the time source is unreliable and we
>*   need to use something else. The currently published specification
>*   versions (up to 4.0b) contain a mistake and wrongly claim '-1'
>*   instead of '0' as the special value, see commit c35b82ef0294.
>* - ReferenceTime =
>*((RDTSC() * ReferenceTscScale) >> 64) + ReferenceTscOffset
>* - READ ReferenceTscSequence again. In case its value has changed
>*   since our first reading we need to discard ReferenceTime and repeat
>*   the whole sequence as the hypervisor was updating the page in
>*   between.
>*/
>   do {
>   start = READ_ONCE(tsc_pg->tsc_sequence);
>   smp_rmb();
> 
>   if (unlikely(!start))
>   return U64_MAX;
> 
>   scale = tsc_pg->tsc_scale;
>   offset = tsc_pg->tsc_offset;
> 
>   /*
>* Make sure we read sequence after we read all other values
>* from TSC page.
>*/
>   smp_rmb();
>   } while (unlikely(READ_ONCE(tsc_pg->tsc_sequence != start)));
> 
>   cur_tsc = rdtsc_ordered();

That's wrong. You need to read the TSC value together with the scale and
offset. That's needs to be "atomic". You can only do the mult/shift
outside.

>   return mul_u64_u64_shr(cur_tsc, scale, 64) + offset;
> }

Thanks,

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


Re: [RFC PATCH v2 01/32] x86: Add the Secure Encrypted Virtualization CPU feature

2017-03-04 Thread Borislav Petkov
On Fri, Mar 03, 2017 at 03:01:23PM -0600, Brijesh Singh wrote:
> +merely enables SME (sets bit 23 of the MSR_K8_SYSCFG), then Linux can
> activate
> +memory encryption by default (CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT=y)
> or
> +by supplying mem_encrypt=on on the kernel command line.  However, if BIOS
> does
> +not enable SME, then Linux will not be able to activate memory encryption,
> even
> +if configured to do so by default or the mem_encrypt=on command line
> parameter
> +is specified.

This looks like a wraparound...

$ test-apply.sh /tmp/brijesh.singh.delta
checking file Documentation/admin-guide/kernel-parameters.txt
Hunk #1 succeeded at 2144 (offset -9 lines).
checking file Documentation/x86/amd-memory-encryption.txt
patch:  malformed patch at line 23: DRAM from physical

Yap.

Looks like exchange or your mail client decided to do some patch editing
on its own.

Please send it to yourself first and try applying.

-- 
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 
(AG Nürnberg)
-- 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4 13/36] [media] v4l2: add a frame timeout event

2017-03-04 Thread Sakari Ailus
Hi Steve,

On Fri, Mar 03, 2017 at 02:43:51PM -0800, Steve Longerbeam wrote:
> 
> 
> On 03/03/2017 03:45 AM, Sakari Ailus wrote:
> >On Thu, Mar 02, 2017 at 03:07:21PM -0800, Steve Longerbeam wrote:
> >>
> >>
> >>On 03/02/2017 07:53 AM, Sakari Ailus wrote:
> >>>Hi Steve,
> >>>
> >>>On Wed, Feb 15, 2017 at 06:19:15PM -0800, Steve Longerbeam wrote:
> Add a new FRAME_TIMEOUT event to signal that a video capture or
> output device has timed out waiting for reception or transmit
> completion of a video frame.
> 
> Signed-off-by: Steve Longerbeam 
> ---
> Documentation/media/uapi/v4l/vidioc-dqevent.rst | 5 +
> Documentation/media/videodev2.h.rst.exceptions  | 1 +
> include/uapi/linux/videodev2.h  | 1 +
> 3 files changed, 7 insertions(+)
> 
> diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst 
> b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
> index 8d663a7..dd77d9b 100644
> --- a/Documentation/media/uapi/v4l/vidioc-dqevent.rst
> +++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
> @@ -197,6 +197,11 @@ call.
>   the regions changes. This event has a struct
>   :c:type:`v4l2_event_motion_det`
>   associated with it.
> +* - ``V4L2_EVENT_FRAME_TIMEOUT``
> +  - 7
> +  - This event is triggered when the video capture or output device
> + has timed out waiting for the reception or transmit completion of
> + a frame of video.
> >>>
> >>>As you're adding a new interface, I suppose you have an implementation
> >>>around. How do you determine what that timeout should be?
> >>
> >>The imx-media driver sets the timeout to 1 second, or 30 frame
> >>periods at 30 fps.
> >
> >The frame rate is not necessarily constant during streaming. It may well
> >change as a result of lighting conditions.
> 
> I think you mean that would be a _temporary_ change in frame rate, but
> yes I agree the data rate can temporarily fluctuate. Although I doubt
> lighting conditions would cause a sensor to pause data transmission
> for a full 1 second.

Likely not, at least not in typical conditions. The exposure time is still
quite specific to applications: it could be minutes if you take photos e.g.
of the night sky.

What I'm saying here is that any static value is likely not both reasonable
and workable in all potential situations all the time. Still there are cases
(as yours below) that may happen in relatively common cases on some hardware
(more common than taking long exposure photos of the night sky with the said
hardware :)).

> 
> 
> >I wouldn't add an event for this:
> >this is unreliable and 30 times the frame period is an arbitrary value
> >anyway. No other drivers do this either.
> 
> If no other drivers do this I don't mind removing it. It is really meant
> to deal with the ADV718x CVBS decoder, which often simply stops sending
> data on the BT.656 bus if there is an interruption in the input analog
> signal. But I agree that user space could detect this timeout instead.
> Unless I hear from someone else that they would like to keep this
> feature I'll remove it in version 5.

That's a bit of a special situation --- still there are alike conditions on
existing hardware. You should return the buffers to the user with the ERROR
flag set --- or return -EIO from VIDIOC_DQBUF, if the condition will
persist:

https://www.linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/vidioc-qbuf.html>

Do you already obtain the frame rate from the image source (e.g. tuner,
sensor, decoder) and multiply the frame time by some number in the current
implementation? Not all sub-device drivers may implement g_frame_interval()
so I'd disable the timeout in that case.

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: media: platform: bcm2835 - Style fix

2017-03-04 Thread Dan Carpenter
Copy a patch prefix that everyone else has been using:

git log --oneline drivers/staging/media/platform/bcm2835/

The subject is too vague as well.

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


Re: [RESEND PATCH V4] staging: vchiq_arm: Add compatibility wrappers for ioctls

2017-03-04 Thread Dan Carpenter
On Wed, Mar 01, 2017 at 07:41:46PM -0800, Michael Zoran wrote:
> Changes:
>   V1 - Complete rewrite of the ioctl code.
>   V2 - Rewrite of only ioctls that change
>  between 32 bit and 64 bit.
> V3 - Minor changes.
>   V4(This Version) - Abandon cleaning up the
>exising code and completely write the
>wrappers on top of the native ioctls.
>No existing lines are changed.

I think I objected to earlier versions but this approach looks nice.

regards,
dan carpenter

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


Re: [PATCH v4 14/36] [media] v4l2-mc: add a function to inherit controls from a pipeline

2017-03-04 Thread Sakari Ailus
Hi Russell,

On Fri, Mar 03, 2017 at 11:06:45PM +, Russell King - ARM Linux wrote:
> On Thu, Mar 02, 2017 at 06:02:57PM +0200, Sakari Ailus wrote:
> > Hi Steve,
> > 
> > On Wed, Feb 15, 2017 at 06:19:16PM -0800, Steve Longerbeam wrote:
> > > v4l2_pipeline_inherit_controls() will add the v4l2 controls from
> > > all subdev entities in a pipeline to a given video device.
> > > 
> > > Signed-off-by: Steve Longerbeam 
> > > ---
> > >  drivers/media/v4l2-core/v4l2-mc.c | 48 
> > > +++
> > >  include/media/v4l2-mc.h   | 25 
> > >  2 files changed, 73 insertions(+)
> > > 
> > > diff --git a/drivers/media/v4l2-core/v4l2-mc.c 
> > > b/drivers/media/v4l2-core/v4l2-mc.c
> > > index 303980b..09d4d97 100644
> > > --- a/drivers/media/v4l2-core/v4l2-mc.c
> > > +++ b/drivers/media/v4l2-core/v4l2-mc.c
> > > @@ -22,6 +22,7 @@
> > >  #include 
> > >  #include 
> > >  #include 
> > > +#include 
> > >  #include 
> > >  #include 
> > >  #include 
> > > @@ -238,6 +239,53 @@ int v4l_vb2q_enable_media_source(struct vb2_queue *q)
> > >  }
> > >  EXPORT_SYMBOL_GPL(v4l_vb2q_enable_media_source);
> > >  
> > > +int __v4l2_pipeline_inherit_controls(struct video_device *vfd,
> > > +  struct media_entity *start_entity)
> > 
> > I have a few concerns / questions:
> > 
> > - What's the purpose of this patch? Why not to access the sub-device node
> >   directly?
> 
> What tools are in existance _today_ to provide access to these controls
> via the sub-device nodes?

yavta, for instance:

http://git.ideasonboard.org/yavta.git>

VIDIOC_QUERYCAP isn't supported on sub-devices and v4l2-ctl appears to be
checking for that. That check should be removed (with possible other
implications taken into account).

> 
> v4l-tools doesn't last time I looked - in fact, the only tool in v4l-tools
> which is capable of accessing the subdevices is media-ctl, and that only
> provides functionality for configuring the pipeline.
> 
> So, pointing people at vapourware userspace is really quite rediculous.

Do bear in mind that there are other programs that can make use of these
interfaces. It's not just the test programs, or a test program you attempted
to use.

> 
> The established way to control video capture is through the main video
> capture device, not through the sub-devices.  Yes, the controls are
> exposed through sub-devices too, but that does not mean that is the
> correct way to access them.

It is. That's the very purpose of the sub-devices: to provide access to the
hardware independently of how the links are configured.

> 
> The v4l2 documentation (Documentation/media/kapi/v4l2-controls.rst)
> even disagrees with your statements.  That talks about control
> inheritence from sub-devices to the main video device, and the core
> v4l2 code provides _automatic_ support for this - see
> v4l2_device_register_subdev():
> 
> /* This just returns 0 if either of the two args is NULL */
> err = v4l2_ctrl_add_handler(v4l2_dev->ctrl_handler, sd->ctrl_handler, 
> NULL);
> 
> which merges the subdev's controls into the main device's control
> handler.

That's done on different kind of devices: those that provide plain V4L2 API
to control the entire device. V4L2 sub-device interface is used *in kernel*
as an interface to control sub-devices that do not need to be exposed to the
user space.

Devices that have complex pipeline that do essentially require using the
Media controller interface to configure them are out of that scope.

-- 
Regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch 2/3] speakup: convert screen reading to 16bit characters

2017-03-04 Thread Samuel Thibault
This adds 16bit character support to most of the screen reading by
extending characters to u16 throughout the code.

Non-latin1 characters are assumed to be alphabetic type for now.

non-latin1 vt_notifier_call-provided characters are not ignored any
more, and the 16bit character returned by get_char is not truncated any
more. For simplicity, speak_char still only supports latin1 characters.
Its direct mode however does support 16bit characters, so in practice
this will not be a limitation, non-latin1 languages will be handled by
the synthesizer. spelling words does not support direct mode yet, for
simplicity for now it will ignore 16bit characters.

For simplicity again, speakup messages are left in latin1 for now.

Some coding style is fixed along the way.

Signed-off-by: Samuel Thibault 
Reviewed-by: Okash Khawaja 

Index: linux-4.10/drivers/staging/speakup/main.c
===
--- linux-4.10.orig/drivers/staging/speakup/main.c
+++ linux-4.10/drivers/staging/speakup/main.c
@@ -67,7 +67,7 @@ MODULE_PARM_DESC(quiet, "Do not announce
 special_func spk_special_handler;
 
 short spk_pitch_shift, synth_flags;
-static char buf[256];
+static u16 buf[256];
 int spk_attrib_bleep, spk_bleeps, spk_bleep_time = 10;
 int spk_no_intr, spk_spell_delay;
 int spk_key_echo, spk_say_word_ctl;
@@ -112,7 +112,7 @@ enum {
 
 static struct tty_struct *tty;
 
-static void spkup_write(const char *in_buf, int count);
+static void spkup_write(const u16 *in_buf, int count);
 
 static char *phonetic[] = {
"alfa", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel",
@@ -238,7 +238,8 @@ static u_short default_chartab[256] = {
 struct task_struct *speakup_task;
 struct bleep spk_unprocessed_sound;
 static int spk_keydown;
-static u_char spk_lastkey, spk_close_press, keymap_flags;
+static u16 spk_lastkey;
+static u_char spk_close_press, keymap_flags;
 static u_char last_keycode, this_speakup_key;
 static u_long last_spk_jiffy;
 
@@ -426,9 +427,9 @@ static void announce_edge(struct vc_data
spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1));
 }
 
-static void speak_char(u_char ch)
+static void speak_char(u16 ch)
 {
-   char *cp = spk_characters[ch];
+   char *cp;
struct var_t *direct = spk_get_var(DIRECT);
 
if (direct && direct->u.n.value) {
@@ -436,11 +437,15 @@ static void speak_char(u_char ch)
spk_pitch_shift++;
synth_printf("%s", spk_str_caps_start);
}
-   synth_printf("%c", ch);
+   synth_putwc_s(ch);
if (IS_CHAR(ch, B_CAP))
synth_printf("%s", spk_str_caps_stop);
return;
}
+
+   if (ch >= 0x100)
+   return;
+   cp = spk_characters[ch];
if (cp == NULL) {
pr_info("speak_char: cp == NULL!\n");
return;
@@ -486,7 +491,7 @@ static u16 get_char(struct vc_data *vc,
 
 static void say_char(struct vc_data *vc)
 {
-   u_short ch;
+   u16 ch;
 
spk_old_attr = spk_attr;
ch = get_char(vc, (u_short *)spk_pos, &spk_attr);
@@ -496,20 +501,20 @@ static void say_char(struct vc_data *vc)
if (spk_attrib_bleep & 2)
say_attributes(vc);
}
-   speak_char(ch & 0xff);
+   speak_char(ch);
 }
 
 static void say_phonetic_char(struct vc_data *vc)
 {
-   u_short ch;
+   u16 ch;
 
spk_old_attr = spk_attr;
ch = get_char(vc, (u_short *)spk_pos, &spk_attr);
-   if (isascii(ch) && isalpha(ch)) {
+   if (ch <= 0x7f && isalpha(ch)) {
ch &= 0x1f;
synth_printf("%s\n", phonetic[--ch]);
} else {
-   if (IS_CHAR(ch, B_NUM))
+   if (ch < 0x100 && IS_CHAR(ch, B_NUM))
synth_printf("%s ", spk_msg_get(MSG_NUMBER));
speak_char(ch);
}
@@ -551,42 +556,42 @@ static void say_next_char(struct vc_data
 static u_long get_word(struct vc_data *vc)
 {
u_long cnt = 0, tmpx = spk_x, tmp_pos = spk_pos;
-   char ch;
-   u_short attr_ch;
+   u16 ch;
+   u16 attr_ch;
u_char temp;
 
spk_old_attr = spk_attr;
-   ch = (char)get_char(vc, (u_short *)tmp_pos, &temp);
+   ch = get_char(vc, (u_short *)tmp_pos, &temp);
 
 /* decided to take out the sayword if on a space (mis-information */
if (spk_say_word_ctl && ch == SPACE) {
*buf = '\0';
synth_printf("%s\n", spk_msg_get(MSG_SPACE));
return 0;
-   } else if ((tmpx < vc->vc_cols - 2)
-  && (ch == SPACE || ch == 0 || IS_WDLM(ch))
-  && ((char)get_char(vc, (u_short *)&tmp_pos + 1, &temp) >
-  SPACE)) {
+   } else if (tmpx < vc->vc_cols - 2 &&
+  (ch == SPACE || ch == 0 || (ch < 0x100 && IS_WDLM(ch))) &&
+  get_char(vc, (u

[patch 3/3] speakup: add unicode variant of /dev/softsynth

2017-03-04 Thread Samuel Thibault
This adds /dev/softsynthu, along /dev/softsynth, which emits output in
UTF-8 encoding, thus allowing to support 16bit characters.  Most of the
code is shared, only the read function has to behave differently in
latin1 and in unicode mode.  Since Linux only supports 16bit characters,
we can just hardcode the UTF-8 encoding.

Signed-off-by: Samuel Thibault 
Reviewed-by: Chris Brannon 

Index: linux-4.10/drivers/staging/speakup/speakup_soft.c
===
--- linux-4.10.orig/drivers/staging/speakup/speakup_soft.c
+++ linux-4.10/drivers/staging/speakup/speakup_soft.c
@@ -29,6 +29,7 @@
 
 #define DRV_VERSION "2.6"
 #define SOFTSYNTH_MINOR 26 /* might as well give it one more than /dev/synth */
+#define SOFTSYNTHU_MINOR 27 /* might as well give it one more than /dev/synth 
*/
 #define PROCSPEECH 0x0d
 #define CLEAR_SYNTH 0x18
 
@@ -37,7 +38,7 @@ static void softsynth_release(void);
 static int softsynth_is_alive(struct spk_synth *synth);
 static unsigned char get_index(void);
 
-static struct miscdevice synth_device;
+static struct miscdevice synth_device, synthu_device;
 static int init_pos;
 static int misc_registered;
 
@@ -199,13 +200,13 @@ static int softsynth_close(struct inode
return 0;
 }
 
-static ssize_t softsynth_read(struct file *fp, char __user *buf, size_t count,
- loff_t *pos)
+static ssize_t softsynthx_read(struct file *fp, char __user *buf, size_t count,
+  loff_t *pos, int unicode)
 {
int chars_sent = 0;
char __user *cp;
char *init;
-   char ch;
+   u16 ch;
int empty;
unsigned long flags;
DEFINE_WAIT(wait);
@@ -213,7 +214,8 @@ static ssize_t softsynth_read(struct fil
spin_lock_irqsave(&speakup_info.spinlock, flags);
while (1) {
prepare_to_wait(&speakup_event, &wait, TASK_INTERRUPTIBLE);
-   synth_buffer_skip_nonlatin1();
+   if (!unicode)
+   synth_buffer_skip_nonlatin1();
if (!synth_buffer_empty() || speakup_info.flushing)
break;
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
@@ -232,23 +234,57 @@ static ssize_t softsynth_read(struct fil
 
cp = buf;
init = get_initstring();
-   while (chars_sent < count) {
+
+   /* Keep 3 bytes available for a 16bit UTF-8-encoded character */
+   while (chars_sent <= count - 3) {
if (speakup_info.flushing) {
speakup_info.flushing = 0;
ch = '\x18';
-   } else if (synth_buffer_empty()) {
-   break;
} else if (init[init_pos]) {
ch = init[init_pos++];
} else {
+   if (!unicode)
+   synth_buffer_skip_nonlatin1();
+   if (synth_buffer_empty())
+   break;
ch = synth_buffer_getc();
}
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
-   if (copy_to_user(cp, &ch, 1))
-   return -EFAULT;
+
+   if ((!unicode && ch < 0x100) || (unicode && ch < 0x80)) {
+   u_char c = ch;
+
+   if (copy_to_user(cp, &c, 1))
+   return -EFAULT;
+
+   chars_sent++;
+   cp++;
+   } else if (unicode && ch < 0x800) {
+   u_char s[2] = {
+   0xc0 | (ch >> 6),
+   0x80 | (ch & 0x3f)
+   };
+
+   if (copy_to_user(cp, s, sizeof(s)))
+   return -EFAULT;
+
+   chars_sent += sizeof(s);
+   cp += sizeof(s);
+   } else if (unicode) {
+   u_char s[3] = {
+   0xe0 | (ch >> 12),
+   0x80 | ((ch >> 6) & 0x3f),
+   0x80 | (ch & 0x3f)
+   };
+
+   if (copy_to_user(cp, s, sizeof(s)))
+   return -EFAULT;
+
+   chars_sent += sizeof(s);
+   cp += sizeof(s);
+   }
+
spin_lock_irqsave(&speakup_info.spinlock, flags);
-   chars_sent++;
-   cp++;
}
*pos += chars_sent;
empty = synth_buffer_empty();
@@ -260,6 +296,18 @@ static ssize_t softsynth_read(struct fil
return chars_sent;
 }
 
+static ssize_t softsynth_read(struct file *fp, char __user *buf, size_t count,
+ loff_t *pos)
+{
+   return softsynthx_read(fp, buf, count, pos, 0);
+}
+
+static ssize_t softsynthu_read(struct file *fp, char __user *buf, size_

[patch 0/3] speakup: support 16bit unicode screen reading

2017-03-04 Thread Samuel Thibault
Hello,

This patch series adds 16bit unicode support to speakup, through three
patches:

- extend synth buffer to 16bit unicode characters
- convert screen reading to 16bit characters
- add unicode variant of /dev/softsynth

Samuel

-- 
Samuel
"...Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and
the Ugly)."
(By Matt Welsh)
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch 1/3] speakup: extend synth buffer to 16bit unicode characters

2017-03-04 Thread Samuel Thibault
This extends the synth buffer slots to 16bit, so as to hold 16bit
unicode characters.

synth_buffer_getc and synth_buffer_peek now return 16bit characters.
Speech synthesizers which do not support characters beyond latin1 can
use the synth_buffer_skip_nonlatin1() helper to skip the non-latin1
characters before getting or peeking. All synthesizers are made to use
it for now.

This makes synth_buffer_add take a 16bit character. For simplicity for
now, synth_printf is left to using latin1 formats and strings.
synth_putwc, synth_putwc_s, synth_putws and synth_putws_s helpers are
however added to put 16bit characters and strings.

Signed-off-by: Samuel Thibault 
Reviewed-by: Chris Brannon 

Index: linux-4.10/drivers/staging/speakup/spk_priv.h
===
--- linux-4.10.orig/drivers/staging/speakup/spk_priv.h
+++ linux-4.10/drivers/staging/speakup/spk_priv.h
@@ -48,8 +48,9 @@ unsigned char spk_serial_in_nowait(void)
 int spk_serial_out(const char ch);
 void spk_serial_release(void);
 
-char synth_buffer_getc(void);
-char synth_buffer_peek(void);
+void synth_buffer_skip_nonlatin1(void);
+u16 synth_buffer_getc(void);
+u16 synth_buffer_peek(void);
 int synth_buffer_empty(void);
 struct var_t *spk_get_var(enum var_id_t var_id);
 ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr,
@@ -64,6 +65,10 @@ void spk_synth_flush(struct spk_synth *s
 int spk_synth_is_alive_nop(struct spk_synth *synth);
 int spk_synth_is_alive_restart(struct spk_synth *synth);
 void synth_printf(const char *buf, ...);
+void synth_putwc(u16 wc);
+void synth_putwc_s(u16 wc);
+void synth_putws(const u16 *buf);
+void synth_putws_s(const u16 *buf);
 int synth_request_region(u_long, u_long);
 int synth_release_region(u_long, u_long);
 int synth_add(struct spk_synth *in_synth);
Index: linux-4.10/drivers/staging/speakup/speakup.h
===
--- linux-4.10.orig/drivers/staging/speakup/speakup.h
+++ linux-4.10/drivers/staging/speakup/speakup.h
@@ -70,7 +70,7 @@ void synth_release(void);
 
 void spk_do_flush(void);
 void speakup_start_ttys(void);
-void synth_buffer_add(char ch);
+void synth_buffer_add(u16 ch);
 void synth_buffer_clear(void);
 void speakup_clear_selection(void);
 int speakup_set_selection(struct tty_struct *tty);
Index: linux-4.10/drivers/staging/speakup/synth.c
===
--- linux-4.10.orig/drivers/staging/speakup/synth.c
+++ linux-4.10/drivers/staging/speakup/synth.c
@@ -109,6 +109,7 @@ void spk_do_catch_up(struct spk_synth *s
synth->flush(synth);
continue;
}
+   synth_buffer_skip_nonlatin1();
if (synth_buffer_empty()) {
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
break;
@@ -255,6 +256,35 @@ void synth_printf(const char *fmt, ...)
 }
 EXPORT_SYMBOL_GPL(synth_printf);
 
+void synth_putwc(u16 wc)
+{
+   synth_buffer_add(wc);
+}
+EXPORT_SYMBOL_GPL(synth_putwc);
+
+void synth_putwc_s(u16 wc)
+{
+   synth_buffer_add(wc);
+   synth_start();
+}
+EXPORT_SYMBOL_GPL(synth_putwc_s);
+
+void synth_putws(const u16 *buf)
+{
+   const u16 *p;
+
+   for (p = buf; *p; p++)
+   synth_buffer_add(*p);
+}
+EXPORT_SYMBOL_GPL(synth_putws);
+
+void synth_putws_s(const u16 *buf)
+{
+   synth_putws(buf);
+   synth_start();
+}
+EXPORT_SYMBOL_GPL(synth_putws_s);
+
 static int index_count;
 static int sentence_count;
 
Index: linux-4.10/drivers/staging/speakup/buffers.c
===
--- linux-4.10.orig/drivers/staging/speakup/buffers.c
+++ linux-4.10/drivers/staging/speakup/buffers.c
@@ -7,10 +7,10 @@
 
 #define SYNTH_BUF_SIZE 8192/* currently 8K bytes */
 
-static u_char synth_buffer[SYNTH_BUF_SIZE];/* guess what this is for! */
-static u_char *buff_in = synth_buffer;
-static u_char *buff_out = synth_buffer;
-static u_char *buffer_end = synth_buffer + SYNTH_BUF_SIZE - 1;
+static u16 synth_buffer[SYNTH_BUF_SIZE];   /* guess what this is for! */
+static u16 *buff_in = synth_buffer;
+static u16 *buff_out = synth_buffer;
+static u16 *buffer_end = synth_buffer + SYNTH_BUF_SIZE - 1;
 
 /* These try to throttle applications by stopping the TTYs
  * Note: we need to make sure that we will restart them eventually, which is
@@ -44,13 +44,13 @@ static void speakup_stop_ttys(void)
 
 static int synth_buffer_free(void)
 {
-   int bytes_free;
+   int chars_free;
 
if (buff_in >= buff_out)
-   bytes_free = SYNTH_BUF_SIZE - (buff_in - buff_out);
+   chars_free = SYNTH_BUF_SIZE - (buff_in - buff_out);
else
-   bytes_free = buff_out - buff_in;
-   return bytes_free;
+   chars_free = buff_out - buff_in;
+   return chars_free;
 }
 
 int synth_buffer_empty(void)
@@ -

Re: [PATCH v2] staging: ks7010: fix sparse warnings

2017-03-04 Thread Dan Carpenter
On Sat, Mar 04, 2017 at 10:56:23AM +0200, Ernestas Kulik wrote:
> Currently, sparse generates many warnings for the driver. This commit
> changes the types of struct fields/function variables to match the
> endianness at their assignment.
> 
> Signed-off-by: Ernestas Kulik 
> ---
> Changes from v1:
> * Change the type of the variable being passed to ntohs() instead of casting 
> it
> * Don’t remove any struct fields

[ snip ]

> diff --git a/drivers/staging/ks7010/ks7010_sdio.c 
> b/drivers/staging/ks7010/ks7010_sdio.c
> index 6f9f746a3a61..8e644ff8eca8 100644
> --- a/drivers/staging/ks7010/ks7010_sdio.c
> +++ b/drivers/staging/ks7010/ks7010_sdio.c
> @@ -297,7 +297,8 @@ static int write_to_device(struct ks_wlan_private *priv, 
> unsigned char *buffer,
>   hdr = (struct hostif_hdr *)buffer;
>  
>   DPRINTK(4, "size=%d\n", hdr->size);
> - if (hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event) {
> + if (le16_to_cpu(hdr->event) < HIF_DATA_REQ ||
> + HIF_REQ_MAX < le16_to_cpu(hdr->event)) {

Don't mix cleanups and bugfixes.  They have to be done in separate
patches.  Also this change wasn't described in the changelog like Joe
explained.

regards,
dan carpenter

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


Re: [RESEND PATCH V4] staging: vchiq_arm: Add compatibility wrappers for ioctls

2017-03-04 Thread Michael Zoran
On Sat, 2017-03-04 at 14:58 +0300, Dan Carpenter wrote:
> On Wed, Mar 01, 2017 at 07:41:46PM -0800, Michael Zoran wrote:
> > Changes:
> > V1 - Complete rewrite of the ioctl code.
> > V2 - Rewrite of only ioctls that change
> >  between 32 bit and 64 bit.
> > V3 - Minor changes.
> > V4(This Version) - Abandon cleaning up the
> >  exising code and completely write the
> >  wrappers on top of the native ioctls.
> >  No existing lines are changed.
> 
> I think I objected to earlier versions but this approach looks nice.
> 
> regards,
> dan carpenter
> 

Cool, does this mean I get an ACK?

It really would be good to get this in since it's one of the last major
  missing pieces to get Raspbian to work with a 64 bit kernel.


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


[PATCH v5 2/5] staging: lustre: Remove unnecessary cast on void pointer

2017-03-04 Thread simran singhal
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal 
---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index 271e189..09b46924 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -640,7 +640,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, 
void *karg,
int remote_gf_size = 0;
int rc;
 
-   gf = (struct getinfo_fid2path *)karg;
+   gf = karg;
tgt = lmv_find_target(lmv, &gf->gf_fid);
if (IS_ERR(tgt))
return PTR_ERR(tgt);
@@ -657,7 +657,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, 
void *karg,
struct getinfo_fid2path *ori_gf;
char *ptr;
 
-   ori_gf = (struct getinfo_fid2path *)karg;
+   ori_gf = karg;
if (strlen(ori_gf->gf_path) +
strlen(gf->gf_path) > ori_gf->gf_pathlen) {
rc = -EOVERFLOW;
-- 
2.7.4

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


[PATCH v5 0/5] Remove unnecessary cast on void pointer

2017-03-04 Thread simran singhal
This patch-series removes unnecessary cast on void pointer in various
drivers.

v5:
  -Fixed compliation warning in lustre/lustre/llite/range_lock.c
   which remain unfixed in v3.
v4:
  -change the cover-letter subject
v3:
  -Fixed compilation warning in lustre/lustre/llite/range_lock.c

simran singhal (5):
  staging: nvec: Remove unnecessary cast on void pointer
  staging: lustre: Remove unnecessary cast on void pointer
  staging: lustre: lustre: Remove unnecessary cast on void pointer
  staging: rts5208: Remove unnecessary cast on void pointer
  staging: rtl8712: Remove unnecessary cast on void pointer

 drivers/staging/lustre/lustre/llite/range_lock.c |  2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c  |  4 ++--
 drivers/staging/nvec/nvec_kbd.c  |  2 +-
 drivers/staging/rtl8712/rtl8712_recv.c   | 11 +--
 drivers/staging/rts5208/rtsx_transport.c |  3 +--
 5 files changed, 10 insertions(+), 12 deletions(-)

-- 
2.7.4

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


[PATCH v5 5/5] staging: rtl8712: Remove unnecessary cast on void pointer

2017-03-04 Thread simran singhal
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8712/rtl8712_recv.c | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c 
b/drivers/staging/rtl8712/rtl8712_recv.c
index 20fe45a..266ffef 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -444,9 +444,9 @@ void r8712_rxcmd_event_hdl(struct _adapter *padapter, void 
*prxcmdbuf)
u16 cmd_len, drvinfo_sz;
struct recv_stat *prxstat;
 
-   poffset = (u8 *)prxcmdbuf;
+   poffset = prxcmdbuf;
voffset = *(__le32 *)poffset;
-   prxstat = (struct recv_stat *)prxcmdbuf;
+   prxstat = prxcmdbuf;
drvinfo_sz = (le32_to_cpu(prxstat->rxdw0) & 0x000f) >> 16;
drvinfo_sz <<= 3;
poffset += RXDESC_SIZE + drvinfo_sz;
@@ -634,8 +634,7 @@ static int recv_indicatepkt_reorder(struct _adapter 
*padapter,
 void r8712_reordering_ctrl_timeout_handler(void *pcontext)
 {
unsigned long irql;
-   struct recv_reorder_ctrl *preorder_ctrl =
-(struct recv_reorder_ctrl *)pcontext;
+   struct recv_reorder_ctrl *preorder_ctrl = pcontext;
struct _adapter *padapter = preorder_ctrl->padapter;
struct  __queue *ppending_recvframe_queue =
 &preorder_ctrl->pending_recvframe_queue;
@@ -976,7 +975,7 @@ int recv_func(struct _adapter *padapter, void *pcontext)
struct  __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
struct  mlme_priv   *pmlmepriv = &padapter->mlmepriv;
 
-   prframe = (union recv_frame *)pcontext;
+   prframe = pcontext;
orig_prframe = prframe;
pattrib = &prframe->u.hdr.attrib;
if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
@@ -1124,7 +1123,7 @@ static int recvbuf2recvframe(struct _adapter *padapter, 
struct sk_buff *pskb)
 static void recv_tasklet(void *priv)
 {
struct sk_buff *pskb;
-   struct _adapter *padapter = (struct _adapter *)priv;
+   struct _adapter *padapter = priv;
struct recv_priv *precvpriv = &padapter->recvpriv;
 
while (NULL != (pskb = skb_dequeue(&precvpriv->rx_skb_queue))) {
-- 
2.7.4

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


[PATCH v5 3/5] staging: lustre: lustre: Remove unnecessary cast on void pointer

2017-03-04 Thread simran singhal
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal 
---

 v5:
   -Fixed compilation warnings.

 drivers/staging/lustre/lustre/llite/range_lock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/range_lock.c 
b/drivers/staging/lustre/lustre/llite/range_lock.c
index 14148a0..161391b 100644
--- a/drivers/staging/lustre/lustre/llite/range_lock.c
+++ b/drivers/staging/lustre/lustre/llite/range_lock.c
@@ -174,7 +174,7 @@ void range_unlock(struct range_lock_tree *tree, struct 
range_lock *lock)
  */
 static enum interval_iter range_lock_cb(struct interval_node *node, void *arg)
 {
-   struct range_lock *lock = (struct range_lock *)arg;
+   struct range_lock *lock = arg;
struct range_lock *overlap = node2rangelock(node);
 
lock->rl_blocking_ranges += overlap->rl_lock_count + 1;
-- 
2.7.4

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


[PATCH v5 4/5] staging: rts5208: Remove unnecessary cast on void pointer

2017-03-04 Thread simran singhal
The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal 
---
 drivers/staging/rts5208/rtsx_transport.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx_transport.c 
b/drivers/staging/rts5208/rtsx_transport.c
index 2379901..8b57e17 100644
--- a/drivers/staging/rts5208/rtsx_transport.c
+++ b/drivers/staging/rts5208/rtsx_transport.c
@@ -766,8 +766,7 @@ int rtsx_transfer_data(struct rtsx_chip *chip, u8 card, 
void *buf, size_t len,
return -EIO;
 
if (use_sg) {
-   err = rtsx_transfer_sglist_adma(chip, card,
-   (struct scatterlist *)buf,
+   err = rtsx_transfer_sglist_adma(chip, card, buf,
use_sg, dma_dir, timeout);
} else {
err = rtsx_transfer_buf(chip, card, buf, len, dma_dir, timeout);
-- 
2.7.4

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


[PATCH v5 1/5] staging: nvec: Remove unnecessary cast on void pointer

2017-03-04 Thread simran singhal
The following Coccinelle script was used to detect this:

@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|
- (T*)
  e
)

Signed-off-by: simran singhal 
---
 drivers/staging/nvec/nvec_kbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c
index e881e6b..a01f486 100644
--- a/drivers/staging/nvec/nvec_kbd.c
+++ b/drivers/staging/nvec/nvec_kbd.c
@@ -58,7 +58,7 @@ static int nvec_keys_notifier(struct notifier_block *nb,
  unsigned long event_type, void *data)
 {
int code, state;
-   unsigned char *msg = (unsigned char *)data;
+   unsigned char *msg = data;
 
if (event_type == NVEC_KB_EVT) {
int _size = (msg[0] & (3 << 5)) >> 5;
-- 
2.7.4

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


Re: [Outreachy kernel] [PATCH v5 0/5] Remove unnecessary cast on void pointer

2017-03-04 Thread Julia Lawall


On Sat, 4 Mar 2017, simran singhal wrote:

> This patch-series removes unnecessary cast on void pointer in various
> drivers.
>
> v5:
>   -Fixed compliation warning in lustre/lustre/llite/range_lock.c
>which remain unfixed in v3.

Acked-by: Julia Lawall 
for the whole series.


> v4:
>   -change the cover-letter subject
> v3:
>   -Fixed compilation warning in lustre/lustre/llite/range_lock.c
>
> simran singhal (5):
>   staging: nvec: Remove unnecessary cast on void pointer
>   staging: lustre: Remove unnecessary cast on void pointer
>   staging: lustre: lustre: Remove unnecessary cast on void pointer
>   staging: rts5208: Remove unnecessary cast on void pointer
>   staging: rtl8712: Remove unnecessary cast on void pointer
>
>  drivers/staging/lustre/lustre/llite/range_lock.c |  2 +-
>  drivers/staging/lustre/lustre/lmv/lmv_obd.c  |  4 ++--
>  drivers/staging/nvec/nvec_kbd.c  |  2 +-
>  drivers/staging/rtl8712/rtl8712_recv.c   | 11 +--
>  drivers/staging/rts5208/rtsx_transport.c |  3 +--
>  5 files changed, 10 insertions(+), 12 deletions(-)
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1488641453-22575-1-git-send-email-singhalsimran0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v5 0/5] Remove unnecessary cast on void pointer

2017-03-04 Thread Joe Perches
On Sat, 2017-03-04 at 21:00 +0530, simran singhal wrote:
> This patch-series removes unnecessary cast on void pointer in various
> drivers.

Much better, thanks.

Trivia: (and it's probably not necessary to resend)

The cover letter should describe the subsystem being
changed or ideally something like "treewide" if the
series touches files throughout the kernel sources.

So this cover letter ideally would have a subject like:

Subject: [PATCH v5 0/5] staging: Remove unnecessary casts of void pointer

> v5:
>   -Fixed compliation warning in lustre/lustre/llite/range_lock.c
>which remain unfixed in v3.
> v4:
>   -change the cover-letter subject
> v3:
>   -Fixed compilation warning in lustre/lustre/llite/range_lock.c  
> 
> simran singhal (5):
>   staging: nvec: Remove unnecessary cast on void pointer
>   staging: lustre: Remove unnecessary cast on void pointer
>   staging: lustre: lustre: Remove unnecessary cast on void pointer
>   staging: rts5208: Remove unnecessary cast on void pointer
>   staging: rtl8712: Remove unnecessary cast on void pointer

Some of these are acting on multiple instances.

Please try to use plural and singular descriptions
where appropriate.

>  drivers/staging/lustre/lustre/llite/range_lock.c |  2 +-
>  drivers/staging/lustre/lustre/lmv/lmv_obd.c  |  4 ++--
>  drivers/staging/nvec/nvec_kbd.c  |  2 +-
>  drivers/staging/rtl8712/rtl8712_recv.c   | 11 +--
>  drivers/staging/rts5208/rtsx_transport.c |  3 +--
>  5 files changed, 10 insertions(+), 12 deletions(-)

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


[PATCH 0/6] multiple checkpatch issues

2017-03-04 Thread Arushi Singhal
Improve readability by fixing multiple checkpatch.pl
issues. 

Arushi Singhal (6):
  staging: speakup: fixes braces {} should be used on all arms of this statement
  staging: speakup: Avoid multiple assignments on same line
  staging: speakup: identation should use tabs
  staging: wilc1000: Alignment should match open parenthesis
  staging: wilc1000: function prototype argument should have identifier name
  staging: wilc1000: Logical continuations should be on the previous line

 drivers/staging/speakup/main.c|  6 +++--
 drivers/staging/speakup/speakup_decext.c  |  6 ++---
 drivers/staging/speakup/speakup_decpc.c   | 10 
 drivers/staging/speakup/speakup_dectlk.c  |  6 ++---
 drivers/staging/speakup/varhandlers.c | 12 ++
 drivers/staging/wilc1000/host_interface.c |  2 +-
 drivers/staging/wilc1000/wilc_spi.c   |  6 ++---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 28 +++
 drivers/staging/wilc1000/wilc_wlan.c  | 10 
 drivers/staging/wilc1000/wilc_wlan.h  |  6 ++---
 10 files changed, 48 insertions(+), 44 deletions(-)

-- 
2.11.0

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


[PATCH 1/6] staging: speakup: fixes braces {} should be used on all arms of this statement

2017-03-04 Thread Arushi Singhal
This patch fixes the checks reported by checkpatch.pl
for braces {} should be used on all arms of this statement.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/main.c   |  3 ++-
 drivers/staging/speakup/speakup_decext.c |  6 +++---
 drivers/staging/speakup/speakup_decpc.c  |  6 +++---
 drivers/staging/speakup/speakup_dectlk.c |  6 +++---
 drivers/staging/speakup/varhandlers.c| 12 +++-
 5 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index a3daf4ae5c0a..47cea629ba0b 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -408,8 +408,9 @@ static void say_attributes(struct vc_data *vc)
if (bg > 7) {
synth_printf(" %s ", spk_msg_get(MSG_ON_BLINKING));
bg -= 8;
-   } else
+   } else {
synth_printf(" %s ", spk_msg_get(MSG_ON));
+   }
synth_printf("%s\n", spk_msg_get(MSG_COLORS_START + bg));
 }
 
diff --git a/drivers/staging/speakup/speakup_decext.c 
b/drivers/staging/speakup/speakup_decext.c
index 5f9f3a7543db..6ebd56e07e71 100644
--- a/drivers/staging/speakup/speakup_decext.c
+++ b/drivers/staging/speakup/speakup_decext.c
@@ -193,11 +193,11 @@ static void do_catch_up(struct spk_synth *synth)
spin_lock_irqsave(&speakup_info.spinlock, flags);
synth_buffer_getc();
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
-   if (ch == '[')
+   if (ch == '[') {
in_escape = 1;
-   else if (ch == ']')
+   } else if (ch == ']') {
in_escape = 0;
-   else if (ch <= SPACE) {
+   } else if (ch <= SPACE) {
if (!in_escape && strchr(",.!?;:", last))
spk_serial_out(PROCSPEECH);
if (time_after_eq(jiffies, jiff_max)) {
diff --git a/drivers/staging/speakup/speakup_decpc.c 
b/drivers/staging/speakup/speakup_decpc.c
index 600eb057f830..dc860c4b8279 100644
--- a/drivers/staging/speakup/speakup_decpc.c
+++ b/drivers/staging/speakup/speakup_decpc.c
@@ -410,11 +410,11 @@ static void do_catch_up(struct spk_synth *synth)
spin_lock_irqsave(&speakup_info.spinlock, flags);
synth_buffer_getc();
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
-   if (ch == '[')
+   if (ch == '[') {
in_escape = 1;
-   else if (ch == ']')
+   } else if (ch == ']') {
in_escape = 0;
-   else if (ch <= SPACE) {
+   } else if (ch <= SPACE) {
if (!in_escape && strchr(",.!?;:", last))
dt_sendchar(PROCSPEECH);
if (time_after_eq(jiffies, jiff_max)) {
diff --git a/drivers/staging/speakup/speakup_dectlk.c 
b/drivers/staging/speakup/speakup_dectlk.c
index 26036050cdb2..2429232ee649 100644
--- a/drivers/staging/speakup/speakup_dectlk.c
+++ b/drivers/staging/speakup/speakup_dectlk.c
@@ -258,11 +258,11 @@ static void do_catch_up(struct spk_synth *synth)
spin_lock_irqsave(&speakup_info.spinlock, flags);
synth_buffer_getc();
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
-   if (ch == '[')
+   if (ch == '[') {
in_escape = 1;
-   else if (ch == ']')
+   } else if (ch == ']') {
in_escape = 0;
-   else if (ch <= SPACE) {
+   } else if (ch <= SPACE) {
if (!in_escape && strchr(",.!?;:", last))
spk_serial_out(PROCSPEECH);
if (time_after_eq(jiffies, jiff_max)) {
diff --git a/drivers/staging/speakup/varhandlers.c 
b/drivers/staging/speakup/varhandlers.c
index 5910fe0b1365..d37d24e26641 100644
--- a/drivers/staging/speakup/varhandlers.c
+++ b/drivers/staging/speakup/varhandlers.c
@@ -258,10 +258,11 @@ int spk_set_string_var(const char *page, struct 
st_var_header *var, int len)
if (var->p_val != var_data->u.s.default_val)
strcpy((char *)var->p_val, var_data->u.s.default_val);
return -ERESTART;
-   } else if (var->p_val)
+   } else if (var->p_val) {
strcpy((char *)var->p_val, page);
-   else
+   } else {
return -E2BIG;
+   }
return 0;
 }
 
@@ -281,17 +282,18 @@ int spk_set_mask_bits(const char *input, const int which, 
const int how)
spk_chartab[*cp] &= ~mask;
}
cp = (u_char *)input;
-   if (!cp)
+   if (!cp) {
cp = spk_punc_info[which].value;
-   else {
+   } else {
for (; *cp; cp++) {
if (*cp < SPACE)
 

[PATCH 2/6] staging: speakup: Avoid multiple assignments on same line

2017-03-04 Thread Arushi Singhal
This patch fixes the checkpatch.pl warning "multiple assignments
should be avoided."

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 47cea629ba0b..604335390b87 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -2091,7 +2091,8 @@ speakup_key(struct vc_data *vc, int shift_state, int 
keycode, u_short keysym,
spk_keydown = 0;
goto out;
}
-   value = spk_lastkey = pad_chars[value];
+   value = pad_chars[value];
+   spk_lastkey = value;
spk_keydown++;
spk_parked &= 0xfe;
goto no_map;
-- 
2.11.0

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


[PATCH 4/6] staging: wilc1000: Alignment should match open parenthesis

2017-03-04 Thread Arushi Singhal
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".

Signed-off-by: Arushi Singhal 
---
 drivers/staging/wilc1000/host_interface.c |  2 +-
 drivers/staging/wilc1000/wilc_spi.c   |  2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 16 
 drivers/staging/wilc1000/wilc_wlan.c  | 10 +-
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index f848bb85ff1f..2429c85052bf 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1350,7 +1350,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 
if (u32RcvdAssocRespInfoLen != 0) {
s32Err = 
wilc_parse_assoc_resp_info(rcv_assoc_resp, u32RcvdAssocRespInfoLen,
-   
&pstrConnectRespInfo);
+   
&pstrConnectRespInfo);
if (s32Err) {
netdev_err(vif->ndev, 
"wilc_parse_assoc_resp_info() returned error %d\n", s32Err);
} else {
diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index 55d53c3a95df..fb7ccfc29a19 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -410,7 +410,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
 
if (len2 > ARRAY_SIZE(wb)) {
dev_err(&spi->dev, "spi buffer size too small (%d) (%zu)\n",
-len2, ARRAY_SIZE(wb));
+   len2, ARRAY_SIZE(wb));
return N_FAIL;
}
/* zero spi write buffers. */
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 4a6fe90a41de..8cb7506bd0e5 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1301,16 +1301,16 @@ static int set_pmksa(struct wiphy *wiphy, struct 
net_device *netdev,
 
for (i = 0; i < priv->pmkid_list.numpmkid; i++) {
if (!memcmp(pmksa->bssid, priv->pmkid_list.pmkidlist[i].bssid,
-ETH_ALEN)) {
+   ETH_ALEN)) {
flag = PMKID_FOUND;
break;
}
}
if (i < WILC_MAX_NUM_PMKIDS) {
memcpy(priv->pmkid_list.pmkidlist[i].bssid, pmksa->bssid,
-   ETH_ALEN);
+  ETH_ALEN);
memcpy(priv->pmkid_list.pmkidlist[i].pmkid, pmksa->pmkid,
-   PMKID_LEN);
+  PMKID_LEN);
if (!(flag == PMKID_FOUND))
priv->pmkid_list.numpmkid++;
} else {
@@ -1334,7 +1334,7 @@ static int del_pmksa(struct wiphy *wiphy, struct 
net_device *netdev,
 
for (i = 0; i < priv->pmkid_list.numpmkid; i++) {
if (!memcmp(pmksa->bssid, priv->pmkid_list.pmkidlist[i].bssid,
-ETH_ALEN)) {
+   ETH_ALEN)) {
memset(&priv->pmkid_list.pmkidlist[i], 0, sizeof(struct 
host_if_pmkid));
break;
}
@@ -1343,11 +1343,11 @@ static int del_pmksa(struct wiphy *wiphy, struct 
net_device *netdev,
if (i < priv->pmkid_list.numpmkid && priv->pmkid_list.numpmkid > 0) {
for (; i < (priv->pmkid_list.numpmkid - 1); i++) {
memcpy(priv->pmkid_list.pmkidlist[i].bssid,
-   priv->pmkid_list.pmkidlist[i + 1].bssid,
-   ETH_ALEN);
+  priv->pmkid_list.pmkidlist[i + 1].bssid,
+  ETH_ALEN);
memcpy(priv->pmkid_list.pmkidlist[i].pmkid,
-   priv->pmkid_list.pmkidlist[i].pmkid,
-   PMKID_LEN);
+  priv->pmkid_list.pmkidlist[i].pmkid,
+  PMKID_LEN);
}
priv->pmkid_list.numpmkid--;
} else {
diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index bc5ad20af0a3..9addef1f1e12 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -287,7 +287,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct 
net_device *dev)
 
while (dropped > 0) {
wait_for_completion_timeout(&wilc->txq_event,
-   msecs_to_jiffies(1));
+   mse

[PATCH 5/6] staging: wilc1000: function prototype argument should have identifier name

2017-03-04 Thread Arushi Singhal
function prototype argument should have an identifier name as reported
by checkpatch.pl.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/wilc1000/wilc_wlan.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.h 
b/drivers/staging/wilc1000/wilc_wlan.h
index 11365efcc5d0..7a5eba9b5f47 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
+++ b/drivers/staging/wilc1000/wilc_wlan.h
@@ -274,8 +274,8 @@ struct wilc_vif;
 
 int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer,
u32 buffer_size);
-int wilc_wlan_start(struct wilc *);
-int wilc_wlan_stop(struct wilc *);
+int wilc_wlan_start(struct wilc *wilc);
+int wilc_wlan_stop(struct wilc *wilc);
 int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer,
  u32 buffer_size, wilc_tx_complete_func_t func);
 int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count);
@@ -291,7 +291,7 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void 
*priv, u8 *buffer,
 void wilc_chip_sleep_manually(struct wilc *wilc);
 
 void wilc_enable_tcp_ack_filter(bool value);
-int wilc_wlan_get_num_conn_ifcs(struct wilc *);
+int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc);
 int wilc_mac_xmit(struct sk_buff *skb, struct net_device *dev);
 
 void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size);
-- 
2.11.0

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


[PATCH 6/6] staging: wilc1000: Logical continuations should be on the previous line

2017-03-04 Thread Arushi Singhal
This patch fixes the checkpatch issue:
CHECK: Logical continuations should be on the previous line.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/wilc1000/wilc_spi.c   |  4 ++--
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 12 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c 
b/drivers/staging/wilc1000/wilc_spi.c
index fb7ccfc29a19..5e28adc95371 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -454,8 +454,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 
adr, u8 *b, u32 sz,
return N_FAIL;
}
 
-   if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ)
-   || (cmd == CMD_DMA_READ) || (cmd == CMD_DMA_EXT_READ)) {
+   if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ) ||
+   (cmd == CMD_DMA_READ) || (cmd == CMD_DMA_EXT_READ)) {
int retry;
/* u16 crc1, crc2; */
u8 crc[2];
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 8cb7506bd0e5..54412e97d45b 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -765,8 +765,8 @@ static int connect(struct wiphy *wiphy, struct net_device 
*dev,
}
}
 
-   if ((sme->crypto.wpa_versions & NL80211_WPA_VERSION_1)
-   || (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2)) {
+   if ((sme->crypto.wpa_versions & NL80211_WPA_VERSION_1) ||
+   (sme->crypto.wpa_versions & NL80211_WPA_VERSION_2)) {
for (i = 0; i < sme->crypto.n_ciphers_pairwise; i++) {
if (sme->crypto.ciphers_pairwise[i] == 
WLAN_CIPHER_SUITE_TKIP)
u8security = u8security | TKIP;
@@ -1497,8 +1497,8 @@ void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, 
u32 size)
}
}
if (p2p_local_random > 
p2p_recv_random) {
-   if 
((buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == 
GO_NEG_RSP
- || 
buff[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == 
P2P_INV_RSP)) {
+   if 
((buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == 
GO_NEG_RSP ||
+
buff[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == 
P2P_INV_RSP)) {
for (i = 
P2P_PUB_ACTION_SUBTYPE + 2; i < size; i++) {
if 
(buff[i] == P2PELEM_ATTR_ID && !(memcmp(p2p_oui, &buff[i + 2], 4))) {

WILC_WFI_CfgParseRxAction(&buff[i + 6], size - (i + 6));
@@ -1682,8 +1682,8 @@ static int mgmt_tx(struct wiphy *wiphy,
}
}
 
-   if 
((buf[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_REQ || buf[P2P_PUB_ACTION_SUBTYPE] == 
GO_NEG_RSP
- || 
buf[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_REQ || buf[P2P_PUB_ACTION_SUBTYPE] == 
P2P_INV_RSP)) {
+   if 
((buf[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_REQ || buf[P2P_PUB_ACTION_SUBTYPE] == 
GO_NEG_RSP ||
+
buf[P2P_PUB_ACTION_SUBTYPE] == P2P_INV_REQ || buf[P2P_PUB_ACTION_SUBTYPE] == 
P2P_INV_RSP)) {
if (p2p_local_random > 
p2p_recv_random) {
for (i = 
P2P_PUB_ACTION_SUBTYPE + 2; i < len; i++) {
if 
(buf[i] == P2PELEM_ATTR_ID && !(memcmp(p2p_oui, &buf[i + 2], 4))) {
-- 
2.11.0

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


[PATCH 3/6] staging: speakup: identation should use tabs

2017-03-04 Thread Arushi Singhal
Indentation should always use tabs and never spaces.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/speakup/speakup_decpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/speakup/speakup_decpc.c 
b/drivers/staging/speakup/speakup_decpc.c
index dc860c4b8279..c5d1660da5be 100644
--- a/drivers/staging/speakup/speakup_decpc.c
+++ b/drivers/staging/speakup/speakup_decpc.c
@@ -85,8 +85,8 @@
 #defineCTRL_io_priority0x0c00  /*   change i/o priority */
 #defineCTRL_free_mem   0x0d00  /*   get free paragraphs on 
module */
 #defineCTRL_get_lang   0x0e00  /* return bit mask of loaded
-* languages
-*/
+* languages
+*/
 #defineCMD_test0x2000  /* self-test 
request */
 #defineTEST_mask   0x0F00  /* isolate test field */
 #defineTEST_null   0x  /* no test requested */
-- 
2.11.0

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


Re: [PATCH v5 0/5] Remove unnecessary cast on void pointer

2017-03-04 Thread SIMRAN SINGHAL
On Sat, Mar 4, 2017 at 9:22 PM, Joe Perches  wrote:
> On Sat, 2017-03-04 at 21:00 +0530, simran singhal wrote:
>> This patch-series removes unnecessary cast on void pointer in various
>> drivers.
>
> Much better, thanks.
>
> Trivia: (and it's probably not necessary to resend)
>
> The cover letter should describe the subsystem being
> changed or ideally something like "treewide" if the
> series touches files throughout the kernel sources.
>
> So this cover letter ideally would have a subject like:
>
> Subject: [PATCH v5 0/5] staging: Remove unnecessary casts of void pointer
>
>> v5:
>>   -Fixed compliation warning in lustre/lustre/llite/range_lock.c
>>which remain unfixed in v3.
>> v4:
>>   -change the cover-letter subject
>> v3:
>>   -Fixed compilation warning in lustre/lustre/llite/range_lock.c
>>
>> simran singhal (5):
>>   staging: nvec: Remove unnecessary cast on void pointer
>>   staging: lustre: Remove unnecessary cast on void pointer
>>   staging: lustre: lustre: Remove unnecessary cast on void pointer
>>   staging: rts5208: Remove unnecessary cast on void pointer
>>   staging: rtl8712: Remove unnecessary cast on void pointer
>
> Some of these are acting on multiple instances.
>
> Please try to use plural and singular descriptions
> where appropriate.
>
Thanks Joe,
Will keep this in mind from next time.

>>  drivers/staging/lustre/lustre/llite/range_lock.c |  2 +-
>>  drivers/staging/lustre/lustre/lmv/lmv_obd.c  |  4 ++--
>>  drivers/staging/nvec/nvec_kbd.c  |  2 +-
>>  drivers/staging/rtl8712/rtl8712_recv.c   | 11 +--
>>  drivers/staging/rts5208/rtsx_transport.c |  3 +--
>>  5 files changed, 10 insertions(+), 12 deletions(-)
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/3] Replace "is is " with "is"

2017-03-04 Thread simran singhal
This patch series replace "is is " with "is" in various drivers. 

simran singhal (3):
  staging: rtl8192u: Replace "is is" with "is"
  staging: greybus: Replace "is is" with "is"
  staging: comedi: Replace "is is" with "is"

 drivers/staging/comedi/drivers/ni_usb6501.c | 2 +-
 drivers/staging/greybus/uart.c  | 2 +-
 drivers/staging/rtl8192u/r819xU_cmdpkt.c| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.7.4

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


[PATCH 2/3] staging: greybus: Replace "is is" with "is"

2017-03-04 Thread simran singhal
This patch replace "is is " with "is". The replacement couldn't be
automated because sometimes the first "is" was meant to be another
word.

Signed-off-by: simran singhal 
---
 drivers/staging/greybus/uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
index ab0dbf5..9188fe0 100644
--- a/drivers/staging/greybus/uart.c
+++ b/drivers/staging/greybus/uart.c
@@ -34,7 +34,7 @@
 #include "greybus.h"
 #include "gbphy.h"
 
-#define GB_NUM_MINORS  16  /* 16 is is more than enough */
+#define GB_NUM_MINORS  16  /* 16 is more than enough */
 #define GB_NAME"ttyGB"
 
 #define GB_UART_WRITE_FIFO_SIZEPAGE_SIZE
-- 
2.7.4

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


[PATCH 1/3] staging: rtl8192u: Replace "is is" with "is"

2017-03-04 Thread simran singhal
This patch replace "is is " with "is". The replacement couldn't be
automated because sometimes the first "is" was meant to be another
word.

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c 
b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
index 3e0731b..231be8f 100644
--- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
+++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
@@ -495,7 +495,7 @@ u32 cmpk_message_handle_rx(struct net_device *dev,
u8  element_id;
u8  *pcmd_buff;
 
-   /* 0. Check inpt arguments. If is is a command queue message or
+   /* 0. Check inpt arguments. If is a command queue message or
 * pointer is null.
 */
if (pstats == NULL)
-- 
2.7.4

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


[PATCH 3/3] staging: comedi: Replace "is is" with "is"

2017-03-04 Thread simran singhal
This patch replace "is is " with "is". The replacement couldn't be
automated because sometimes the first "is" was meant to be another
word.

Signed-off-by: simran singhal 
---
 drivers/staging/comedi/drivers/ni_usb6501.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c 
b/drivers/staging/comedi/drivers/ni_usb6501.c
index 5036eeb..9a0a963 100644
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
@@ -45,7 +45,7 @@
  * byte 3 is the total packet length
  *
  * byte 4 is always 00
- * byte 5 is is the total packet length - 4
+ * byte 5 is the total packet length - 4
  * byte 6 is always 01
  * byte 7 is the command
  *
-- 
2.7.4

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


[PATCH] staging: speakup: Add __printf format/arg verification, fix fallout

2017-03-04 Thread Joe Perches
Using __printf allows the compiler to verify formats and arguments.
Use it and fix the single misuse found.

Signed-off-by: Joe Perches 
---
 drivers/staging/speakup/main.c | 2 +-
 drivers/staging/speakup/spk_priv.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index c2f70ef5b9b3..5c174c98f108 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -775,7 +775,7 @@ static void say_line(struct vc_data *vc)
cp = buf;
while (*cp == SPACE)
cp++;
-   synth_printf("%d, ", (cp - buf) + 1);
+   synth_printf("%zd, ", (cp - buf) + 1);
}
spk_punc_mask = spk_punc_masks[spk_reading_punc];
spkup_write(buf, i);
diff --git a/drivers/staging/speakup/spk_priv.h 
b/drivers/staging/speakup/spk_priv.h
index d5aa41d82122..c78c2b6a2fc9 100644
--- a/drivers/staging/speakup/spk_priv.h
+++ b/drivers/staging/speakup/spk_priv.h
@@ -63,6 +63,7 @@ void spk_do_catch_up(struct spk_synth *synth);
 void spk_synth_flush(struct spk_synth *synth);
 int spk_synth_is_alive_nop(struct spk_synth *synth);
 int spk_synth_is_alive_restart(struct spk_synth *synth);
+__printf(1, 2)
 void synth_printf(const char *buf, ...);
 int synth_request_region(unsigned long start, unsigned long n);
 int synth_release_region(unsigned long start, unsigned long n);
-- 
2.10.0.rc2.1.g053435c

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


Re: [Outreachy kernel] [PATCH 0/3] Replace "is is " with "is"

2017-03-04 Thread Julia Lawall
Joe suggested to indicate the subsystem in the subject line of the cover
letter, ie staging here.

How are you finding these?

julia

On Sat, 4 Mar 2017, simran singhal wrote:

> This patch series replace "is is " with "is" in various drivers.
>
> simran singhal (3):
>   staging: rtl8192u: Replace "is is" with "is"
>   staging: greybus: Replace "is is" with "is"
>   staging: comedi: Replace "is is" with "is"
>
>  drivers/staging/comedi/drivers/ni_usb6501.c | 2 +-
>  drivers/staging/greybus/uart.c  | 2 +-
>  drivers/staging/rtl8192u/r819xU_cmdpkt.c| 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1488643671-24758-1-git-send-email-singhalsimran0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 1/3] staging: rtl8192u: Replace "is is" with "is"

2017-03-04 Thread Julia Lawall


On Sat, 4 Mar 2017, simran singhal wrote:

> This patch replace "is is " with "is". The replacement couldn't be
> automated because sometimes the first "is" was meant to be another
> word.
>
> Signed-off-by: simran singhal 
> ---
>  drivers/staging/rtl8192u/r819xU_cmdpkt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c 
> b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> index 3e0731b..231be8f 100644
> --- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> +++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
> @@ -495,7 +495,7 @@ u32 cmpk_message_handle_rx(struct net_device *dev,
>   u8  element_id;
>   u8  *pcmd_buff;
>
> - /* 0. Check inpt arguments. If is is a command queue message or
> + /* 0. Check inpt arguments. If is a command queue message or

I can't figure out how to parse "If is a command...".

julia

>* pointer is null.
>*/
>   if (pstats == NULL)
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1488643671-24758-2-git-send-email-singhalsimran0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 3/3] staging: comedi: Replace "is is" with "is"

2017-03-04 Thread Julia Lawall


On Sat, 4 Mar 2017, simran singhal wrote:

> This patch replace "is is " with "is". The replacement couldn't be
> automated because sometimes the first "is" was meant to be another
> word.
>
> Signed-off-by: simran singhal 

Acked-by: Julia Lawall 

> ---
>  drivers/staging/comedi/drivers/ni_usb6501.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c 
> b/drivers/staging/comedi/drivers/ni_usb6501.c
> index 5036eeb..9a0a963 100644
> --- a/drivers/staging/comedi/drivers/ni_usb6501.c
> +++ b/drivers/staging/comedi/drivers/ni_usb6501.c
> @@ -45,7 +45,7 @@
>   *   byte 3 is the total packet length
>   *
>   *   byte 4 is always 00
> - *   byte 5 is is the total packet length - 4
> + *   byte 5 is the total packet length - 4
>   *   byte 6 is always 01
>   *   byte 7 is the command
>   *
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1488643671-24758-4-git-send-email-singhalsimran0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 2/3] staging: greybus: Replace "is is" with "is"

2017-03-04 Thread Julia Lawall


On Sat, 4 Mar 2017, simran singhal wrote:

> This patch replace "is is " with "is". The replacement couldn't be
> automated because sometimes the first "is" was meant to be another
> word.
>
> Signed-off-by: simran singhal 

Acked-by: Julia Lawall 

> ---
>  drivers/staging/greybus/uart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
> index ab0dbf5..9188fe0 100644
> --- a/drivers/staging/greybus/uart.c
> +++ b/drivers/staging/greybus/uart.c
> @@ -34,7 +34,7 @@
>  #include "greybus.h"
>  #include "gbphy.h"
>
> -#define GB_NUM_MINORS16  /* 16 is is more than enough */
> +#define GB_NUM_MINORS16  /* 16 is more than enough */
>  #define GB_NAME  "ttyGB"
>
>  #define GB_UART_WRITE_FIFO_SIZE  PAGE_SIZE
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1488643671-24758-3-git-send-email-singhalsimran0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/3] staging: rtl8192u: Clean up tests if NULL returned on failure

2017-03-04 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:
@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c  | 2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c| 2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 713f1d6..df94021 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -67,7 +67,7 @@ static void *ieee80211_tkip_init(int key_idx)
struct ieee80211_tkip_data *priv;
 
priv = kzalloc(sizeof(*priv), GFP_ATOMIC);
-   if (priv == NULL)
+   if (!priv)
goto fail;
priv->key_idx = key_idx;
 
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
index 0e8c876..7ba4b07 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
@@ -42,7 +42,7 @@ static void *prism2_wep_init(int keyidx)
struct prism2_wep_data *priv;
 
priv = kzalloc(sizeof(*priv), GFP_ATOMIC);
-   if (priv == NULL)
+   if (!priv)
return NULL;
priv->key_idx = keyidx;
 
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 1bff0e9..4adab30 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -3025,7 +3025,7 @@ static int ieee80211_wpa_set_encryption(struct 
ieee80211_device *ieee,
ieee80211_crypt_delayed_deinit(ieee, crypt);
 
new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
-   if (new_crypt == NULL) {
+   if (!new_crypt) {
ret = -ENOMEM;
goto done;
}
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index 2481c21..c925e53 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -362,7 +362,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
/* take WEP into use */
new_crypt = kzalloc(sizeof(struct ieee80211_crypt_data),
GFP_KERNEL);
-   if (new_crypt == NULL)
+   if (!new_crypt)
return -ENOMEM;
new_crypt->ops = ieee80211_get_crypto_ops("WEP");
if (!new_crypt->ops) {
@@ -610,7 +610,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device 
*ieee,
ieee80211_crypt_delayed_deinit(ieee, crypt);
 
new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
-   if (new_crypt == NULL) {
+   if (!new_crypt) {
ret = -ENOMEM;
goto done;
}
-- 
2.7.4

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


[PATCH 0/3] staging: Clean up tests if NULL returned on failure

2017-03-04 Thread simran singhal
This patch series tests if functions like kmalloc/kzalloc return NULL
on failure. When NULL represents failure, !x is commonly used.

simran singhal (3):
  staging: rtl8192u: Clean up tests if NULL returned on failure
  staging: speakup: Clean up tests if NULL returned on failure
  staging: vc04_services: Clean up tests if NULL returned on failure

 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c  | 2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c   | 2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
 drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c  | 4 ++--
 drivers/staging/speakup/main.c | 2 +-
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.7.4

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


[PATCH 3/3] staging: vc04_services: Clean up tests if NULL returned on failure

2017-03-04 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:
@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: simran singhal 
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
index e0ba0ed..7fa0310 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c
@@ -52,7 +52,7 @@ int vchiu_queue_init(VCHIU_QUEUE_T *queue, int size)
sema_init(&queue->push, 0);
 
queue->storage = kzalloc(size * sizeof(VCHIQ_HEADER_T *), GFP_KERNEL);
-   if (queue->storage == NULL) {
+   if (!queue->storage) {
vchiu_queue_delete(queue);
return 0;
}
-- 
2.7.4

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


[PATCH 2/3] staging: speakup: Clean up tests if NULL returned on failure

2017-03-04 Thread simran singhal
Some functions like kmalloc/kzalloc return NULL on failure.
When NULL represents failure, !x is commonly used.

This was done using Coccinelle:
@@
expression *e;
identifier l1;
@@

e = \(kmalloc\|kzalloc\|kcalloc\|devm_kzalloc\)(...);
...
- e == NULL
+ !e

Signed-off-by: simran singhal 
---
 drivers/staging/speakup/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index c2f70ef..e8268bc 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -1324,7 +1324,7 @@ static int speakup_allocate(struct vc_data *vc)
if (speakup_console[vc_num] == NULL) {
speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]),
  GFP_ATOMIC);
-   if (speakup_console[vc_num] == NULL)
+   if (!speakup_console[vc_num])
return -ENOMEM;
speakup_date(vc);
} else if (!spk_parked)
-- 
2.7.4

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


[PATCH] staging: unisys: fix sparse warnings

2017-03-04 Thread Andrea Ghittino
Sparse generates two warnings related to incorrect type in assignment.
This patch changes the types in the struct defined in unisys

Signed-off-by: Andrea Ghittino 
---
Compile tested only

 iochannel.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/include/iochannel.h 
b/drivers/staging/unisys/include/iochannel.h
index 54f4900..41e5b4e 100644
--- a/drivers/staging/unisys/include/iochannel.h
+++ b/drivers/staging/unisys/include/iochannel.h
@@ -308,8 +308,8 @@ struct net_pkt_xmt {
u8 valid;   /* 1 = struct is valid - else ignore */
u8 hrawoffv;/* 1 = hwrafoff is valid */
u8 nhrawoffv;   /* 1 = nhwrafoff is valid */
-   u16 protocol;   /* specifies packet protocol */
-   u32 csum;   /* value used to set skb->csum at IOPart */
+   __be16 protocol;/* specifies packet protocol */
+   __wsum csum;/* value used to set skb->csum at IOPart */
u32 hrawoff;/* value used to set skb->h.raw at IOPart */
/* hrawoff points to the start of the TRANSPORT LAYER HEADER */
u32 nhrawoff;   /* value used to set skb->nh.raw at IOPart */
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 0/3] staging: Clean up tests if NULL returned on failure

2017-03-04 Thread Julia Lawall


On Sat, 4 Mar 2017, simran singhal wrote:

> This patch series tests if functions like kmalloc/kzalloc return NULL
> on failure. When NULL represents failure, !x is commonly used.
>
> simran singhal (3):
>   staging: rtl8192u: Clean up tests if NULL returned on failure
>   staging: speakup: Clean up tests if NULL returned on failure
>   staging: vc04_services: Clean up tests if NULL returned on failure

Acked-by: Julia Lawall 

>
>  drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c  | 2 +-
>  drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c   | 2 +-
>  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
>  drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c  | 4 ++--
>  drivers/staging/speakup/main.c | 2 +-
>  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_util.c | 2 +-
>  6 files changed, 7 insertions(+), 7 deletions(-)
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1488646015-7059-1-git-send-email-singhalsimran0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v1 0/3] staging: Replace "is is " with "is"

2017-03-04 Thread simran singhal
This patch series replace "is is " with "is" in various drivers.

v1:
  -change the subject
  -Changed "If is a command..." to "It is a command..." in
   rtl8192u/r819xU_cmdpkt.c

simran singhal (3):
  staging: rtl8192u: Replace "is is" with "is"
  staging: greybus: Replace "is is" with "is"
  staging: comedi: Replace "is is" with "is"

 drivers/staging/comedi/drivers/ni_usb6501.c | 2 +-
 drivers/staging/greybus/uart.c  | 2 +-
 drivers/staging/rtl8192u/r819xU_cmdpkt.c| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.7.4

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


[PATCH v1 1/3] staging: rtl8192u: Replace "is is" with "is"

2017-03-04 Thread simran singhal
This patch replace "is is " with "is". The replacement couldn't be
automated because sometimes the first "is" was meant to be another
word.

Signed-off-by: simran singhal 
---

 v1:
   -Changed "If is a command..." to "It is a command..."

 drivers/staging/rtl8192u/r819xU_cmdpkt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c 
b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
index 3e0731b..bb6d8bd 100644
--- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
+++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
@@ -495,7 +495,7 @@ u32 cmpk_message_handle_rx(struct net_device *dev,
u8  element_id;
u8  *pcmd_buff;
 
-   /* 0. Check inpt arguments. If is is a command queue message or
+   /* 0. Check inpt arguments. It is a command queue message or
 * pointer is null.
 */
if (pstats == NULL)
-- 
2.7.4

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


[PATCH v1 2/3] staging: greybus: Replace "is is" with "is"

2017-03-04 Thread simran singhal
This patch replace "is is " with "is". The replacement couldn't be
automated because sometimes the first "is" was meant to be another
word.

Signed-off-by: simran singhal 
Acked-by: Julia Lawall 
---
 drivers/staging/greybus/uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
index ab0dbf5..9188fe0 100644
--- a/drivers/staging/greybus/uart.c
+++ b/drivers/staging/greybus/uart.c
@@ -34,7 +34,7 @@
 #include "greybus.h"
 #include "gbphy.h"
 
-#define GB_NUM_MINORS  16  /* 16 is is more than enough */
+#define GB_NUM_MINORS  16  /* 16 is more than enough */
 #define GB_NAME"ttyGB"
 
 #define GB_UART_WRITE_FIFO_SIZEPAGE_SIZE
-- 
2.7.4

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


[PATCH v1 3/3] staging: comedi: Replace "is is" with "is"

2017-03-04 Thread simran singhal
This patch replace "is is " with "is". The replacement couldn't be
automated because sometimes the first "is" was meant to be another
word.

Signed-off-by: simran singhal 
Acked-by: Julia Lawall 
---
 drivers/staging/comedi/drivers/ni_usb6501.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_usb6501.c 
b/drivers/staging/comedi/drivers/ni_usb6501.c
index 5036eeb..9a0a963 100644
--- a/drivers/staging/comedi/drivers/ni_usb6501.c
+++ b/drivers/staging/comedi/drivers/ni_usb6501.c
@@ -45,7 +45,7 @@
  * byte 3 is the total packet length
  *
  * byte 4 is always 00
- * byte 5 is is the total packet length - 4
+ * byte 5 is the total packet length - 4
  * byte 6 is always 01
  * byte 7 is the command
  *
-- 
2.7.4

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


[PATCH 1/2] Staging: comedi: comedi_fops: Change comedi_num_legacy_minors type

2017-03-04 Thread Cheah Kok Cheong
Change to unsigned to allow removal of negative value check in
init section. Use smaller data type since the max possible
value currently is 48.

Signed-off-by: Cheah Kok Cheong 
---
 drivers/staging/comedi/comedi_fops.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index 57e8599..354d264 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -76,8 +76,8 @@ struct comedi_file {
 #define COMEDI_NUM_SUBDEVICE_MINORS\
(COMEDI_NUM_MINORS - COMEDI_NUM_BOARD_MINORS)
 
-static int comedi_num_legacy_minors;
-module_param(comedi_num_legacy_minors, int, 0444);
+static unsigned short comedi_num_legacy_minors;
+module_param(comedi_num_legacy_minors, ushort, 0444);
 MODULE_PARM_DESC(comedi_num_legacy_minors,
 "number of comedi minor devices to reserve for 
non-auto-configured devices (default 0)"
);
@@ -2857,8 +2857,7 @@ static int __init comedi_init(void)
 
pr_info("version " COMEDI_RELEASE " - http://www.comedi.org\n";);
 
-   if (comedi_num_legacy_minors < 0 ||
-   comedi_num_legacy_minors > COMEDI_NUM_BOARD_MINORS) {
+   if (comedi_num_legacy_minors > COMEDI_NUM_BOARD_MINORS) {
pr_err("invalid value for module parameter 
\"comedi_num_legacy_minors\".  Valid values are 0 through %i.\n",
   COMEDI_NUM_BOARD_MINORS);
return -EINVAL;
-- 
2.7.4

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


[PATCH 2/2] Staging: comedi: comedi_fops: Fix "out of minor numbers for board device files"

2017-03-04 Thread Cheah Kok Cheong
If comedi module is loaded with the following max allowed parameter
[comedi_num_legacy_minors=48], subsequent loading of an auto-configured
device will fail.

In this case a default to auto-configuration comedi_test module failed
to load with the following messages.

comedi_test comedi_testd: ran out of minor numbers for board device files
comedi_test comedi_testd: driver 'comedi_test' could not create device.
comedi_test: unable to auto-configure device

This is due to changes in commit 38b9722a4414
("staging: comedi: avoid releasing legacy minors automatically") which
will not allocate a minor number when comedi_num_legacy_minors equals
COMEDI_NUM_BOARD_MINORS. COMEDI_NUM_BOARD_MINORS is defined to be
0x30 which is 48.

This goes for a simple fix which limit comedi_num_legacy_minors to 47
instead of tinkering with comedi_alloc_board_minor() and
comedi_release_hardware_device().

Fix: commit 38b9722a4414 ("staging: comedi: avoid releasing legacy minors
automatically")

Signed-off-by: Cheah Kok Cheong 
---
 drivers/staging/comedi/comedi_fops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c 
b/drivers/staging/comedi/comedi_fops.c
index 354d264..339854f 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2857,9 +2857,9 @@ static int __init comedi_init(void)
 
pr_info("version " COMEDI_RELEASE " - http://www.comedi.org\n";);
 
-   if (comedi_num_legacy_minors > COMEDI_NUM_BOARD_MINORS) {
+   if (comedi_num_legacy_minors >= COMEDI_NUM_BOARD_MINORS) {
pr_err("invalid value for module parameter 
\"comedi_num_legacy_minors\".  Valid values are 0 through %i.\n",
-  COMEDI_NUM_BOARD_MINORS);
+  COMEDI_NUM_BOARD_MINORS - 1);
return -EINVAL;
}
 
-- 
2.7.4

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


[PATCH] staging: vt6655: Fixed some coding style issues

2017-03-04 Thread Tuomo Rinne
Copied function argument names from definition to delcaration. This
fixes some checkpatch warnings.

Signed-off-by: Tuomo Rinne 
---
 drivers/staging/vt6655/rxtx.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.h b/drivers/staging/vt6655/rxtx.h
index 89de671..0952589 100644
--- a/drivers/staging/vt6655/rxtx.h
+++ b/drivers/staging/vt6655/rxtx.h
@@ -187,10 +187,10 @@ struct vnt_tx_short_buf_head {
__le16 time_stamp_off;
 } __packed;
 
-int vnt_generate_fifo_header(struct vnt_private *, u32,
-struct vnt_tx_desc *head_td, struct sk_buff *);
-int vnt_beacon_make(struct vnt_private *, struct ieee80211_vif *);
-int vnt_beacon_enable(struct vnt_private *, struct ieee80211_vif *,
- struct ieee80211_bss_conf *);
+int vnt_generate_fifo_header(struct vnt_private *priv, u32 dma_idx,
+struct vnt_tx_desc *head_td, struct sk_buff *skb);
+int vnt_beacon_make(struct vnt_private *priv, struct ieee80211_vif *vif);
+int vnt_beacon_enable(struct vnt_private *priv, struct ieee80211_vif *vif,
+ struct ieee80211_bss_conf *conf);
 
 #endif /* __RXTX_H__ */
-- 
2.1.4

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


Re: [PATCH] Staging: media: platform: bcm2835 - Style fix

2017-03-04 Thread Derek Robson
On Sat, Mar 04, 2017 at 02:57:22PM +0300, Dan Carpenter wrote:
> Copy a patch prefix that everyone else has been using:
> 
> git log --oneline drivers/staging/media/platform/bcm2835/
> 
> The subject is too vague as well.

Is this what you are looking for?

[patch] Staging: bcm2835: fixed style of block comments

And should I just re-send as a V2 with new subject?

Thanks

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


[PATCH 0/3] staging: rtl8188eu: cleanup of checkpatch findings

2017-03-04 Thread Sebastian Haas
This patch series fixes typos and prevents potential problems with
macro parameters in the rtl8188eu driver.

Sebastian Haas (3):
  staging: rtl8188eu: wrap macro parameters in parentheses
  staging: rtl8188eu: fix typos in comments
  staging: rtl8188eu: fix typos in macros

 drivers/staging/rtl8188eu/hal/odm_RTL8188E.c |  4 ++--
 drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h   |  4 ++--
 drivers/staging/rtl8188eu/include/Hal8188ERateAdaptive.h | 16 
 drivers/staging/rtl8188eu/include/odm.h  |  2 +-
 drivers/staging/rtl8188eu/include/odm_RegDefine11N.h |  4 ++--
 drivers/staging/rtl8188eu/include/odm_debug.h|  4 ++--
 drivers/staging/rtl8188eu/include/odm_types.h|  6 +++---
 drivers/staging/rtl8188eu/include/pwrseq.h   |  2 +-
 drivers/staging/rtl8188eu/include/rtl8188e_hal.h |  4 ++--
 drivers/staging/rtl8188eu/include/rtl8188e_spec.h|  2 +-
 drivers/staging/rtl8188eu/include/rtl8188e_xmit.h|  6 +++---
 drivers/staging/rtl8188eu/include/rtw_cmd.h  |  2 +-
 drivers/staging/rtl8188eu/include/rtw_debug.h|  6 +++---
 drivers/staging/rtl8188eu/include/rtw_efuse.h|  6 +++---
 drivers/staging/rtl8188eu/include/rtw_ioctl.h|  2 +-
 drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |  4 ++--
 drivers/staging/rtl8188eu/include/rtw_mp_phy_regdef.h|  5 +++--
 drivers/staging/rtl8188eu/include/rtw_pwrctrl.h  |  6 +++---
 drivers/staging/rtl8188eu/include/rtw_recv.h |  8 
 drivers/staging/rtl8188eu/include/rtw_security.h |  4 ++--
 drivers/staging/rtl8188eu/include/rtw_xmit.h |  2 +-
 drivers/staging/rtl8188eu/include/sta_info.h |  2 +-
 drivers/staging/rtl8188eu/include/wifi.h |  8 
 23 files changed, 55 insertions(+), 54 deletions(-)

-- 
2.1.4

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


[PATCH 2/3] staging: rtl8188eu: fix typos in comments

2017-03-04 Thread Sebastian Haas
Fix typos reported by checkpatch.pl

Signed-off-by: Sebastian Haas 
---

Already existing block-comment warnings on the edited lines are
not handled by this patch.

 drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h| 2 +-
 drivers/staging/rtl8188eu/include/odm_debug.h | 2 +-
 drivers/staging/rtl8188eu/include/pwrseq.h| 2 +-
 drivers/staging/rtl8188eu/include/rtl8188e_spec.h | 2 +-
 drivers/staging/rtl8188eu/include/rtw_cmd.h   | 2 +-
 drivers/staging/rtl8188eu/include/rtw_mp_phy_regdef.h | 2 +-
 drivers/staging/rtl8188eu/include/rtw_recv.h  | 4 ++--
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h 
b/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h
index 15fccf4..d1c43f6 100644
--- a/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h
+++ b/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h
@@ -179,7 +179,7 @@
 
 /* RxIQ DC offset, Rx digital filter, DC notch filter */
 #definerOFDM0_XARxAFE  0xc10
-#definerOFDM0_XARxIQImbalance  0xc14  /* RxIQ imblance matrix 
*/
+#definerOFDM0_XARxIQImbalance  0xc14  /* RxIQ imbalance matrix 
*/
 #definerOFDM0_XBRxAFE  0xc18
 #definerOFDM0_XBRxIQImbalance  0xc1c
 #definerOFDM0_XCRxAFE  0xc20
diff --git a/drivers/staging/rtl8188eu/include/odm_debug.h 
b/drivers/staging/rtl8188eu/include/odm_debug.h
index 515d19d..a4083ca 100644
--- a/drivers/staging/rtl8188eu/include/odm_debug.h
+++ b/drivers/staging/rtl8188eu/include/odm_debug.h
@@ -37,7 +37,7 @@
 /* resource allocation failed, unexpected HW behavior, HW BUG and so on. */
 #define ODM_DBG_SERIOUS2
 
-/* Abnormal, rare, or unexpeted cases. */
+/* Abnormal, rare, or unexpected cases. */
 /* For example, IRP/Packet/OID canceled, device suprisely unremoved and so 
on. */
 #define ODM_DBG_WARNING3
 
diff --git a/drivers/staging/rtl8188eu/include/pwrseq.h 
b/drivers/staging/rtl8188eu/include/pwrseq.h
index afd61cf..addf90b 100644
--- a/drivers/staging/rtl8188eu/include/pwrseq.h
+++ b/drivers/staging/rtl8188eu/include/pwrseq.h
@@ -29,7 +29,7 @@
4: LPS--Low Power State
5: SUS--Suspend
 
-   The transision from different states are defined below
+   The transition from different states are defined below
TRANS_CARDEMU_TO_ACT
TRANS_ACT_TO_CARDEMU
TRANS_CARDEMU_TO_SUS
diff --git a/drivers/staging/rtl8188eu/include/rtl8188e_spec.h 
b/drivers/staging/rtl8188eu/include/rtl8188e_spec.h
index fb82f66..c93e19d 100644
--- a/drivers/staging/rtl8188eu/include/rtl8188e_spec.h
+++ b/drivers/staging/rtl8188eu/include/rtl8188e_spec.h
@@ -1350,7 +1350,7 @@ Current IOREG MAP
 #define EEPROM_Default_CrystalCap_88E  0x20
 #defineEEPROM_Default_ThermalMeter_88E 0x18
 
-/* New EFUSE deafult value */
+/* New EFUSE default value */
 #defineEEPROM_DEFAULT_24G_INDEX0x2D
 #defineEEPROM_DEFAULT_24G_HT20_DIFF0X02
 #defineEEPROM_DEFAULT_24G_OFDM_DIFF0X04
diff --git a/drivers/staging/rtl8188eu/include/rtw_cmd.h 
b/drivers/staging/rtl8188eu/include/rtw_cmd.h
index 18a6530..f79feeb 100644
--- a/drivers/staging/rtl8188eu/include/rtw_cmd.h
+++ b/drivers/staging/rtl8188eu/include/rtw_cmd.h
@@ -214,7 +214,7 @@ struct set_assocsta_rsp {
 
mac[0] == 0
==> CMD mode, return H2C_SUCCESS.
-   The following condition must be ture under CMD mode
+   The following condition must be true under CMD mode
mac[1] == mac[4], mac[2] == mac[3], mac[0]=mac[5]= 0;
s0 == 0x1234, s1 == 0xabcd, w0 == 0x78563412, w1 == 0x5aa5def7;
s2 == (b1 << 8 | b0);
diff --git a/drivers/staging/rtl8188eu/include/rtw_mp_phy_regdef.h 
b/drivers/staging/rtl8188eu/include/rtw_mp_phy_regdef.h
index 00588f8..b9879cf 100644
--- a/drivers/staging/rtl8188eu/include/rtw_mp_phy_regdef.h
+++ b/drivers/staging/rtl8188eu/include/rtw_mp_phy_regdef.h
@@ -198,7 +198,7 @@
 #definerOFDM0_TRSWIsolation0xc0c
 
 #definerOFDM0_XARxAFE  0xc10  /* RxIQ DC offset, Rx 
digital filter, DC notch filter */
-#definerOFDM0_XARxIQImbalance  0xc14  /* RxIQ imblance matrix 
*/
+#definerOFDM0_XARxIQImbalance  0xc14  /* RxIQ imbalance matrix 
*/
 #definerOFDM0_XBRxAFE  0xc18
 #definerOFDM0_XBRxIQImbalance  0xc1c
 #definerOFDM0_XCRxAFE  0xc20
diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h 
b/drivers/staging/rtl8188eu/include/rtw_recv.h
index c505dca..d54f5a6 100644
--- a/drivers/staging/rtl8188eu/include/rtw_recv.h
+++ b/drivers/staging/rtl8188eu/include/rtw_recv.h
@@ -106,7 +106,7 @@ struct rx_pkt_attrib {
u8  privacy; /* in frame_ctrl field */
u8  bdecrypt

[PATCH 3/3] staging: rtl8188eu: fix typos in macros

2017-03-04 Thread Sebastian Haas
Rename macro definition and usage to represent correct spelling of DEFAULT:
ODM_REG_RX_DEFUALT_A_11N => ODM_REG_RX_DEFAULT_A_11N
ODM_REG_RX_DEFUALT_B_11N => ODM_REG_RX_DEFAULT_B_11N

Signed-off-by: Sebastian Haas 
---
 drivers/staging/rtl8188eu/hal/odm_RTL8188E.c | 4 ++--
 drivers/staging/rtl8188eu/include/odm_RegDefine11N.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c 
b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c
index 55056ff..91e0f6c 100644
--- a/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c
+++ b/drivers/staging/rtl8188eu/hal/odm_RTL8188E.c
@@ -81,9 +81,9 @@ static void dm_trx_hw_antenna_div_init(struct odm_dm_struct 
*dm_odm)
 
/* antenna mapping table */
if (!dm_odm->bIsMPChip) { /* testchip */
-   phy_set_bb_reg(adapter, ODM_REG_RX_DEFUALT_A_11N,
+   phy_set_bb_reg(adapter, ODM_REG_RX_DEFAULT_A_11N,
   BIT(10) | BIT(9) | BIT(8), 1);
-   phy_set_bb_reg(adapter, ODM_REG_RX_DEFUALT_A_11N,
+   phy_set_bb_reg(adapter, ODM_REG_RX_DEFAULT_A_11N,
   BIT(13) | BIT(12) | BIT(11), 2);
} else { /* MPchip */
phy_set_bb_reg(adapter, ODM_REG_ANT_MAPPING1_11N, bMaskDWord,
diff --git a/drivers/staging/rtl8188eu/include/odm_RegDefine11N.h 
b/drivers/staging/rtl8188eu/include/odm_RegDefine11N.h
index c82c090..f46f7d4 100644
--- a/drivers/staging/rtl8188eu/include/odm_RegDefine11N.h
+++ b/drivers/staging/rtl8188eu/include/odm_RegDefine11N.h
@@ -41,8 +41,8 @@
 #defineODM_REG_TX_ANT_CTRL_11N 0x80C
 #defineODM_REG_BB_PWR_SAV5_11N 0x818
 #defineODM_REG_CCK_RPT_FORMAT_11N  0x824
-#defineODM_REG_RX_DEFUALT_A_11N0x858
-#defineODM_REG_RX_DEFUALT_B_11N0x85A
+#defineODM_REG_RX_DEFAULT_A_11N0x858
+#defineODM_REG_RX_DEFAULT_B_11N0x85A
 #defineODM_REG_BB_PWR_SAV3_11N 0x85C
 #defineODM_REG_ANTSEL_CTRL_11N 0x860
 #defineODM_REG_RX_ANT_CTRL_11N 0x864
-- 
2.1.4

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


[PATCH 1/3] staging: rtl8188eu: wrap macro parameters in parentheses

2017-03-04 Thread Sebastian Haas
Avoid potential precedences issues by wrapping macro parameters
in parentheses.

Signed-off-by: Sebastian Haas 
---
 drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h   |  2 +-
 drivers/staging/rtl8188eu/include/Hal8188ERateAdaptive.h | 16 
 drivers/staging/rtl8188eu/include/odm.h  |  2 +-
 drivers/staging/rtl8188eu/include/odm_debug.h|  2 +-
 drivers/staging/rtl8188eu/include/odm_types.h|  6 +++---
 drivers/staging/rtl8188eu/include/rtl8188e_hal.h |  4 ++--
 drivers/staging/rtl8188eu/include/rtl8188e_xmit.h|  6 +++---
 drivers/staging/rtl8188eu/include/rtw_debug.h|  6 +++---
 drivers/staging/rtl8188eu/include/rtw_efuse.h|  6 +++---
 drivers/staging/rtl8188eu/include/rtw_ioctl.h|  2 +-
 drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |  4 ++--
 drivers/staging/rtl8188eu/include/rtw_mp_phy_regdef.h|  3 ++-
 drivers/staging/rtl8188eu/include/rtw_pwrctrl.h  |  6 +++---
 drivers/staging/rtl8188eu/include/rtw_recv.h |  4 ++--
 drivers/staging/rtl8188eu/include/rtw_security.h |  4 ++--
 drivers/staging/rtl8188eu/include/rtw_xmit.h |  2 +-
 drivers/staging/rtl8188eu/include/sta_info.h |  2 +-
 drivers/staging/rtl8188eu/include/wifi.h |  8 
 18 files changed, 43 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h 
b/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h
index 344c73d..15fccf4 100644
--- a/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h
+++ b/drivers/staging/rtl8188eu/include/Hal8188EPhyReg.h
@@ -495,7 +495,7 @@
 #definebOFDMTxStatus   0x2
 
 #defineIS_BB_REG_OFFSET_92S(_Offset)   \
-   ((_Offset >= 0x800) && (_Offset <= 0xfff))
+   (((_Offset) >= 0x800) && ((_Offset) <= 0xfff))
 
 /*  2. Page8(0x800) */
 #definebRFMOD  0x1 /*  Reg 0x800 rFPGA0_RFMOD */
diff --git a/drivers/staging/rtl8188eu/include/Hal8188ERateAdaptive.h 
b/drivers/staging/rtl8188eu/include/Hal8188ERateAdaptive.h
index 21996a1..e81d571 100644
--- a/drivers/staging/rtl8188eu/include/Hal8188ERateAdaptive.h
+++ b/drivers/staging/rtl8188eu/include/Hal8188ERateAdaptive.h
@@ -27,24 +27,24 @@ Major Change History:
 #define GET_TX_RPT2_DESC_PKT_LEN_88E(__pRxStatusDesc)  \
LE_BITS_TO_4BYTE(__pRxStatusDesc, 0, 9)
 #define GET_TX_RPT2_DESC_MACID_VALID_1_88E(__pRxStatusDesc)\
-   LE_BITS_TO_4BYTE(__pRxStatusDesc+16, 0, 32)
+   LE_BITS_TO_4BYTE((__pRxStatusDesc) + 16, 0, 32)
 #define GET_TX_RPT2_DESC_MACID_VALID_2_88E(__pRxStatusDesc)\
-   LE_BITS_TO_4BYTE(__pRxStatusDesc+20, 0, 32)
+   LE_BITS_TO_4BYTE((__pRxStatusDesc) + 20, 0, 32)
 
 #define GET_TX_REPORT_TYPE1_RERTY_0(__pAddr)   \
LE_BITS_TO_4BYTE(__pAddr, 0, 16)
 #define GET_TX_REPORT_TYPE1_RERTY_1(__pAddr)   \
-   LE_BITS_TO_1BYTE(__pAddr+2, 0, 8)
+   LE_BITS_TO_1BYTE((__pAddr) + 2, 0, 8)
 #define GET_TX_REPORT_TYPE1_RERTY_2(__pAddr)   \
-   LE_BITS_TO_1BYTE(__pAddr+3, 0, 8)
+   LE_BITS_TO_1BYTE((__pAddr) + 3, 0, 8)
 #define GET_TX_REPORT_TYPE1_RERTY_3(__pAddr)   \
-   LE_BITS_TO_1BYTE(__pAddr+4, 0, 8)
+   LE_BITS_TO_1BYTE((__pAddr) + 4, 0, 8)
 #define GET_TX_REPORT_TYPE1_RERTY_4(__pAddr)   \
-   LE_BITS_TO_1BYTE(__pAddr+4+1, 0, 8)
+   LE_BITS_TO_1BYTE((__pAddr) + 4 + 1, 0, 8)
 #define GET_TX_REPORT_TYPE1_DROP_0(__pAddr)\
-   LE_BITS_TO_1BYTE(__pAddr+4+2, 0, 8)
+   LE_BITS_TO_1BYTE((__pAddr) + 4 + 2, 0, 8)
 #define GET_TX_REPORT_TYPE1_DROP_1(__pAddr)\
-   LE_BITS_TO_1BYTE(__pAddr+4+3, 0, 8)
+   LE_BITS_TO_1BYTE((__pAddr) + 4 + 3, 0, 8)
 
 /*  End rate adaptive define */
 
diff --git a/drivers/staging/rtl8188eu/include/odm.h 
b/drivers/staging/rtl8188eu/include/odm.h
index 4fb3bb0..f5d7ed8 100644
--- a/drivers/staging/rtl8188eu/include/odm.h
+++ b/drivers/staging/rtl8188eu/include/odm.h
@@ -250,7 +250,7 @@ struct odm_rate_adapt {
 
 #define AVG_THERMAL_NUM8
 #define IQK_Matrix_REG_NUM 8
-#define IQK_Matrix_Settings_NUM1+24+21
+#define IQK_Matrix_Settings_NUM(1 + 24 + 21)
 
 #defineDM_Type_ByFWi   0
 #defineDM_Type_ByDriver1
diff --git a/drivers/staging/rtl8188eu/include/odm_debug.h 
b/drivers/staging/rtl8188eu/include/odm_debug.h
index 52e51f19..515d19d 100644
--- a/drivers/staging/rtl8188eu/include/odm_debug.h
+++ b/drivers/staging/rtl8188eu/include/odm_debug.h
@@ -87,7 +87,7 @@
 
 #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)
\
if (((comp) & pDM_Odm->DebugComponents) &&  \
-   (level <= pDM_Odm->DebugLevel)) {   \
+   ((level) <= pDM_Odm->DebugLevel)) { \
  

Re: [PATCH 2/4] Staging:wilc1000:wilc_spi: Fixed alignment to match parenthesis

2017-03-04 Thread Julian Calaby
Hi All,

On Fri, Mar 3, 2017 at 4:05 AM, Georgios Emmanouil  wrote:
> Fixed alignment to match parenthesis.
>
> Signed-off-by: Georgios Emmanouil 

Reviewed-by: Julian Calaby 

> ---
>  drivers/staging/wilc1000/wilc_spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/4] Staging:wilc1000:wilc_spi: Fixed comment style to the preferred kernel comment style

2017-03-04 Thread Julian Calaby
Hi All,

On Fri, Mar 3, 2017 at 4:04 AM, Georgios Emmanouil  wrote:
> Fixed comment style to the preferred kernel comment style.

Fixing comment style and other stuff like that are the _least_ of the
problems with this driver, but you've done it, so...

> Signed-off-by: Georgios Emmanouil 

Reviewed-by: Julian Calaby 

> ---
>  drivers/staging/wilc1000/wilc_spi.c | 14 ++
>  1 file changed, 6 insertions(+), 8 deletions(-)

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/4] Staging:wilc1000:wilc_spi: Fixed spelling error

2017-03-04 Thread Julian Calaby
Hi All,

On Fri, Mar 3, 2017 at 4:06 AM, Georgios Emmanouil  wrote:
> Fixed spelling error. 'unkmown' to 'unknown'.
>
> Signed-off-by: Georgios Emmanouil 

Reviewed-by: Julian Calaby 

> ---
>  drivers/staging/wilc1000/wilc_spi.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/4] Staging:wilc1000:wilc_spi: Added blank line after function and modified comment style

2017-03-04 Thread Julian Calaby
Hi All,

On Fri, Mar 3, 2017 at 4:07 AM, Georgios Emmanouil  wrote:
> Added blank line after function and modified comment style.
>
> Signed-off-by: Georgios Emmanouil 

Reviewed-by: Julian Calaby 

> ---
>  drivers/staging/wilc1000/wilc_spi.c | 7 ++-
>  1 file changed, 2 insertions(+), 5 deletions(-)

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging:wilc1000:linux_wlan: Modified the 'if-else' statement

2017-03-04 Thread Julian Calaby
Hi All,

On Fri, Mar 3, 2017 at 3:14 AM, Georgios Emmanouil  wrote:
> Modified the 'if-else' statement to make it more readable.
>
> Signed-off-by: Georgios Emmanouil 

Again, I'm dubious if this is needed or helpful, but

Reviewed-by: Julian Calaby 

> ---
>  drivers/staging/wilc1000/linux_wlan.c | 11 +++
>  1 file changed, 3 insertions(+), 8 deletions(-)

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging:wilc1000:wilc_sdio: Modified comment style to preferred kernel comment style

2017-03-04 Thread Julian Calaby
Hi All,

On Fri, Mar 3, 2017 at 3:41 AM, Georgios Emmanouil  wrote:
> Modified comment style to preferred kernel comment style.
>
> Signed-off-by: Georgios Emmanouil 

Reviewed-by: Julian Calaby 

> ---
>  drivers/staging/wilc1000/wilc_sdio.c | 13 +
>  1 file changed, 5 insertions(+), 8 deletions(-)

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/3] Staging:wilc1000:host_interface: Removed unnecessary blank line

2017-03-04 Thread Julian Calaby
Hi All,

On Fri, Mar 3, 2017 at 2:35 AM, Georgios Emmanouil  wrote:
> Removed unnecessary blank line.
>
> Signed-off-by: Georgios Emmanouil 

Reviewed-by: Julian Calaby 

> ---
>  drivers/staging/wilc1000/host_interface.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c 
> b/drivers/staging/wilc1000/host_interface.c
> index c307cce..090fd43 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -287,7 +287,6 @@ static int wilc_enqueue_cmd(struct host_if_msg *msg)
> return 0;
>  }
>
> -
>  /* The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as
>   * special purpose in wilc device, so we add 1 to the index to starts from 1.
>   * As a result, the returned index will be 1 to NUM_CONCURRENT_IFC.
> --
> 2.1.4
>



-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/3] Staging:wilc1000:host_interface: Fixed alignment to match open parenthesis

2017-03-04 Thread Julian Calaby
Hi All,

On Fri, Mar 3, 2017 at 2:37 AM, Georgios Emmanouil  wrote:
> Fixed alignment to match open parenthesis.
>
> Signed-off-by: Georgios Emmanouil 

Reviewed-by: Julian Calaby 

> ---
>  drivers/staging/wilc1000/host_interface.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/3] Staging:wilc1000:host_interface: Integrated two 'if' statements to a single 'if' statement

2017-03-04 Thread Julian Calaby
Hi All,

On Fri, Mar 3, 2017 at 2:38 AM, Georgios Emmanouil  wrote:
> Removed unnecessary 'if' statement and integrated the condition to the
> previous 'if' statement.
>
> Signed-off-by: Georgios Emmanouil 

Reviewed-by: Julian Calaby 

> ---
>  drivers/staging/wilc1000/host_interface.c | 12 +---
>  1 file changed, 5 insertions(+), 7 deletions(-)

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 1/1] Drivers: hv: util: don't forget to init host_ts.lock

2017-03-04 Thread KY Srinivasan


> -Original Message-
> From: k...@exchange.microsoft.com [mailto:k...@exchange.microsoft.com]
> Sent: Monday, February 27, 2017 5:26 PM
> To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> vkuzn...@redhat.com; jasow...@redhat.com;
> leann.ogasaw...@canonical.com
> Cc: Dexuan Cui ; KY Srinivasan
> ; Haiyang Zhang ; Stephen
> Hemminger 
> Subject: [PATCH 1/1] Drivers: hv: util: don't forget to init host_ts.lock
> 
> This sender failed our fraud detection&nbs
> p;checks and may not be who they&
> nbsp;appear to be. Learn about  href="http://aka.ms/LearnAboutSpoofing";>spoofing
> 
> From: Dexuan Cui 
> 
> Without the patch, I always get a "BUG: spinlock bad magic" warning.
> 
> Fixes: 3716a49a81ba ("hv_utils: implement Hyper-V PTP source")
> Signed-off-by: Dexuan Cui 
> Cc: Vitaly Kuznetsov 
> Cc: "K. Y. Srinivasan" 
> Cc: Haiyang Zhang 
> Cc: Stephen Hemminger 
> Signed-off-by: K. Y. Srinivasan 
> ---
>  drivers/hv/hv_util.c |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
> index 3042eaa..186b100 100644
> --- a/drivers/hv/hv_util.c
> +++ b/drivers/hv/hv_util.c
> @@ -590,6 +590,8 @@ static int hv_timesync_init(struct hv_util_service *srv)
> if (!hyperv_cs)
> return -ENODEV;
> 
> +   spin_lock_init(&host_ts.lock);
> +
> INIT_WORK(&wrk.work, hv_set_host_time);
> 
> /*
> --
> 1.7.1

Greg,

Please drop this patch; I am going to resend.

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


RE: [PATCH 1/1] Drivers: hv: util: on deinit, don't wait the release event, if we shouldn't

2017-03-04 Thread KY Srinivasan


> -Original Message-
> From: k...@exchange.microsoft.com [mailto:k...@exchange.microsoft.com]
> Sent: Monday, February 27, 2017 3:18 PM
> To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> vkuzn...@redhat.com; jasow...@redhat.com;
> leann.ogasaw...@canonical.com
> Cc: Dexuan Cui ; KY Srinivasan
> ; Haiyang Zhang ; Stephen
> Hemminger 
> Subject: [PATCH 1/1] Drivers: hv: util: on deinit, don't wait the release 
> event,
> if we shouldn't
> 
> This sender failed our fraud detection&nbs
> p;checks and may not be who they&
> nbsp;appear to be. Learn about  href="http://aka.ms/LearnAboutSpoofing";>spoofing
> 
> From: Dexuan Cui 
> 
> If the daemon is NOT running at all, when we disable the util device from
> Hyper-V Manager (or sometimes the host can rescind a util device and then
> re-offer it), we'll hang in util_remove -> hv_kvp_deinit ->
> wait_for_completion(&release_event), because this code path doesn't run:
> hvt_op_release -> ... -> kvp_on_reset -> complete(&release_event).
> 
> Due to this, we even can't reboot the VM properly.
> 
> The patch tracks if the dev file is opened or not, and we only need to
> wait if it's opened.
> 
> Fixes: 5a66fecbf6aa ("Drivers: hv: util: kvp: Fix a rescind processing issue")
> 
> Signed-off-by: Dexuan Cui 
> Cc: Vitaly Kuznetsov 
> Cc: "K. Y. Srinivasan" 
> Cc: Haiyang Zhang 
> Cc: Stephen Hemminger 
> Signed-off-by: K. Y. Srinivasan 
> ---
>  drivers/hv/hv_fcopy.c   |5 -
>  drivers/hv/hv_kvp.c |6 +-
>  drivers/hv/hv_snapshot.c|5 -
>  drivers/hv/hv_utils_transport.c |2 ++
>  drivers/hv/hv_utils_transport.h |1 +
>  5 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c
> index 9aee601..545cf43 100644
> --- a/drivers/hv/hv_fcopy.c
> +++ b/drivers/hv/hv_fcopy.c
> @@ -358,8 +358,11 @@ int hv_fcopy_init(struct hv_util_service *srv)
> 
>  void hv_fcopy_deinit(void)
>  {
> +   bool wait = hvt->dev_opened;
> +
> fcopy_transaction.state = HVUTIL_DEVICE_DYING;
> cancel_delayed_work_sync(&fcopy_timeout_work);
> hvutil_transport_destroy(hvt);
> -   wait_for_completion(&release_event);
> +   if (wait)
> +   wait_for_completion(&release_event);
>  }
> diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
> index de26371..15c7873 100644
> --- a/drivers/hv/hv_kvp.c
> +++ b/drivers/hv/hv_kvp.c
> @@ -742,10 +742,14 @@ static void kvp_on_reset(void)
> 
>  void hv_kvp_deinit(void)
>  {
> +   bool wait = hvt->dev_opened;
> +
> kvp_transaction.state = HVUTIL_DEVICE_DYING;
> cancel_delayed_work_sync(&kvp_host_handshake_work);
> cancel_delayed_work_sync(&kvp_timeout_work);
> cancel_work_sync(&kvp_sendkey_work);
> hvutil_transport_destroy(hvt);
> -   wait_for_completion(&release_event);
> +
> +   if (wait)
> +   wait_for_completion(&release_event);
>  }
> diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c
> index bcc03f0..3847f19 100644
> --- a/drivers/hv/hv_snapshot.c
> +++ b/drivers/hv/hv_snapshot.c
> @@ -396,9 +396,12 @@ static void vss_on_reset(void)
> 
>  void hv_vss_deinit(void)
>  {
> +   bool wait = hvt->dev_opened;
> +
> vss_transaction.state = HVUTIL_DEVICE_DYING;
> cancel_delayed_work_sync(&vss_timeout_work);
> cancel_work_sync(&vss_handle_request_work);
> hvutil_transport_destroy(hvt);
> -   wait_for_completion(&release_event);
> +   if (wait)
> +   wait_for_completion(&release_event);
>  }
> diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c
> index c235a95..05e0648 100644
> --- a/drivers/hv/hv_utils_transport.c
> +++ b/drivers/hv/hv_utils_transport.c
> @@ -153,6 +153,7 @@ static int hvt_op_open(struct inode *inode, struct file
> *file)
> 
> if (issue_reset)
> hvt_reset(hvt);
> +   hvt->dev_opened = (hvt->mode == HVUTIL_TRANSPORT_CHARDEV)
> && !ret;
> 
> mutex_unlock(&hvt->lock);
> 
> @@ -182,6 +183,7 @@ static int hvt_op_release(struct inode *inode, struct
> file *file)
>  * connects back.
>  */
> hvt_reset(hvt);
> +   hvt->dev_opened = false;
> mutex_unlock(&hvt->lock);
> 
> if (mode_old == HVUTIL_TRANSPORT_DESTROY)
> diff --git a/drivers/hv/hv_utils_transport.h b/drivers/hv/hv_utils_transport.h
> index d98f522..9871283 100644
> --- a/drivers/hv/hv_utils_transport.h
> +++ b/drivers/hv/hv_utils_transport.h
> @@ -32,6 +32,7 @@ struct hvutil_transport {
> int mode;   /* hvutil_transport_mode */
> struct file_operations fops;/* file operations */
> struct miscdevice mdev; /* misc device */
> +   bool   dev_opened;  /* Is the device opened? */
> struct cb_id cn_id; /* CN_*_IDX/CN_*_

Re: [Outreachy kernel] Re: [PATCH v2 4/6] staging: fbtft: Fix sparse warnings of incorrect type in assignment

2017-03-04 Thread Alison Schofield
On Thu, Mar 02, 2017 at 02:26:37PM +0100, Noralf Trønnes wrote:
> 
> Den 02.03.2017 14.04, skrev simran singhal:
> >This patch fixes the following sparse warnings:
> >
> >drivers/staging/fbtft/fbtft-bus.c:166:36: warning: incorrect type in 
> >assignment (different base types)
> >drivers/staging/fbtft/fbtft-bus.c:166:36:expected unsigned short 
> >[unsigned] [short] [usertype] 
> >drivers/staging/fbtft/fbtft-bus.c:166:36:got restricted __be16 
> >[usertype] 
> >
> >drivers/staging/fbtft/fbtft-io.c:74:29: warning: incorrect type in 
> >assignment (different base types)
> >drivers/staging/fbtft/fbtft-io.c:74:29:expected unsigned long long 
> >[unsigned] [long] [long long] [usertype] 
> >drivers/staging/fbtft/fbtft-io.c:74:29:got restricted __be64 [usertype] 
> >
> >
> >Signed-off-by: simran singhal 
> >---
> >  v2:
> >-changed commit message
> >
> >  drivers/staging/fbtft/fbtft-bus.c | 2 +-
> >  drivers/staging/fbtft/fbtft-io.c  | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> >diff --git a/drivers/staging/fbtft/fbtft-bus.c 
> >b/drivers/staging/fbtft/fbtft-bus.c
> >index ec45043..df2223e 100644
> >--- a/drivers/staging/fbtft/fbtft-bus.c
> >+++ b/drivers/staging/fbtft/fbtft-bus.c
> >@@ -163,7 +163,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, 
> >size_t offset, size_t len)
> > to_copy, remain - to_copy);
> > for (i = 0; i < to_copy; i++)
> >-txbuf16[i] = cpu_to_be16(vmem16[i]);
> >+txbuf16[i] = vmem16[i];
> 
> This change breaks functionality on little endian machines like
> the Raspberry Pi.
> 
> 
> Noralf.
> 

Hi Simran,

It's probably good to get back to this one while we have Noralf's
attention.

While the change above - in fbtft-bus.c is a problem, the change
below in fbtft-io.c looks ok.  So, compare what you did.  You can't
*not* do the endian conversion.

This is a cleanup change, a cosmetic change.  There is no underlying
bug, so you just need to get the typing correct w/out affecting
behavior.

BTW: I think it's OK to pull this one out and send a v3 of this alone.
That would mean abandoning the patchset and doing them one at a time.
They are all in different drivers anyway.

alisons



> > vmem16 = vmem16 + to_copy;
> > ret = par->fbtftops.write(par, par->txbuf.buf,
> >diff --git a/drivers/staging/fbtft/fbtft-io.c 
> >b/drivers/staging/fbtft/fbtft-io.c
> >index d868405..ffb9a3b 100644
> >--- a/drivers/staging/fbtft/fbtft-io.c
> >+++ b/drivers/staging/fbtft/fbtft-io.c
> >@@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void 
> >*buf, size_t len)
> > src++;
> > }
> > tmp |= ((*src & 0x0100) ? 1 : 0);
> >-*(u64 *)dst = cpu_to_be64(tmp);
> >+*(__be64 *)dst = cpu_to_be64(tmp);
> > dst += 8;
> > *dst++ = (u8)(*src++ & 0x00FF);
> > added++;
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/fe8d6a85-3d4e-8019-937b-22389b942da3%40tronnes.org.
> For more options, visit https://groups.google.com/d/optout.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v4 13/36] [media] v4l2: add a frame timeout event

2017-03-04 Thread Steve Longerbeam



On 03/04/2017 02:56 AM, Sakari Ailus wrote:

Hi Steve,

On Fri, Mar 03, 2017 at 02:43:51PM -0800, Steve Longerbeam wrote:



On 03/03/2017 03:45 AM, Sakari Ailus wrote:

On Thu, Mar 02, 2017 at 03:07:21PM -0800, Steve Longerbeam wrote:



On 03/02/2017 07:53 AM, Sakari Ailus wrote:

Hi Steve,

On Wed, Feb 15, 2017 at 06:19:15PM -0800, Steve Longerbeam wrote:

Add a new FRAME_TIMEOUT event to signal that a video capture or
output device has timed out waiting for reception or transmit
completion of a video frame.

Signed-off-by: Steve Longerbeam 
---
Documentation/media/uapi/v4l/vidioc-dqevent.rst | 5 +
Documentation/media/videodev2.h.rst.exceptions  | 1 +
include/uapi/linux/videodev2.h  | 1 +
3 files changed, 7 insertions(+)

diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst 
b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
index 8d663a7..dd77d9b 100644
--- a/Documentation/media/uapi/v4l/vidioc-dqevent.rst
+++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
@@ -197,6 +197,11 @@ call.
the regions changes. This event has a struct
:c:type:`v4l2_event_motion_det`
associated with it.
+* - ``V4L2_EVENT_FRAME_TIMEOUT``
+  - 7
+  - This event is triggered when the video capture or output device
+   has timed out waiting for the reception or transmit completion of
+   a frame of video.


As you're adding a new interface, I suppose you have an implementation
around. How do you determine what that timeout should be?


The imx-media driver sets the timeout to 1 second, or 30 frame
periods at 30 fps.


The frame rate is not necessarily constant during streaming. It may well
change as a result of lighting conditions.


I think you mean that would be a _temporary_ change in frame rate, but
yes I agree the data rate can temporarily fluctuate. Although I doubt
lighting conditions would cause a sensor to pause data transmission
for a full 1 second.


Likely not, at least not in typical conditions. The exposure time is still
quite specific to applications: it could be minutes if you take photos e.g.
of the night sky.

What I'm saying here is that any static value is likely not both reasonable
and workable in all potential situations all the time. Still there are cases
(as yours below) that may happen in relatively common cases on some hardware
(more common than taking long exposure photos of the night sky with the said
hardware :)).


I doubt night photography will ever be a use-case for i.MX. The most
common use-case for this driver will be used in automotive applications
such as rear-view or 360 degree view cameras.








I wouldn't add an event for this:
this is unreliable and 30 times the frame period is an arbitrary value
anyway. No other drivers do this either.


If no other drivers do this I don't mind removing it. It is really meant
to deal with the ADV718x CVBS decoder, which often simply stops sending
data on the BT.656 bus if there is an interruption in the input analog
signal. But I agree that user space could detect this timeout instead.
Unless I hear from someone else that they would like to keep this
feature I'll remove it in version 5.


That's a bit of a special situation --- still there are alike conditions on
existing hardware. You should return the buffers to the user with the ERROR
flag set --- or return -EIO from VIDIOC_DQBUF, if the condition will
persist:


On i.MX an EOF timeout is not recoverable without a stream restart, so
I decided to call vb2_queue_error() when the timeout occurs (instead
of sending an event). The user will then get -EIO when it attempts to
queue or dequeue further buffers.




https://www.linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/vidioc-qbuf.html>

Do you already obtain the frame rate from the image source (e.g. tuner,
sensor, decoder) and multiply the frame time by some number in the current
implementation?


No the timeout is a constant value, regardless of the source frame
rate. Should the timeout be based on a constant time, or based on a
constant # of frames? I really don't think it matters much, what matters
is that it be long enough to be reasonably sure no data is forthcoming,
for most use-cases.

Steve




Not all sub-device drivers may implement g_frame_interval()
so I'd disable the timeout in that case.


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


Re: [PATCH v5 3/5] staging: lustre: lustre: Remove unnecessary cast on void pointer

2017-03-04 Thread James Simmons

> The following Coccinelle script was used to detect this:
> @r@
> expression x;
> void* e;
> type T;
> identifier f;
> @@
> (
>   *((T *)e)
> |
>   ((T *)x)[...]
> |
>   ((T*)x)->f
> |
> - (T*)
>   e
> )
> 
> Signed-off-by: simran singhal 

Reviewed-by: James Simmons 

> ---
> 
>  v5:
>-Fixed compilation warnings.
> 
>  drivers/staging/lustre/lustre/llite/range_lock.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/range_lock.c 
> b/drivers/staging/lustre/lustre/llite/range_lock.c
> index 14148a0..161391b 100644
> --- a/drivers/staging/lustre/lustre/llite/range_lock.c
> +++ b/drivers/staging/lustre/lustre/llite/range_lock.c
> @@ -174,7 +174,7 @@ void range_unlock(struct range_lock_tree *tree, struct 
> range_lock *lock)
>   */
>  static enum interval_iter range_lock_cb(struct interval_node *node, void 
> *arg)
>  {
> - struct range_lock *lock = (struct range_lock *)arg;
> + struct range_lock *lock = arg;
>   struct range_lock *overlap = node2rangelock(node);
>  
>   lock->rl_blocking_ranges += overlap->rl_lock_count + 1;
> -- 
> 2.7.4
> 
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v5 2/5] staging: lustre: Remove unnecessary cast on void pointer

2017-03-04 Thread James Simmons

> The following Coccinelle script was used to detect this:
> @r@
> expression x;
> void* e;
> type T;
> identifier f;
> @@
> (
>   *((T *)e)
> |
>   ((T *)x)[...]
> |
>   ((T*)x)->f
> |
> - (T*)
>   e
> )
> 
> Signed-off-by: simran singhal 

Reviewed-by: James Simmons 

> ---
>  drivers/staging/lustre/lustre/lmv/lmv_obd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
> b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> index 271e189..09b46924 100644
> --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> @@ -640,7 +640,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, 
> void *karg,
>   int remote_gf_size = 0;
>   int rc;
>  
> - gf = (struct getinfo_fid2path *)karg;
> + gf = karg;
>   tgt = lmv_find_target(lmv, &gf->gf_fid);
>   if (IS_ERR(tgt))
>   return PTR_ERR(tgt);
> @@ -657,7 +657,7 @@ static int lmv_fid2path(struct obd_export *exp, int len, 
> void *karg,
>   struct getinfo_fid2path *ori_gf;
>   char *ptr;
>  
> - ori_gf = (struct getinfo_fid2path *)karg;
> + ori_gf = karg;
>   if (strlen(ori_gf->gf_path) +
>   strlen(gf->gf_path) > ori_gf->gf_pathlen) {
>   rc = -EOVERFLOW;
> -- 
> 2.7.4
> 
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/4] Drivers: hv: util: don't forget to init host_ts.lock

2017-03-04 Thread kys
From: Dexuan Cui 

Without the patch, I always get a "BUG: spinlock bad magic" warning.

Fixes: 3716a49a81ba ("hv_utils: implement Hyper-V PTP source")

Signed-off-by: Dexuan Cui 
Cc: Vitaly Kuznetsov 
Cc: "K. Y. Srinivasan" 
Cc: Haiyang Zhang 
Cc: Stephen Hemminger 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/hv_util.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
index 3042eaa..186b100 100644
--- a/drivers/hv/hv_util.c
+++ b/drivers/hv/hv_util.c
@@ -590,6 +590,8 @@ static int hv_timesync_init(struct hv_util_service *srv)
if (!hyperv_cs)
return -ENODEV;
 
+   spin_lock_init(&host_ts.lock);
+
INIT_WORK(&wrk.work, hv_set_host_time);
 
/*
-- 
1.7.1

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


[PATCH 6/9] hyperv: remove unnecessary return variable

2017-03-04 Thread kys
From: Stephen Hemminger 

hv_ringbuffer_read cleanup.

Signed-off-by: Stephen Hemminger 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/ring_buffer.c |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
index 52d0556..8a24974 100644
--- a/drivers/hv/ring_buffer.c
+++ b/drivers/hv/ring_buffer.c
@@ -341,13 +341,11 @@ int hv_ringbuffer_read(struct vmbus_channel *channel,
struct vmpacket_descriptor desc;
u32 offset;
u32 packetlen;
-   int ret = 0;
struct hv_ring_buffer_info *inring_info = &channel->inbound;
 
if (buflen <= 0)
return -EINVAL;
 
-
*buffer_actual_len = 0;
*requestid = 0;
 
@@ -358,7 +356,7 @@ int hv_ringbuffer_read(struct vmbus_channel *channel,
 * No error is set when there is even no header, drivers are
 * supposed to analyze buffer_actual_len.
 */
-   return ret;
+   return 0;
}
 
init_cached_read_index(channel);
@@ -403,5 +401,5 @@ int hv_ringbuffer_read(struct vmbus_channel *channel,
 
hv_signal_on_read(channel);
 
-   return ret;
+   return 0;
 }
-- 
1.7.1

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


[PATCH 0/9] Drivers: hv: vmbus: Miscellaneous cleanup

2017-03-04 Thread kys
From: K. Y. Srinivasan 

Miscellaneous cleanup.

Stephen Hemminger (9):
  vmbus: only reschedule tasklet if time limit exceeded
  hyperv: fix warning about missing prototype
  vmbus: remove useless return's
  vmbus: remove unnecessary initialization
  vmbus: fix spelling errors
  hyperv: remove unnecessary return variable
  vmbus: make channel_message table constant
  vmbus: cleanup header file style
  vmbus: expose debug info for drivers

 arch/x86/hyperv/hv_init.c |2 +-
 drivers/hv/channel.c  |   10 +++---
 drivers/hv/channel_mgmt.c |   48 
 drivers/hv/connection.c   |   65 +++-
 drivers/hv/hv_balloon.c   |2 -
 drivers/hv/hv_fcopy.c |2 -
 drivers/hv/hv_kvp.c   |   12 +++-
 drivers/hv/hv_snapshot.c  |2 -
 drivers/hv/hyperv_vmbus.h |   29 ++--
 drivers/hv/ring_buffer.c  |   22 +-
 drivers/hv/vmbus_drv.c|4 +--
 include/linux/hyperv.h|   31 -
 12 files changed, 110 insertions(+), 119 deletions(-)

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


[PATCH 4/9] vmbus: remove unnecessary initialization

2017-03-04 Thread kys
From: Stephen Hemminger 

Don't initialize variables that are then set a few lines later.

Signed-off-by: Stephen Hemminger 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/ring_buffer.c |   13 +
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
index d0ff5b4..52d0556 100644
--- a/drivers/hv/ring_buffer.c
+++ b/drivers/hv/ring_buffer.c
@@ -265,14 +265,13 @@ void hv_ringbuffer_cleanup(struct hv_ring_buffer_info 
*ring_info)
 int hv_ringbuffer_write(struct vmbus_channel *channel,
const struct kvec *kv_list, u32 kv_count)
 {
-   int i = 0;
+   int i;
u32 bytes_avail_towrite;
-   u32 totalbytes_towrite = 0;
-
+   u32 totalbytes_towrite = sizeof(u64);
u32 next_write_location;
u32 old_write;
-   u64 prev_indices = 0;
-   unsigned long flags = 0;
+   u64 prev_indices;
+   unsigned long flags;
struct hv_ring_buffer_info *outring_info = &channel->outbound;
 
if (channel->rescind)
@@ -281,8 +280,6 @@ int hv_ringbuffer_write(struct vmbus_channel *channel,
for (i = 0; i < kv_count; i++)
totalbytes_towrite += kv_list[i].iov_len;
 
-   totalbytes_towrite += sizeof(u64);
-
spin_lock_irqsave(&outring_info->ring_lock, flags);
 
bytes_avail_towrite = hv_get_bytes_to_write(outring_info);
@@ -339,7 +336,7 @@ int hv_ringbuffer_read(struct vmbus_channel *channel,
   u64 *requestid, bool raw)
 {
u32 bytes_avail_toread;
-   u32 next_read_location = 0;
+   u32 next_read_location;
u64 prev_indices = 0;
struct vmpacket_descriptor desc;
u32 offset;
-- 
1.7.1

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


[PATCH 2/9] hyperv: fix warning about missing prototype

2017-03-04 Thread kys
From: Stephen Hemminger 

Compiling with warnings enabled finds missing prototype for
hv_do_hypercall.

Signed-off-by: Stephen Hemminger 
Signed-off-by: K. Y. Srinivasan 
---
 arch/x86/hyperv/hv_init.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index db64baf..d4a5f82 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -25,7 +25,7 @@
 #include 
 #include 
 #include 
-
+#include 
 
 #ifdef CONFIG_X86_64
 
-- 
1.7.1

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


[PATCH 7/9] vmbus: make channel_message table constant

2017-03-04 Thread kys
From: Stephen Hemminger 

This table is immutable and should be const.
Cleanup indentation and whitespace for this as well.

Signed-off-by: Stephen Hemminger 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/channel_mgmt.c |   48 ++--
 drivers/hv/hyperv_vmbus.h |2 +-
 drivers/hv/vmbus_drv.c|2 +-
 3 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index bf846d0..fe376af 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -1079,30 +1079,30 @@ static void vmbus_onversion_response(
 }
 
 /* Channel message dispatch table */
-struct vmbus_channel_message_table_entry
-   channel_message_table[CHANNELMSG_COUNT] = {
-   {CHANNELMSG_INVALID,0, NULL},
-   {CHANNELMSG_OFFERCHANNEL,   0, vmbus_onoffer},
-   {CHANNELMSG_RESCIND_CHANNELOFFER,   0, vmbus_onoffer_rescind},
-   {CHANNELMSG_REQUESTOFFERS,  0, NULL},
-   {CHANNELMSG_ALLOFFERS_DELIVERED,1, vmbus_onoffers_delivered},
-   {CHANNELMSG_OPENCHANNEL,0, NULL},
-   {CHANNELMSG_OPENCHANNEL_RESULT, 1, vmbus_onopen_result},
-   {CHANNELMSG_CLOSECHANNEL,   0, NULL},
-   {CHANNELMSG_GPADL_HEADER,   0, NULL},
-   {CHANNELMSG_GPADL_BODY, 0, NULL},
-   {CHANNELMSG_GPADL_CREATED,  1, vmbus_ongpadl_created},
-   {CHANNELMSG_GPADL_TEARDOWN, 0, NULL},
-   {CHANNELMSG_GPADL_TORNDOWN, 1, vmbus_ongpadl_torndown},
-   {CHANNELMSG_RELID_RELEASED, 0, NULL},
-   {CHANNELMSG_INITIATE_CONTACT,   0, NULL},
-   {CHANNELMSG_VERSION_RESPONSE,   1, vmbus_onversion_response},
-   {CHANNELMSG_UNLOAD, 0, NULL},
-   {CHANNELMSG_UNLOAD_RESPONSE,1, vmbus_unload_response},
-   {CHANNELMSG_18, 0, NULL},
-   {CHANNELMSG_19, 0, NULL},
-   {CHANNELMSG_20, 0, NULL},
-   {CHANNELMSG_TL_CONNECT_REQUEST, 0, NULL},
+const struct vmbus_channel_message_table_entry
+channel_message_table[CHANNELMSG_COUNT] = {
+   { CHANNELMSG_INVALID,   0, NULL },
+   { CHANNELMSG_OFFERCHANNEL,  0, vmbus_onoffer },
+   { CHANNELMSG_RESCIND_CHANNELOFFER,  0, vmbus_onoffer_rescind },
+   { CHANNELMSG_REQUESTOFFERS, 0, NULL },
+   { CHANNELMSG_ALLOFFERS_DELIVERED,   1, vmbus_onoffers_delivered },
+   { CHANNELMSG_OPENCHANNEL,   0, NULL },
+   { CHANNELMSG_OPENCHANNEL_RESULT,1, vmbus_onopen_result },
+   { CHANNELMSG_CLOSECHANNEL,  0, NULL },
+   { CHANNELMSG_GPADL_HEADER,  0, NULL },
+   { CHANNELMSG_GPADL_BODY,0, NULL },
+   { CHANNELMSG_GPADL_CREATED, 1, vmbus_ongpadl_created },
+   { CHANNELMSG_GPADL_TEARDOWN,0, NULL },
+   { CHANNELMSG_GPADL_TORNDOWN,1, vmbus_ongpadl_torndown },
+   { CHANNELMSG_RELID_RELEASED,0, NULL },
+   { CHANNELMSG_INITIATE_CONTACT,  0, NULL },
+   { CHANNELMSG_VERSION_RESPONSE,  1, vmbus_onversion_response },
+   { CHANNELMSG_UNLOAD,0, NULL },
+   { CHANNELMSG_UNLOAD_RESPONSE,   1, vmbus_unload_response },
+   { CHANNELMSG_18,0, NULL },
+   { CHANNELMSG_19,0, NULL },
+   { CHANNELMSG_20,0, NULL },
+   { CHANNELMSG_TL_CONNECT_REQUEST,0, NULL },
 };
 
 /*
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 884f83b..b552c3a 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -376,7 +376,7 @@ struct vmbus_channel_message_table_entry {
void (*message_handler)(struct vmbus_channel_message_header *msg);
 };
 
-extern struct vmbus_channel_message_table_entry
+extern const struct vmbus_channel_message_table_entry
channel_message_table[CHANNELMSG_COUNT];
 
 
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 9ddbf4d..7fe8ef3 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -851,7 +851,7 @@ void vmbus_on_msg_dpc(unsigned long data)
struct hv_message *msg = (struct hv_message *)page_addr +
  VMBUS_MESSAGE_SINT;
struct vmbus_channel_message_header *hdr;
-   struct vmbus_channel_message_table_entry *entry;
+   const struct vmbus_channel_message_table_entry *entry;
struct onmessage_work_context *ctx;
u32 message_type = msg->header.message_type;
 
-- 
1.7.1

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


[PATCH 1/9] vmbus: only reschedule tasklet if time limit exceeded

2017-03-04 Thread kys
From: Stephen Hemminger 

The change to reschedule tasklet if more data arrives in ring buffer
can cause performance regression if host timing is such that the
next response happens in small window.

Go back to a modified version of the original looping behavior.
If the race occurs in a small time, then loop. But if the tasklet
has been running for a long interval due to flood, then reschedule
the tasklet to allow migration to ksoftirqd.

Signed-off-by: Stephen Hemminger 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/connection.c |   65 --
 1 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index a8366fe..fce27fb 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -296,44 +296,47 @@ struct vmbus_channel *relid2channel(u32 relid)
 
 /*
  * vmbus_on_event - Process a channel event notification
+ *
+ * For batched channels (default) optimize host to guest signaling
+ * by ensuring:
+ * 1. While reading the channel, we disable interrupts from host.
+ * 2. Ensure that we process all posted messages from the host
+ *before returning from this callback.
+ * 3. Once we return, enable signaling from the host. Once this
+ *state is set we check to see if additional packets are
+ *available to read. In this case we repeat the process.
+ *If this tasklet has been running for a long time
+ *then reschedule ourselves.
  */
 void vmbus_on_event(unsigned long data)
 {
struct vmbus_channel *channel = (void *) data;
-   void (*callback_fn)(void *);
+   unsigned long time_limit = jiffies + 2;
 
-   /*
-* A channel once created is persistent even when there
-* is no driver handling the device. An unloading driver
-* sets the onchannel_callback to NULL on the same CPU
-* as where this interrupt is handled (in an interrupt context).
-* Thus, checking and invoking the driver specific callback takes
-* care of orderly unloading of the driver.
-*/
-   callback_fn = READ_ONCE(channel->onchannel_callback);
-   if (unlikely(callback_fn == NULL))
-   return;
-
-   (*callback_fn)(channel->channel_callback_context);
-
-   if (channel->callback_mode == HV_CALL_BATCHED) {
-   /*
-* This callback reads the messages sent by the host.
-* We can optimize host to guest signaling by ensuring:
-* 1. While reading the channel, we disable interrupts from
-*host.
-* 2. Ensure that we process all posted messages from the host
-*before returning from this callback.
-* 3. Once we return, enable signaling from the host. Once this
-*state is set we check to see if additional packets are
-*available to read. In this case we repeat the process.
+   do {
+   void (*callback_fn)(void *);
+
+   /* A channel once created is persistent even when
+* there is no driver handling the device. An
+* unloading driver sets the onchannel_callback to NULL.
 */
-   if (hv_end_read(&channel->inbound) != 0) {
-   hv_begin_read(&channel->inbound);
+   callback_fn = READ_ONCE(channel->onchannel_callback);
+   if (unlikely(callback_fn == NULL))
+   return;
 
-   tasklet_schedule(&channel->callback_event);
-   }
-   }
+   (*callback_fn)(channel->channel_callback_context);
+
+   if (channel->callback_mode != HV_CALL_BATCHED)
+   return;
+
+   if (likely(hv_end_read(&channel->inbound) == 0))
+   return;
+
+   hv_begin_read(&channel->inbound);
+   } while (likely(time_before(jiffies, time_limit)));
+
+   /* The time limit (2 jiffies) has been reached */
+   tasklet_schedule(&channel->callback_event);
 }
 
 /*
-- 
1.7.1

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


[PATCH 5/9] vmbus: fix spelling errors

2017-03-04 Thread kys
From: Stephen Hemminger 

Several spelling errors in comments

Signed-off-by: Stephen Hemminger 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/channel.c |   10 +-
 drivers/hv/hv_kvp.c  |   10 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index a5f4c43..54075ac 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -333,7 +333,7 @@ static int create_gpadl_header(void *kbuffer, u32 size,
 * Gpadl is u32 and we are using a pointer which could
 * be 64-bit
 * This is governed by the guest/host protocol and
-* so the hypervisor gurantees that this is ok.
+* so the hypervisor guarantees that this is ok.
 */
for (i = 0; i < pfncurr; i++)
gpadl_body->pfn[i] = slow_virt_to_phys(
@@ -380,7 +380,7 @@ static int create_gpadl_header(void *kbuffer, u32 size,
 }
 
 /*
- * vmbus_establish_gpadl - Estabish a GPADL for the specified buffer
+ * vmbus_establish_gpadl - Establish a GPADL for the specified buffer
  *
  * @channel: a channel
  * @kbuffer: from kmalloc or vmalloc
@@ -728,7 +728,7 @@ int vmbus_sendpacket_pagebuffer_ctl(struct vmbus_channel 
*channel,
/* Setup the descriptor */
desc.type = VM_PKT_DATA_USING_GPA_DIRECT;
desc.flags = flags;
-   desc.dataoffset8 = descsize >> 3; /* in 8-bytes grandularity */
+   desc.dataoffset8 = descsize >> 3; /* in 8-bytes granularity */
desc.length8 = (u16)(packetlen_aligned >> 3);
desc.transactionid = requestid;
desc.rangecount = pagecount;
@@ -789,7 +789,7 @@ int vmbus_sendpacket_mpb_desc(struct vmbus_channel *channel,
/* Setup the descriptor */
desc->type = VM_PKT_DATA_USING_GPA_DIRECT;
desc->flags = VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED;
-   desc->dataoffset8 = desc_size >> 3; /* in 8-bytes grandularity */
+   desc->dataoffset8 = desc_size >> 3; /* in 8-bytes granularity */
desc->length8 = (u16)(packetlen_aligned >> 3);
desc->transactionid = requestid;
desc->rangecount = 1;
@@ -839,7 +839,7 @@ int vmbus_sendpacket_multipagebuffer(struct vmbus_channel 
*channel,
/* Setup the descriptor */
desc.type = VM_PKT_DATA_USING_GPA_DIRECT;
desc.flags = VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED;
-   desc.dataoffset8 = descsize >> 3; /* in 8-bytes grandularity */
+   desc.dataoffset8 = descsize >> 3; /* in 8-bytes granularity */
desc.length8 = (u16)(packetlen_aligned >> 3);
desc.transactionid = requestid;
desc.rangecount = 1;
diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
index d3979a6..e99ff2d 100644
--- a/drivers/hv/hv_kvp.c
+++ b/drivers/hv/hv_kvp.c
@@ -69,7 +69,7 @@
  *
  * While the request/response protocol is guaranteed by the host, we further
  * ensure this by serializing packet processing in this driver - we do not
- * read additional packets from the VMBUs until the current packet is fully
+ * read additional packets from the VMBUS until the current packet is fully
  * handled.
  */
 
@@ -397,7 +397,7 @@ static void process_ib_ipinfo(void *in_msg, void *out_msg, 
int op)
 * the max lengths specified. We will however, reserve room
 * for the string terminating character - in the utf16s_utf8s()
 * function we limit the size of the buffer where the converted
-* string is placed to HV_KVP_EXCHANGE_MAX_*_SIZE -1 to gaurantee
+* string is placed to HV_KVP_EXCHANGE_MAX_*_SIZE -1 to guarantee
 * that the strings can be properly terminated!
 */
 
@@ -531,7 +531,7 @@ static void process_ib_ipinfo(void *in_msg, void *out_msg, 
int op)
 */
if (error) {
/*
-* Something failed or we have timedout;
+* Something failed or we have timed out;
 * terminate the current host-side iteration.
 */
goto response_done;
@@ -605,8 +605,8 @@ static void process_ib_ipinfo(void *in_msg, void *out_msg, 
int op)
  * This callback is invoked when we get a KVP message from the host.
  * The host ensures that only one KVP transaction can be active at a time.
  * KVP implementation in Linux needs to forward the key to a user-mde
- * component to retrive the corresponding value. Consequently, we cannot
- * respond to the host in the conext of this callback. Since the host
+ * component to retrieve the corresponding value. Consequently, we cannot
+ * respond to the host in the context of this callback. Since the host
  * guarantees that at most only one transaction can be active at a time,
  * we stash away the transaction state in a set of global variables.
  */
-- 
1.7.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverd

[PATCH 8/9] vmbus: cleanup header file style

2017-03-04 Thread kys
From: Stephen Hemminger 

Minor changes to align hyper-v vmbus include files with current
linux kernel style.

Signed-off-by: Stephen Hemminger 
Signed-off-by: K. Y. Srinivasan 
---
 drivers/hv/hyperv_vmbus.h |   16 
 include/linux/hyperv.h|   12 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index b552c3a..a69b52d 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -218,8 +218,8 @@ struct hv_per_cpu_context {
 
 struct hv_context {
/* We only support running on top of Hyper-V
-   * So at this point this really can only contain the Hyper-V ID
-   */
+* So at this point this really can only contain the Hyper-V ID
+*/
u64 guestid;
 
void *tsc_page;
@@ -403,17 +403,17 @@ struct hv_device *vmbus_device_create(const uuid_le *type,
 void vmbus_on_event(unsigned long data);
 void vmbus_on_msg_dpc(unsigned long data);
 
-int hv_kvp_init(struct hv_util_service *);
+int hv_kvp_init(struct hv_util_service *srv);
 void hv_kvp_deinit(void);
-void hv_kvp_onchannelcallback(void *);
+void hv_kvp_onchannelcallback(void *context);
 
-int hv_vss_init(struct hv_util_service *);
+int hv_vss_init(struct hv_util_service *srv);
 void hv_vss_deinit(void);
-void hv_vss_onchannelcallback(void *);
+void hv_vss_onchannelcallback(void *context);
 
-int hv_fcopy_init(struct hv_util_service *);
+int hv_fcopy_init(struct hv_util_service *srv);
 void hv_fcopy_deinit(void);
-void hv_fcopy_onchannelcallback(void *);
+void hv_fcopy_onchannelcallback(void *context);
 void vmbus_initiate_unload(bool crash);
 
 static inline void hv_poll_channel(struct vmbus_channel *channel,
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index ee14f23..02f5d76 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -524,10 +524,10 @@ struct vmbus_channel_open_channel {
u32 target_vp;
 
/*
-   * The upstream ring buffer begins at offset zero in the memory
-   * described by RingBufferGpadlHandle. The downstream ring buffer
-   * follows it at this offset (in pages).
-   */
+* The upstream ring buffer begins at offset zero in the memory
+* described by RingBufferGpadlHandle. The downstream ring buffer
+* follows it at this offset (in pages).
+*/
u32 downstream_ringbuffer_pageoffset;
 
/* User-specific data to be passed along to the server endpoint. */
@@ -1013,7 +1013,7 @@ extern int vmbus_open(struct vmbus_channel *channel,
u32 recv_ringbuffersize,
void *userdata,
u32 userdatalen,
-   void(*onchannel_callback)(void *context),
+   void (*onchannel_callback)(void *context),
void *context);
 
 extern void vmbus_close(struct vmbus_channel *channel);
@@ -1428,7 +1428,7 @@ struct hyperv_service_callback {
char *log_msg;
uuid_le data;
struct vmbus_channel *channel;
-   void (*callback) (void *context);
+   void (*callback)(void *context);
 };
 
 #define MAX_SRV_VER0x7ff
-- 
1.7.1

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


Re: [Outreachy kernel] Re: [PATCH v2 4/6] staging: fbtft: Fix sparse warnings of incorrect type in assignment

2017-03-04 Thread SIMRAN SINGHAL
On Sun, Mar 5, 2017 at 5:36 AM, Alison Schofield  wrote:
> On Thu, Mar 02, 2017 at 02:26:37PM +0100, Noralf Trønnes wrote:
>>
>> Den 02.03.2017 14.04, skrev simran singhal:
>> >This patch fixes the following sparse warnings:
>> >
>> >drivers/staging/fbtft/fbtft-bus.c:166:36: warning: incorrect type in 
>> >assignment (different base types)
>> >drivers/staging/fbtft/fbtft-bus.c:166:36:expected unsigned short 
>> >[unsigned] [short] [usertype] 
>> >drivers/staging/fbtft/fbtft-bus.c:166:36:got restricted __be16 
>> >[usertype] 
>> >
>> >drivers/staging/fbtft/fbtft-io.c:74:29: warning: incorrect type in 
>> >assignment (different base types)
>> >drivers/staging/fbtft/fbtft-io.c:74:29:expected unsigned long long 
>> >[unsigned] [long] [long long] [usertype] 
>> >drivers/staging/fbtft/fbtft-io.c:74:29:got restricted __be64 [usertype] 
>> >
>> >
>> >Signed-off-by: simran singhal 
>> >---
>> >  v2:
>> >-changed commit message
>> >
>> >  drivers/staging/fbtft/fbtft-bus.c | 2 +-
>> >  drivers/staging/fbtft/fbtft-io.c  | 2 +-
>> >  2 files changed, 2 insertions(+), 2 deletions(-)
>> >
>> >diff --git a/drivers/staging/fbtft/fbtft-bus.c 
>> >b/drivers/staging/fbtft/fbtft-bus.c
>> >index ec45043..df2223e 100644
>> >--- a/drivers/staging/fbtft/fbtft-bus.c
>> >+++ b/drivers/staging/fbtft/fbtft-bus.c
>> >@@ -163,7 +163,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, 
>> >size_t offset, size_t len)
>> > to_copy, remain - to_copy);
>> > for (i = 0; i < to_copy; i++)
>> >-txbuf16[i] = cpu_to_be16(vmem16[i]);
>> >+txbuf16[i] = vmem16[i];
>>
>> This change breaks functionality on little endian machines like
>> the Raspberry Pi.
>>
>>
>> Noralf.
>>
>
> Hi Simran,
>
> It's probably good to get back to this one while we have Noralf's
> attention.
>
> While the change above - in fbtft-bus.c is a problem, the change
> below in fbtft-io.c looks ok.  So, compare what you did.  You can't
> *not* do the endian conversion.
>
> This is a cleanup change, a cosmetic change.  There is no underlying
> bug, so you just need to get the typing correct w/out affecting
> behavior.
> anyway.
>
> BTW: I think it's OK to pull this one out and send a v3 of this alone.
> That would mean abandoning the patchset and doing them one at a time.
> They are all in different drivers

Hi alison,

Thanks for the explaination.

I will drop the changes I did in fbtft-bus.c and send a v3 of this alone.

Can you please suggest me any source through which I can understand the
concept of endianess. As right know I didn't understand it, I just
tried to fix the
warnings which I got through sparse and as you can see most of the fixes are
wrong.

Thanks!
Simran



> alisons

>
>
>
>> > vmem16 = vmem16 + to_copy;
>> > ret = par->fbtftops.write(par, par->txbuf.buf,
>> >diff --git a/drivers/staging/fbtft/fbtft-io.c 
>> >b/drivers/staging/fbtft/fbtft-io.c
>> >index d868405..ffb9a3b 100644
>> >--- a/drivers/staging/fbtft/fbtft-io.c
>> >+++ b/drivers/staging/fbtft/fbtft-io.c
>> >@@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void 
>> >*buf, size_t len)
>> > src++;
>> > }
>> > tmp |= ((*src & 0x0100) ? 1 : 0);
>> >-*(u64 *)dst = cpu_to_be64(tmp);
>> >+*(__be64 *)dst = cpu_to_be64(tmp);
>> > dst += 8;
>> > *dst++ = (u8)(*src++ & 0x00FF);
>> > added++;
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to outreachy-kernel+unsubscr...@googlegroups.com.
>> To post to this group, send email to outreachy-ker...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/outreachy-kernel/fe8d6a85-3d4e-8019-937b-22389b942da3%40tronnes.org.
>> For more options, visit https://groups.google.com/d/optout.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] Re: [PATCH v2 4/6] staging: fbtft: Fix sparse warnings of incorrect type in assignment

2017-03-04 Thread Vaishali Thakkar
On Sun, Mar 5, 2017 at 10:10 AM, SIMRAN SINGHAL
 wrote:
> On Sun, Mar 5, 2017 at 5:36 AM, Alison Schofield  wrote:
>> On Thu, Mar 02, 2017 at 02:26:37PM +0100, Noralf Trønnes wrote:
>>>
>>> Den 02.03.2017 14.04, skrev simran singhal:
>>> >This patch fixes the following sparse warnings:
>>> >
>>> >drivers/staging/fbtft/fbtft-bus.c:166:36: warning: incorrect type in 
>>> >assignment (different base types)
>>> >drivers/staging/fbtft/fbtft-bus.c:166:36:expected unsigned short 
>>> >[unsigned] [short] [usertype] 
>>> >drivers/staging/fbtft/fbtft-bus.c:166:36:got restricted __be16 
>>> >[usertype] 
>>> >
>>> >drivers/staging/fbtft/fbtft-io.c:74:29: warning: incorrect type in 
>>> >assignment (different base types)
>>> >drivers/staging/fbtft/fbtft-io.c:74:29:expected unsigned long long 
>>> >[unsigned] [long] [long long] [usertype] 
>>> >drivers/staging/fbtft/fbtft-io.c:74:29:got restricted __be64 
>>> >[usertype] 
>>> >
>>> >Signed-off-by: simran singhal 
>>> >---
>>> >  v2:
>>> >-changed commit message
>>> >
>>> >  drivers/staging/fbtft/fbtft-bus.c | 2 +-
>>> >  drivers/staging/fbtft/fbtft-io.c  | 2 +-
>>> >  2 files changed, 2 insertions(+), 2 deletions(-)
>>> >
>>> >diff --git a/drivers/staging/fbtft/fbtft-bus.c 
>>> >b/drivers/staging/fbtft/fbtft-bus.c
>>> >index ec45043..df2223e 100644
>>> >--- a/drivers/staging/fbtft/fbtft-bus.c
>>> >+++ b/drivers/staging/fbtft/fbtft-bus.c
>>> >@@ -163,7 +163,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, 
>>> >size_t offset, size_t len)
>>> > to_copy, remain - to_copy);
>>> > for (i = 0; i < to_copy; i++)
>>> >-txbuf16[i] = cpu_to_be16(vmem16[i]);
>>> >+txbuf16[i] = vmem16[i];
>>>
>>> This change breaks functionality on little endian machines like
>>> the Raspberry Pi.
>>>
>>>
>>> Noralf.
>>>
>>
>> Hi Simran,
>>
>> It's probably good to get back to this one while we have Noralf's
>> attention.
>>
>> While the change above - in fbtft-bus.c is a problem, the change
>> below in fbtft-io.c looks ok.  So, compare what you did.  You can't
>> *not* do the endian conversion.
>>
>> This is a cleanup change, a cosmetic change.  There is no underlying
>> bug, so you just need to get the typing correct w/out affecting
>> behavior.
>> anyway.
>>
>> BTW: I think it's OK to pull this one out and send a v3 of this alone.
>> That would mean abandoning the patchset and doing them one at a time.
>> They are all in different drivers
>
> Hi alison,
>
> Thanks for the explaination.
>
> I will drop the changes I did in fbtft-bus.c and send a v3 of this alone.
>
> Can you please suggest me any source through which I can understand the
> concept of endianess. As right know I didn't understand it, I just
> tried to fix the
> warnings which I got through sparse and as you can see most of the fixes are
> wrong.
>
> Thanks!
> Simran
>

Hi Simran,

I would suggest to have a look at thie LWN article[1]. It is pretty old
article but explains very well on the concept of why these annotations
[__le16, __le32 etc] were introduced at first place and how Sparse
gives warnings based on these annotations.

In addition, you should look at the definitions of byte ordering macros.
For example, in this example we have 'cpu_to_be64' then you can go
and look at the definition of that macro see where they are used and
why they are used in the first place.

Thanks.

[1] https://lwn.net/Articles/205624/

>
>> alisons
>
>>
>>
>>
>>> > vmem16 = vmem16 + to_copy;
>>> > ret = par->fbtftops.write(par, par->txbuf.buf,
>>> >diff --git a/drivers/staging/fbtft/fbtft-io.c 
>>> >b/drivers/staging/fbtft/fbtft-io.c
>>> >index d868405..ffb9a3b 100644
>>> >--- a/drivers/staging/fbtft/fbtft-io.c
>>> >+++ b/drivers/staging/fbtft/fbtft-io.c
>>> >@@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, 
>>> >void *buf, size_t len)
>>> > src++;
>>> > }
>>> > tmp |= ((*src & 0x0100) ? 1 : 0);
>>> >-*(u64 *)dst = cpu_to_be64(tmp);
>>> >+*(__be64 *)dst = cpu_to_be64(tmp);
>>> > dst += 8;
>>> > *dst++ = (u8)(*src++ & 0x00FF);
>>> > added++;
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "outreachy-kernel" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to outreachy-kernel+unsubscr...@googlegroups.com.
>>> To post to this group, send email to outreachy-ker...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/outreachy-kernel/fe8d6a85-3d4e-8019-937b-22389b942da3%40tronnes.org.
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ou

[PATCH v3 4/6] staging: fbtft: Fix sparse warnings of incorrect type in assignment

2017-03-04 Thread simran singhal
This patch fixes the following sparse warnings:

drivers/staging/fbtft/fbtft-io.c:74:29: warning: incorrect type in assignment 
(different base types)
drivers/staging/fbtft/fbtft-io.c:74:29:expected unsigned long long 
[unsigned] [long] [long long] [usertype] 
drivers/staging/fbtft/fbtft-io.c:74:29:got restricted __be64 [usertype] 


Signed-off-by: simran singhal 
---
 
 v3:
   -Change commit message
   -Drop the changes did in fbtft-bus.c
  
 drivers/staging/fbtft/fbtft-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c
index d868405..ffb9a3b 100644
--- a/drivers/staging/fbtft/fbtft-io.c
+++ b/drivers/staging/fbtft/fbtft-io.c
@@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void 
*buf, size_t len)
src++;
}
tmp |= ((*src & 0x0100) ? 1 : 0);
-   *(u64 *)dst = cpu_to_be64(tmp);
+   *(__be64 *)dst = cpu_to_be64(tmp);
dst += 8;
*dst++ = (u8)(*src++ & 0x00FF);
added++;
-- 
2.7.4

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


[PATCH] staging: vc04_services: open brace code style fix

2017-03-04 Thread Sergiy Redko
This fixes an error found by checkpatch about the open
brace not being on the same line as if statement.
It also adds a missing blank like to fix another
 checkpatch warning.

Signed-off-by: Sergiy Redko 
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c 
b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c
index 48984abc3854..8ee6b1956d61 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c
@@ -797,8 +797,8 @@ int32_t vchi_get_peer_version(const VCHI_SERVICE_HANDLE_T 
handle, short *peer_ve
 {
int32_t ret = -1;
SHIM_SERVICE_T *service = (SHIM_SERVICE_T *)handle;
-   if (service)
-   {
+
+   if (service) {
VCHIQ_STATUS_T status;
 
status = vchiq_get_peer_version(service->handle, peer_version);
-- 
2.12.0

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


Re: [Outreachy kernel] [PATCH v3 4/6] staging: fbtft: Fix sparse warnings of incorrect type in assignment

2017-03-04 Thread Alison Schofield
On Sun, Mar 05, 2017 at 10:35:33AM +0530, simran singhal wrote:
> This patch fixes the following sparse warnings:
> 
> drivers/staging/fbtft/fbtft-io.c:74:29: warning: incorrect type in assignment 
> (different base types)
> drivers/staging/fbtft/fbtft-io.c:74:29:expected unsigned long long 
> [unsigned] [long] [long long] [usertype] 
> drivers/staging/fbtft/fbtft-io.c:74:29:got restricted __be64 [usertype] 
> 
> 
> Signed-off-by: simran singhal 
> ---
>  
>  v3:
>-Change commit message
>-Drop the changes did in fbtft-bus.c

Hi Simran, 

Sorry, I didn't mean to drop the broken part of fbtft, but rather to fix it.

Let's tidy up a few things:
- we can't send out one patch labelled as part of a patchset without
  resending the entire set.  That's why I was suggesting just abandoning
  the patchset, and beginning to rework this anew with only the fbtft
  driver in a single patch.
- I suggest keeping the -bus and -io file changes together.
- Look to correct what is wrong with fbtft-bus.c before sending a new
  patch.
- Patch Subject would be something like: use __be64 types for endian
  correctness (if this is what you end up doing - hint)

So, next step,
1) read up on endianess and propose how to change -bus.c.
   OK to check that idea/code snippet here without re-rolling the patch.

   https://kernelnewbies.org/EndianIssues
   and Vaishali also gave a good link to lwn.net article
   and to see some example fixes (in iio subsystem) do this:
git log --pretty=oneline --abbrev-commit | grep iio | grep endian


2) build the patch.  At this point I say make it a first version and
   start totally fresh.  However, below the line --- where you usually
   put the version comments, you can add a comment stating that this
   was previously part of a patchset, but is now a single patch.
  
alisons


>   
>  drivers/staging/fbtft/fbtft-io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft-io.c 
> b/drivers/staging/fbtft/fbtft-io.c
> index d868405..ffb9a3b 100644
> --- a/drivers/staging/fbtft/fbtft-io.c
> +++ b/drivers/staging/fbtft/fbtft-io.c
> @@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void 
> *buf, size_t len)
>   src++;
>   }
>   tmp |= ((*src & 0x0100) ? 1 : 0);
> - *(u64 *)dst = cpu_to_be64(tmp);
> + *(__be64 *)dst = cpu_to_be64(tmp);
>   dst += 8;
>   *dst++ = (u8)(*src++ & 0x00FF);
>   added++;
> -- 
> 2.7.4
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/20170305050533.GA10169%40singhal-Inspiron-5558.
> For more options, visit https://groups.google.com/d/optout.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: media: Remove unnecessary function and its call

2017-03-04 Thread simran singhal
The function atomisp_set_stop_timeout on being called, simply returns
back. The function hasn't been mentioned in the TODO and doesn't have
FIXME code around. Hence, atomisp_set_stop_timeout and its calls have been
removed.

Signed-off-by: simran singhal 
---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c  | 1 -
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h   | 1 -
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c | 5 -
 3 files changed, 7 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index e99f7b8..66299dd 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -1700,7 +1700,6 @@ void atomisp_wdt_work(struct work_struct *work)
}
}
 #endif
-   atomisp_set_stop_timeout(ATOMISP_CSS_STOP_TIMEOUT_US);
dev_err(isp->dev, "timeout recovery handling done\n");
atomic_set(&isp->wdt_work_queued, 0);
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h
index 5a404e4..0b9ced5 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h
@@ -660,7 +660,6 @@ int atomisp_css_set_acc_parameters(struct atomisp_acc_fw 
*acc_fw);
 int atomisp_css_isr_thread(struct atomisp_device *isp,
   bool *frame_done_found,
   bool *css_pipe_done);
-void atomisp_set_stop_timeout(unsigned int timeout);
 
 bool atomisp_css_valid_sof(struct atomisp_device *isp);
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c 
b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
index 6697d72..cfa0ad4 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
@@ -4699,11 +4699,6 @@ int atomisp_css_isr_thread(struct atomisp_device *isp,
return 0;
 }
 
-void atomisp_set_stop_timeout(unsigned int timeout)
-{
-   return;
-}
-
 bool atomisp_css_valid_sof(struct atomisp_device *isp)
 {
unsigned int i, j;
-- 
2.7.4

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


[PATCH] Staging: iio: addac - fixed octal file permissions

2017-03-04 Thread Derek Robson
Changed file permission to octal style.
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/iio/addac/adt7316.c | 108 ++--
 1 file changed, 54 insertions(+), 54 deletions(-)

diff --git a/drivers/staging/iio/addac/adt7316.c 
b/drivers/staging/iio/addac/adt7316.c
index 6054c7298fce..aa251c245981 100644
--- a/drivers/staging/iio/addac/adt7316.c
+++ b/drivers/staging/iio/addac/adt7316.c
@@ -267,7 +267,7 @@ static ssize_t adt7316_store_enabled(struct device *dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(enabled, 0644,
adt7316_show_enabled,
adt7316_store_enabled,
0);
@@ -311,7 +311,7 @@ static ssize_t adt7316_store_select_ex_temp(struct device 
*dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(select_ex_temp, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(select_ex_temp, 0644,
adt7316_show_select_ex_temp,
adt7316_store_select_ex_temp,
0);
@@ -352,7 +352,7 @@ static ssize_t adt7316_store_mode(struct device *dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(mode, 0644,
adt7316_show_mode,
adt7316_store_mode,
0);
@@ -364,7 +364,7 @@ static ssize_t adt7316_show_all_modes(struct device *dev,
return sprintf(buf, "single_channel\nround_robin\n");
 }
 
-static IIO_DEVICE_ATTR(all_modes, S_IRUGO, adt7316_show_all_modes, NULL, 0);
+static IIO_DEVICE_ATTR(all_modes, 0444, adt7316_show_all_modes, NULL, 0);
 
 static ssize_t adt7316_show_ad_channel(struct device *dev,
struct device_attribute *attr,
@@ -446,7 +446,7 @@ static ssize_t adt7316_store_ad_channel(struct device *dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(ad_channel, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(ad_channel, 0644,
adt7316_show_ad_channel,
adt7316_store_ad_channel,
0);
@@ -469,7 +469,7 @@ static ssize_t adt7316_show_all_ad_channels(struct device 
*dev,
"2 - External Temperature\n");
 }
 
-static IIO_DEVICE_ATTR(all_ad_channels, S_IRUGO,
+static IIO_DEVICE_ATTR(all_ad_channels, 0444,
adt7316_show_all_ad_channels, NULL, 0);
 
 static ssize_t adt7316_show_disable_averaging(struct device *dev,
@@ -506,7 +506,7 @@ static ssize_t adt7316_store_disable_averaging(struct 
device *dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(disable_averaging, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(disable_averaging, 0644,
adt7316_show_disable_averaging,
adt7316_store_disable_averaging,
0);
@@ -545,7 +545,7 @@ static ssize_t adt7316_store_enable_smbus_timeout(struct 
device *dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(enable_smbus_timeout, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(enable_smbus_timeout, 0644,
adt7316_show_enable_smbus_timeout,
adt7316_store_enable_smbus_timeout,
0);
@@ -583,7 +583,7 @@ static ssize_t adt7316_store_powerdown(struct device *dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(powerdown, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(powerdown, 0644,
adt7316_show_powerdown,
adt7316_store_powerdown,
0);
@@ -621,7 +621,7 @@ static ssize_t adt7316_store_fast_ad_clock(struct device 
*dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(fast_ad_clock, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(fast_ad_clock, 0644,
adt7316_show_fast_ad_clock,
adt7316_store_fast_ad_clock,
0);
@@ -674,7 +674,7 @@ static ssize_t adt7316_store_da_high_resolution(struct 
device *dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(da_high_resolution, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(da_high_resolution, 0644,
adt7316_show_da_high_resolution,
adt7316_store_da_high_resolution,
0);
@@ -720,7 +720,7 @@ static ssize_t adt7316_store_AIN_internal_Vref(struct 
device *dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(AIN_internal_Vref, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(AIN_internal_Vref, 0644,
adt7316_show_AIN_internal_Vref,
adt7316_store_AIN_internal_Vref,
0);
@@ -760,7 +760,7 @@ static ssize_t adt7316_store_enable_prop_DACA(struct device 
*dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(enable_proportion_DACA, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(enable_proportion_DACA, 0644,
adt7316_show_enable_prop_DACA,
adt7316_store_enable_prop_DACA,
0);
@@ -799,7 +799,7 @@ static ssize_t adt7316_store_enable_prop_DACB(struct device 
*dev,
return len;
 }
 
-static IIO_DEVICE_ATTR(enable_proportion_DACB, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(enable_proportion_DACB, 0644,
  

[PATCH] staging: rtl8192u: Fix sparse warnings in r8192U_dm.c

2017-03-04 Thread Matthieu Simon
Fix these warnings:
drivers/staging//rtl8192u/r8192U_dm.c:2307:49: warning: cast from restricted 
__le16
drivers/staging//rtl8192u/r8192U_dm.c:2308:44: warning: cast from restricted 
__le16
drivers/staging//rtl8192u/r8192U_dm.c:2309:44: warning: cast from restricted 
__le16

Signed-off-by: Matthieu Simon 
---
 drivers/staging/rtl8192u/r8192U_dm.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c 
b/drivers/staging/rtl8192u/r8192U_dm.c
index 9209aad0515e..5a07e7e71549 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -2304,10 +2304,10 @@ static void dm_check_edca_turbo(
/*  For Each time updating EDCA parameter, 
reset EDCA turbo mode status. */
dm_init_edca_turbo(dev);
u1bAIFS = qos_parameters->aifs[0] * 
((mode&(IEEE_G|IEEE_N_24G)) ? 9 : 20) + aSifsTime;
-   u4bAcParam = 
(((u32)(qos_parameters->tx_op_limit[0])) << AC_PARAM_TXOP_LIMIT_OFFSET)|
-   (((u32)(qos_parameters->cw_max[0])) << 
AC_PARAM_ECW_MAX_OFFSET)|
-   (((u32)(qos_parameters->cw_min[0])) << 
AC_PARAM_ECW_MIN_OFFSET)|
-   ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET);
+   u4bAcParam = 
(((le16_to_cpu(qos_parameters->tx_op_limit[0])) << AC_PARAM_TXOP_LIMIT_OFFSET)|
+   
((le16_to_cpu(qos_parameters->cw_max[0])) << AC_PARAM_ECW_MAX_OFFSET)|
+   
((le16_to_cpu(qos_parameters->cw_min[0])) << AC_PARAM_ECW_MIN_OFFSET)|
+   ((u32)u1bAIFS << AC_PARAM_AIFS_OFFSET));
/*write_nic_dword(dev, WDCAPARA_ADD[i], 
u4bAcParam);*/
write_nic_dword(dev, EDCAPARA_BE,  u4bAcParam);
 
-- 
Matthieu

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