Re: [PATCH 00/36] staging: unisys: additional code cleanups
On Fri, Mar 17, 2017 at 11:26:51AM -0400, David Kershner wrote: > This series cleans up several different checkpatch, sparse and other > miscellaneous code issues found throughout the Unisys s-Par driver stack. > It also cleans up the comments surrounding #defines. > > Note: Acceptence of this patch series determines whether or not the team > will partake in a soft, sweet food made from a mixture of flour, shortening, > eggs, sugar and other ingredients, baked and often decorated. Though some > would suggest that it is a lie. What, none for me? Ugh, oh well... now all applied, go have your party without us... {sniff} greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH staging/speakup v3 0/3] cleanup error and initilization
Changelog from v2: Fixed the message subject line. Changelog from v1: 1. fixed kbuild warning for i386 build as reported by kbuild robot 2. split initialization code in two patches. Pranay Kr. Srivastava (3): return same error value from spk_set_key_info remove unecessary initial allocation of vc use speakup_allocate as per required context drivers/staging/speakup/main.c | 46 +- 1 file changed, 23 insertions(+), 23 deletions(-) -- 2.10.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH staging/speakup v3 2/3] remove unnecessary initial allocation of vc
This patch removes the unnecessary allocation of current foreground vc during initialization. This initialization is already handled in the loop that follows it for all available virtual consoles. Signed-off-by: Pranay Kr. Srivastava Reviewed-by: Samuel Thibault --- drivers/staging/speakup/main.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index a1d5b66..ca817ca 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -2317,7 +2317,6 @@ static int __init speakup_init(void) { int i; long err = 0; - struct st_spk_t *first_console; struct vc_data *vc = vc_cons[fg_console].d; struct var_t *var; @@ -2342,15 +2341,6 @@ static int __init speakup_init(void) if (err) goto error_virtkeyboard; - first_console = kzalloc(sizeof(*first_console), GFP_KERNEL); - if (!first_console) { - err = -ENOMEM; - goto error_alloc; - } - - speakup_console[vc->vc_num] = first_console; - speakup_date(vc); - for (i = 0; i < MAX_NR_CONSOLES; i++) if (vc_cons[i].d) { err = speakup_allocate(vc_cons[i].d); @@ -2412,7 +2402,6 @@ static int __init speakup_init(void) for (i = 0; i < MAX_NR_CONSOLES; i++) kfree(speakup_console[i]); -error_alloc: speakup_remove_virtual_keyboard(); error_virtkeyboard: -- 2.10.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH staging/speakup v3 1/3] return same error value from spk_set_key_info
This patch makes spk_set_key_info return -EINVAL in case of failure instead of returning 4 different values for the type of error that occurred. Print the offending values instead as debug message. Signed-off-by: Pranay Kr. Srivastava --- drivers/staging/speakup/main.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index c2f70ef..a1d5b66 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -1216,13 +1216,19 @@ int spk_set_key_info(const u_char *key_info, u_char *k_buffer) u_char ch, version, num_keys; version = *cp++; - if (version != KEY_MAP_VER) - return -1; + if (version != KEY_MAP_VER) { + pr_debug("version found %d should be %d\n", +version, KEY_MAP_VER); + return -EINVAL; + } num_keys = *cp; states = (int)cp[1]; key_data_len = (states + 1) * (num_keys + 1); - if (key_data_len + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) - return -2; + if (key_data_len + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) { + pr_debug("too many key_infos (%d over %u)\n", +key_data_len + SHIFT_TBL_SIZE + 4, (unsigned int)(sizeof(spk_key_buf))); + return -EINVAL; + } memset(k_buffer, 0, SHIFT_TBL_SIZE); memset(spk_our_keys, 0, sizeof(spk_our_keys)); spk_shift_table = k_buffer; @@ -1233,14 +1239,19 @@ int spk_set_key_info(const u_char *key_info, u_char *k_buffer) cp1 += 2; /* now pointing at shift states */ for (i = 1; i <= states; i++) { ch = *cp1++; - if (ch >= SHIFT_TBL_SIZE) - return -3; + if (ch >= SHIFT_TBL_SIZE) { + pr_debug("(%d) not valid shift state (max_allowed = %d)\n", ch, +SHIFT_TBL_SIZE); + return -EINVAL; + } spk_shift_table[ch] = i; } keymap_flags = *cp1++; while ((ch = *cp1)) { - if (ch >= MAX_KEY) - return -4; + if (ch >= MAX_KEY) { + pr_debug("(%d), not valid key, (max_allowed = %d)\n", ch, MAX_KEY); + return -EINVAL; + } spk_our_keys[ch] = cp1; cp1 += states + 1; } -- 2.10.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH staging/speakup v3 3/3] use speakup_allocate as per required context
speakup_allocate used GFP_ATOMIC for allocations even while during initialization due to it's use in notifier call. Pass GFP_ flags as well to speakup_allocate depending on the context it is called in. Signed-off-by: Pranay Kr. Srivastava --- drivers/staging/speakup/main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index ca817ca..ede842e 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -1327,14 +1327,14 @@ static int edit_bits(struct vc_data *vc, u_char type, u_char ch, u_short key) } /* Allocation concurrency is protected by the console semaphore */ -static int speakup_allocate(struct vc_data *vc) +static int speakup_allocate(struct vc_data *vc, gfp_t gfp_flags) { int vc_num; vc_num = vc->vc_num; if (speakup_console[vc_num] == NULL) { speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]), - GFP_ATOMIC); + gfp_flags); if (speakup_console[vc_num] == NULL) return -ENOMEM; speakup_date(vc); @@ -2257,7 +2257,7 @@ static int vt_notifier_call(struct notifier_block *nb, switch (code) { case VT_ALLOCATE: if (vc->vc_mode == KD_TEXT) - speakup_allocate(vc); + speakup_allocate(vc, GFP_ATOMIC); break; case VT_DEALLOCATE: speakup_deallocate(vc); @@ -2343,7 +2343,7 @@ static int __init speakup_init(void) for (i = 0; i < MAX_NR_CONSOLES; i++) if (vc_cons[i].d) { - err = speakup_allocate(vc_cons[i].d); + err = speakup_allocate(vc_cons[i].d, GFP_KERNEL); if (err) goto error_kobjects; } -- 2.10.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 24/29] drivers: convert iblock_req.pending from atomic_t to refcount_t
Hi Elena, On Mon, 2017-03-06 at 16:21 +0200, Elena Reshetova wrote: > refcount_t type and corresponding API should be > used instead of atomic_t when the variable is used as > a reference counter. This allows to avoid accidental > refcounter overflows that might lead to use-after-free > situations. > > Signed-off-by: Elena Reshetova > Signed-off-by: Hans Liljestrand > Signed-off-by: Kees Cook > Signed-off-by: David Windsor > --- > drivers/target/target_core_iblock.c | 12 ++-- > drivers/target/target_core_iblock.h | 3 ++- > 2 files changed, 8 insertions(+), 7 deletions(-) After reading up on this thread, it looks like various subsystem maintainers are now picking these atomic_t -> refcount_t conversions.. That said, applied to target-pending/for-next and will plan to include for v4.12-rc1 merge window. Thanks! ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/5] bcm2835-camera: Correct port_parameter_get return value
On Fri, Mar 17, 2017 at 02:56:42PM -0700, Michael Zoran wrote: > From: Dave Stevenson > > The API for port_parameter_get() requires that the > filled length is returned, or if insufficient space > that the required space is returned. > > Signed-off-by: Dave Stevenson > > Changed path: > From: drivers/media/platform/bcm2835/mmal-vchiq.c > To: drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > > Signed-off-by: Michael Zoran > --- > .../vc04_services/bcm2835-camera/mmal-vchiq.c| 20 > > 1 file changed, 16 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > index fc1076db0f82..4f4499dfe0c3 100644 > --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > @@ -1422,6 +1422,7 @@ static int port_parameter_get(struct > vchiq_mmal_instance *instance, > struct mmal_msg m; > struct mmal_msg *rmsg; > VCHI_HELD_MSG_T rmsg_handle; > + u32 reply_size; > > m.h.type = MMAL_MSG_TYPE_PORT_PARAMETER_GET; > > @@ -1445,19 +1446,30 @@ static int port_parameter_get(struct > vchiq_mmal_instance *instance, > } > > ret = -rmsg->u.port_parameter_get_reply.status; > - if (ret || (rmsg->u.port_parameter_get_reply.size > *value_size)) { > + /* > + * port_parameter_get_reply.size includes the header, > + * whilst *value_size doesn't. > + */ > + reply_size = rmsg->u.port_parameter_get_reply.size - (2 * sizeof(u32)); > + > + if (ret || (reply_size > *value_size)) { > /* Copy only as much as we have space for >* but report true size of parameter >*/ > memcpy(value, &rmsg->u.port_parameter_get_reply.value, > *value_size); > - *value_size = rmsg->u.port_parameter_get_reply.size; > } else > memcpy(value, &rmsg->u.port_parameter_get_reply.value, > -rmsg->u.port_parameter_get_reply.size); > +reply_size); > + > + /* > + * Return amount of data copied if big enough, > + * or wanted if not big enough. > + */ > + *value_size = reply_size; > > pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", __func__, > - ret, port->component->handle, port->handle, parameter_id); > + ret, port->component->handle, port->handle, parameter_id); Why did you change this last line? It was previously correct. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/5] staging: bcm2835-camera: Fix integer underrun in port_parameter_get
On Fri, Mar 17, 2017 at 02:56:43PM -0700, Michael Zoran wrote: > Fix port_paremeter_get function blindly subtracts 8 from a reply > size without checking that the size is at lest 8 bytes. This can > casue a large buffer to be copied since the size is unsigned. > > Add a WARN_ON, and also add min and max conditions to the size > of the data that is copied. > > Signed-off-by: Michael Zoran > --- > .../vc04_services/bcm2835-camera/mmal-vchiq.c | 27 > +++--- > 1 file changed, 14 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > index 4f4499dfe0c3..a8768358c557 100644 > --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > @@ -1450,23 +1450,24 @@ static int port_parameter_get(struct > vchiq_mmal_instance *instance, >* port_parameter_get_reply.size includes the header, >* whilst *value_size doesn't. >*/ > - reply_size = rmsg->u.port_parameter_get_reply.size - (2 * sizeof(u32)); > > - if (ret || (reply_size > *value_size)) { > - /* Copy only as much as we have space for > - * but report true size of parameter > - */ > - memcpy(value, &rmsg->u.port_parameter_get_reply.value, > -*value_size); > - } else > - memcpy(value, &rmsg->u.port_parameter_get_reply.value, > -reply_size); > + if (WARN_ON(rmsg->u.port_parameter_get_reply.size < 8)) > + reply_size = 0; Can userspace trigger this warning? If so, don't make it a warning, just check for it and handle it properly. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] vc04_services: Fixing coding guideline error
On Wed, Mar 15, 2017 at 12:01:08PM +0530, Pushkar Jambhlekar wrote: > Fixing 'if' block coding style. '{' should follow 'if' for multiline block > > Signed-off-by: Pushkar Jambhlekar > --- > drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Patch does not apply to my tree at all, please rebase and refresh and resend. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: fix printk warnings in dgnc_tty.c
On Sun, Mar 19, 2017 at 03:46:11AM -0700, absh...@gmail.com wrote: > From: Abhishek Bhardwaj > > Use __func__ to print dgnc_tty_send_xchar function name. > > Signed-off-by: Abhishek Bhardwaj > --- > drivers/staging/dgnc/dgnc_tty.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c > index cde00e3702fa..3d2274f68ac6 100644 > --- a/drivers/staging/dgnc/dgnc_tty.c > +++ b/drivers/staging/dgnc/dgnc_tty.c > @@ -1862,13 +1862,13 @@ static void dgnc_tty_send_xchar(struct tty_struct > *tty, char c) > if (!bd || bd->magic != DGNC_BOARD_MAGIC) > return; > > - dev_dbg(tty->dev, "dgnc_tty_send_xchar start\n"); > + dev_dbg(tty->dev, "%s start\n", __func__); > > spin_lock_irqsave(&ch->ch_lock, flags); > bd->bd_ops->send_immediate_char(ch, c); > spin_unlock_irqrestore(&ch->ch_lock, flags); > > - dev_dbg(tty->dev, "dgnc_tty_send_xchar finish\n"); > + dev_dbg(tty->dev, "%s finish\n", __func__); These "start" and "finished" messages need to just be deleted from the driver entirely. There is no need for them, now that we have ftrace in the kernel (this driver predates that.) Can you just remove them all instead? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: ks7010 - fixed style block comments
On Sun, Mar 19, 2017 at 01:07:17PM +1300, Derek Robson wrote: > Fixed style of all block comments across whole driver > Found by checkpatch > > Signed-off-by: Derek Robson > --- > drivers/staging/ks7010/ks7010_sdio.c | 3 ++- > drivers/staging/ks7010/ks_hostif.h | 35 +- > drivers/staging/ks7010/ks_wlan.h | 3 ++- > drivers/staging/ks7010/ks_wlan_net.c | 41 > +++- > 4 files changed, 55 insertions(+), 27 deletions(-) This patch doesn't apply to my tree at all :( sorry, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/7] staging: speakup: fixes braces {} should be used on all arms of this statement
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 | 35 +++- 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, 37 insertions(+), 28 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index f8fccc8bf6b2..21e76b031449 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -409,8 +409,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)); } @@ -643,8 +644,9 @@ static void say_prev_word(struct vc_data *vc) break; spk_y--; spk_x = vc->vc_cols - 1; - } else + } else { spk_x--; + } spk_pos -= 2; ch = get_char(vc, (u_short *)spk_pos, &temp); if (ch == SPACE || ch == 0) @@ -697,8 +699,9 @@ static void say_next_word(struct vc_data *vc) spk_y++; spk_x = 0; edge_said = edge_right; - } else + } else { spk_x++; + } spk_pos += 2; last_state = state; } @@ -729,8 +732,9 @@ static void spell_word(struct vc_data *vc) spk_pitch_shift++; else/* synth has no pitch */ last_cap = spk_str_caps_stop; - } else + } else { str_cap = spk_str_caps_stop; + } if (str_cap != last_cap) { synth_printf("%s", str_cap); last_cap = str_cap; @@ -1343,8 +1347,9 @@ static int speakup_allocate(struct vc_data *vc) if (!speakup_console[vc_num]) return -ENOMEM; speakup_date(vc); - } else if (!spk_parked) + } else if (!spk_parked) { speakup_date(vc); + } return 0; } @@ -1397,9 +1402,9 @@ static void read_all_doc(struct vc_data *vc) prev_cursor_track = cursor_track; cursor_track = read_all_mode; spk_reset_index_count(0); - if (get_sentence_buf(vc, 0) == -1) + if (get_sentence_buf(vc, 0) == -1) { kbd_fakekey2(vc, RA_DOWN_ARROW); - else { + } else { say_sentence_num(0, 0); synth_insert_next_index(0); start_read_all_timer(vc, RA_TIMER); @@ -1446,8 +1451,9 @@ static void handle_cursor_read_all(struct vc_data *vc, int command) if (!say_sentence_num(sentcount + 1, 1)) { sn = 1; spk_reset_index_count(sn); - } else + } else { synth_insert_next_index(0); + } if (!say_sentence_num(sn, 0)) { kbd_fakekey2(vc, RA_FIND_NEXT_SENT); return; @@ -1476,9 +1482,9 @@ static void handle_cursor_read_all(struct vc_data *vc, int command) rv = get_sentence_buf(vc, 0); if (rv == -1) read_all_doc(vc); - if (rv == 0) + if (rv == 0) { kbd_fakekey2(vc, RA_FIND_NEXT_SENT); - else { + } else { say_sentence_num(1, 0); synth_insert_next_index(0); start_read_all_timer(vc, RA_TIMER); @@ -2177,10 +2183,11 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym, if (type == KT_SPEC && value == 1) { value = '\n'; type = KT_LATIN; - } else if (type == KT_LETTER) + } else if (type == KT_LETTER) { type = KT_LATIN; - else if (value == 0x7f) + } else if (value == 0x7f) { value = 8; /* make del = backspace */ + } ret = (*spk_special_handler) (vc, type, value, keycode); spk_close_press = 0; if (ret < 0) @@ -2274,9 +2281,9 @@ static int vt_notifier_call(struct notifier_block *n
[PATCH 2/7] staging: speakup: Remove multiple assignments
This patch fixes the checkpatch.pl warning "multiple assignments should be avoided." Signed-off-by: Arushi Singhal --- drivers/staging/speakup/main.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index f71206878363..f8fccc8bf6b2 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -270,9 +270,12 @@ static unsigned char get_attributes(struct vc_data *vc, u16 *pos) static void speakup_date(struct vc_data *vc) { - spk_x = spk_cx = vc->vc_x; - spk_y = spk_cy = vc->vc_y; - spk_pos = spk_cp = vc->vc_pos; + spk_x = vc->vc_x; + spk_cx = spk_x; + spk_y = vc->vc_y; + spk_cy = spk_y; + spk_pos = vc->vc_pos; + spk_cp = spk_pos; spk_old_attr = spk_attr; spk_attr = get_attributes(vc, (u_short *)spk_pos); } @@ -1655,9 +1658,12 @@ static int speak_highlight(struct vc_data *vc) spk_do_flush(); spkup_write(speakup_console[vc_num]->ht.highbuf[hc], speakup_console[vc_num]->ht.highsize[hc]); - spk_pos = spk_cp = speakup_console[vc_num]->ht.rpos[hc]; - spk_x = spk_cx = speakup_console[vc_num]->ht.rx[hc]; - spk_y = spk_cy = speakup_console[vc_num]->ht.ry[hc]; + spk_pos = speakup_console[vc_num]->ht.rpos[hc]; + spk_cp = spk_pos; + spk_x = speakup_console[vc_num]->ht.rx[hc]; + spk_cx = spk_x; + spk_y = speakup_console[vc_num]->ht.ry[hc]; + spk_cy = spk_y; return 1; } return 0; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/7] staging: speakup: Moved logical to previous line.
Moved logical AND operators to previous line to fix the following checkpatch issue: CHECK: Logical continuations should be on the previous line. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/main.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index f280e22d7e15..f71206878363 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -905,8 +905,8 @@ static int get_sentence_buf(struct vc_data *vc, int read_punc) while (start < end) { sentbuf[bn][i] = get_char(vc, (u_short *)start, &tmp); if (i > 0) { - if (sentbuf[bn][i] == SPACE && sentbuf[bn][i - 1] == '.' - && numsentences[bn] < 9) { + if (sentbuf[bn][i] == SPACE && sentbuf[bn][i - 1] == '.' && + numsentences[bn] < 9) { /* Sentence Marker */ numsentences[bn]++; sentmarks[bn][numsentences[bn]] = @@ -1292,8 +1292,8 @@ void spk_reset_default_chars(void) /* First, free any non-default */ for (i = 0; i < 256; i++) { - if ((spk_characters[i] != NULL) - && (spk_characters[i] != spk_default_chars[i])) + if (spk_characters[i] && + (spk_characters[i] != spk_default_chars[i])) kfree(spk_characters[i]); } @@ -2088,8 +2088,8 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym, tty = vc->port.tty; if (type >= 0xf0) type -= 0xf0; - if (type == KT_PAD - && (vt_get_leds(fg_console, VC_NUMLOCK))) { + if (type == KT_PAD && + (vt_get_leds(fg_console, VC_NUMLOCK))) { if (up_flag) { spk_keydown = 0; goto out; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/7] staging: speakup: Multiple CheckPatch issues.
Improve readability by fixing multiple checkpatch.pl issues in speakup driver. Arushi Singhal (7): staging: speakup: Moved logical to previous line. staging: speakup: Remove multiple assignments staging: speakup: Simplify "NULL" comparisons staging: speakup: fixes braces {} should be used on all arms of this statement staging: speakup: Remove multiple assignments staging: speakup: Moved OR operator to previous line. staging: speakup: spaces preferred around operator drivers/staging/speakup/main.c | 76 +++- drivers/staging/speakup/selection.c | 2 +- drivers/staging/speakup/speakup.h| 12 ++--- drivers/staging/speakup/speakup_acntpc.c | 2 +- drivers/staging/speakup/speakup_decext.c | 6 +-- drivers/staging/speakup/speakup_decpc.c | 26 +-- drivers/staging/speakup/speakup_dectlk.c | 6 +-- drivers/staging/speakup/speakup_dtlk.c | 2 +- drivers/staging/speakup/speakup_keypc.c | 6 +-- drivers/staging/speakup/speakup_ltlk.c | 2 +- drivers/staging/speakup/varhandlers.c| 18 11 files changed, 87 insertions(+), 71 deletions(-) -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/7] staging: speakup: Moved OR operator to previous line.
Moved logical OR operator to previous line to fix the following checkpatch issue: CHECK: Logical continuations should be on the previous line. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index c10445624e92..def1a36da9dd 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -2173,10 +2173,10 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym, if (up_flag || spk_killed || type == KT_SHIFT) goto out; spk_shut_up &= 0xfe; - kh = (value == KVAL(K_DOWN)) - || (value == KVAL(K_UP)) - || (value == KVAL(K_LEFT)) - || (value == KVAL(K_RIGHT)); + kh = (value == KVAL(K_DOWN)) || + (value == KVAL(K_UP)) || + (value == KVAL(K_LEFT)) || + (value == KVAL(K_RIGHT)); if ((cursor_track != read_all_mode) || !kh) if (!spk_no_intr) spk_do_flush(); -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/7] staging: speakup: Remove multiple assignments
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 21e76b031449..c10445624e92 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -2106,7 +2106,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 7/7] staging: speakup: spaces preferred around operator
Fixed the checkpatch.pl issues like: CHECK: spaces preferred around that '&' (ctx:VxV) CHECK: spaces preferred around that '|' (ctx:VxV) CHECK: spaces preferred around that '-' (ctx:VxV) CHECK: spaces preferred around that '+' (ctx:VxV) etc. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/speakup.h| 12 ++-- drivers/staging/speakup/speakup_acntpc.c | 2 +- drivers/staging/speakup/speakup_decpc.c | 20 ++-- drivers/staging/speakup/speakup_dtlk.c | 2 +- drivers/staging/speakup/speakup_keypc.c | 6 +++--- drivers/staging/speakup/speakup_ltlk.c | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/staging/speakup/speakup.h b/drivers/staging/speakup/speakup.h index 0bc8d6afadfa..a654334c98b9 100644 --- a/drivers/staging/speakup/speakup.h +++ b/drivers/staging/speakup/speakup.h @@ -20,7 +20,7 @@ #define A_CAP 0x0007 #define B_NUM 0x0008 #define NUM 0x0009 -#define ALPHANUM (B_ALPHA|B_NUM) +#define ALPHANUM (B_ALPHA | B_NUM) #define SOME 0x0010 #define MOST 0x0020 #define PUNC 0x0040 @@ -30,14 +30,14 @@ #define B_EXNUM 0x0100 #define CH_RPT 0x0200 #define B_CTL 0x0400 -#define A_CTL (B_CTL+SYNTH_OK) +#define A_CTL (B_CTL + SYNTH_OK) #define B_SYM 0x0800 -#define B_CAPSYM (B_CAP|B_SYM) +#define B_CAPSYM (B_CAP | B_SYM) /* FIXME: u16 */ -#define IS_WDLM(x) (spk_chartab[((u_char)x)]&B_WDLM) -#define IS_CHAR(x, type) (spk_chartab[((u_char)x)]&type) -#define IS_TYPE(x, type) ((spk_chartab[((u_char)x)]&type) == type) +#define IS_WDLM(x) (spk_chartab[((u_char)x)] & B_WDLM) +#define IS_CHAR(x, type) (spk_chartab[((u_char)x)] & type) +#define IS_TYPE(x, type) ((spk_chartab[((u_char)x)] & type) == type) int speakup_thread(void *data); void spk_reset_default_chars(void); diff --git a/drivers/staging/speakup/speakup_acntpc.c b/drivers/staging/speakup/speakup_acntpc.c index c5beb5602c42..b4058bd82e42 100644 --- a/drivers/staging/speakup/speakup_acntpc.c +++ b/drivers/staging/speakup/speakup_acntpc.c @@ -282,7 +282,7 @@ static int synth_probe(struct spk_synth *synth) if (port_val == 0x53fc) { /* 'S' and out&input bits */ synth_port_control = synth_portlist[i]; - speakup_info.port_tts = synth_port_control+1; + speakup_info.port_tts = synth_port_control + 1; break; } } diff --git a/drivers/staging/speakup/speakup_decpc.c b/drivers/staging/speakup/speakup_decpc.c index 5e35d7e11361..5d22c3b7edd4 100644 --- a/drivers/staging/speakup/speakup_decpc.c +++ b/drivers/staging/speakup/speakup_decpc.c @@ -250,7 +250,7 @@ static int dt_getstatus(void) static void dt_sendcmd(u_int cmd) { outb_p(cmd & 0xFF, speakup_info.port_tts); - outb_p((cmd >> 8) & 0xFF, speakup_info.port_tts+1); + outb_p((cmd >> 8) & 0xFF, speakup_info.port_tts + 1); } static int dt_waitbit(int bit) @@ -286,11 +286,11 @@ static int dt_ctrl(u_int cmd) if (!dt_waitbit(STAT_cmd_ready)) return -1; - outb_p(0, speakup_info.port_tts+2); - outb_p(0, speakup_info.port_tts+3); + outb_p(0, speakup_info.port_tts + 2); + outb_p(0, speakup_info.port_tts + 3); dt_getstatus(); - dt_sendcmd(CMD_control|cmd); - outb_p(0, speakup_info.port_tts+6); + dt_sendcmd(CMD_control | cmd); + outb_p(0, speakup_info.port_tts + 6); while (dt_getstatus() & STAT_cmd_ready) { udelay(20); if (--timeout == 0) @@ -318,8 +318,8 @@ udelay(50); break; udelay(50); } - outb_p(DMA_sync, speakup_info.port_tts+4); - outb_p(0, speakup_info.port_tts+4); + outb_p(DMA_sync, speakup_info.port_tts + 4); + outb_p(0, speakup_info.port_tts + 4); udelay(100); for (timeout = 0; timeout < 10; timeout++) { if (!(dt_getstatus() & STAT_flushing)) @@ -337,8 +337,8 @@ static int dt_sendchar(char ch) return -1; if (!(dt_stat & STAT_rr_char)) return -2; - outb_p(DMA_single_in, speakup_info.port_tts+4); - outb_p(ch, speakup_info.port_tts+4); + outb_p(DMA_single_in, speakup_info.port_tts + 4); + outb_p(ch, speakup_info.port_tts + 4); dma_state ^= STAT_dma_state; return 0; } @@ -354,7 +354,7 @@ static int testkernel(void) dt_sendcmd(CMD_sync); if (!dt_waitbit(STAT_cmd_ready)) status = -2; - else if (dt_stat&0x8000) + else if (dt_stat & 0x8000) return 0; else if (dt_stat == 0x0dec) pr_warn("dec_pc at 0x%x, software not loaded\n", diff --git a/drivers/staging/speakup/speakup_dtlk.c b/drivers/staging/speakup/speakup_dtlk.c index 693fac4365c3..5973acc0a006 100644 --- a/drivers/staging/speakup/speakup_dtlk.c +++ b/drivers/stagin
[PATCH 3/7] staging: speakup: Simplify "NULL" comparisons
Fixed coding style for null comparisons in speakup driver to be more consistant with the rest of the kernel coding style. Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/selection.c | 2 +- drivers/staging/speakup/varhandlers.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c index afd9a446a06f..4417c00e68a7 100644 --- a/drivers/staging/speakup/selection.c +++ b/drivers/staging/speakup/selection.c @@ -175,7 +175,7 @@ static struct speakup_paste_work speakup_paste_work = { int speakup_paste_selection(struct tty_struct *tty) { - if (cmpxchg(&speakup_paste_work.tty, NULL, tty) != NULL) + if (cmpxchg(&speakup_paste_work.tty, NULL, tty)) return -EBUSY; tty_kref_get(tty); diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index cc984196020f..5910fe0b1365 100644 --- a/drivers/staging/speakup/varhandlers.c +++ b/drivers/staging/speakup/varhandlers.c @@ -98,7 +98,7 @@ void speakup_register_var(struct var_t *var) } } p_header = var_ptrs[var->var_id]; - if (p_header->data != NULL) + if (p_header->data) return; p_header->data = var; switch (p_header->var_type) { @@ -210,11 +210,11 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) return -ERANGE; var_data->u.n.value = val; - if (var->var_type == VAR_TIME && p_val != NULL) { + if (var->var_type == VAR_TIME && p_val) { *p_val = msecs_to_jiffies(val); return 0; } - if (p_val != NULL) + if (p_val) *p_val = val; if (var->var_id == PUNC_LEVEL) { spk_punc_mask = spk_punc_masks[val]; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/5] bcm2835-camera: Correct port_parameter_get return value
On Tue, 2017-03-21 at 08:27 +0100, Greg KH wrote: > On Fri, Mar 17, 2017 at 02:56:42PM -0700, Michael Zoran wrote: > > From: Dave Stevenson > > > > The API for port_parameter_get() requires that the > > filled length is returned, or if insufficient space > > that the required space is returned. > > > > Signed-off-by: Dave Stevenson > > > > Changed path: > > From: drivers/media/platform/bcm2835/mmal-vchiq.c > > To: drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > > > > Signed-off-by: Michael Zoran > > --- > > .../vc04_services/bcm2835-camera/mmal-vchiq.c| 20 > > > > 1 file changed, 16 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal- > > vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > > index fc1076db0f82..4f4499dfe0c3 100644 > > --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > > +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c > > @@ -1422,6 +1422,7 @@ static int port_parameter_get(struct > > vchiq_mmal_instance *instance, > > struct mmal_msg m; > > struct mmal_msg *rmsg; > > VCHI_HELD_MSG_T rmsg_handle; > > + u32 reply_size; > > > > m.h.type = MMAL_MSG_TYPE_PORT_PARAMETER_GET; > > > > @@ -1445,19 +1446,30 @@ static int port_parameter_get(struct > > vchiq_mmal_instance *instance, > > } > > > > ret = -rmsg->u.port_parameter_get_reply.status; > > - if (ret || (rmsg->u.port_parameter_get_reply.size > > > *value_size)) { > > + /* > > + * port_parameter_get_reply.size includes the header, > > + * whilst *value_size doesn't. > > + */ > > + reply_size = rmsg->u.port_parameter_get_reply.size - (2 * > > sizeof(u32)); > > + > > + if (ret || (reply_size > *value_size)) { > > /* Copy only as much as we have space for > > * but report true size of parameter > > */ > > memcpy(value, &rmsg- > > >u.port_parameter_get_reply.value, > > *value_size); > > - *value_size = rmsg- > > >u.port_parameter_get_reply.size; > > } else > > memcpy(value, &rmsg- > > >u.port_parameter_get_reply.value, > > - rmsg->u.port_parameter_get_reply.size); > > + reply_size); > > + > > + /* > > + * Return amount of data copied if big enough, > > + * or wanted if not big enough. > > + */ > > + *value_size = reply_size; > > > > pr_debug("%s:result:%d component:0x%x port:%d > > parameter:%d\n", __func__, > > - ret, port->component->handle, port->handle, > > parameter_id); > > + ret, port->component->handle, port->handle, > > parameter_id); > > Why did you change this last line? It was previously correct. > > thanks, > > greg k-h Hi Greg, No I didn't, it should be an exact copy of the original with the the paths changed. I'm not happen with this code block in general. I think this particular block needs to be written. I'll see what I can do. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/4] staging: speakup: Checkpatch issues.
Improve readability by fixing multiple checkpatch.pl issues in speakup driver. Arushi Singhal (4): staging: speakup: Removed Unnecessary parentheses. staging: speakup: Simplify the NULL comparisons staging: speakup: Match alignment with open parenthesis. staging: speakup: Fix alignment with parenthesis. drivers/staging/speakup/fakekey.c| 2 +- drivers/staging/speakup/kobjects.c | 2 +- drivers/staging/speakup/main.c | 34 drivers/staging/speakup/selection.c | 2 +- drivers/staging/speakup/serialio.c | 2 +- drivers/staging/speakup/speakup_acntpc.c | 6 +++--- drivers/staging/speakup/speakup_apollo.c | 2 +- drivers/staging/speakup/speakup_decext.c | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-) -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: speakup: Simplify the NULL comparisons
Fixed coding style for null comparisons in speakup driver to be more consistant with the rest of the kernel coding style. Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/fakekey.c | 2 +- drivers/staging/speakup/main.c| 32 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/speakup/fakekey.c b/drivers/staging/speakup/fakekey.c index d76da0a1382c..294c74b47224 100644 --- a/drivers/staging/speakup/fakekey.c +++ b/drivers/staging/speakup/fakekey.c @@ -56,7 +56,7 @@ int speakup_add_virtual_keyboard(void) void speakup_remove_virtual_keyboard(void) { - if (virt_keyboard != NULL) { + if (virt_keyboard) { input_unregister_device(virt_keyboard); virt_keyboard = NULL; } diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index def1a36da9dd..7568e8149613 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -304,7 +304,7 @@ static void speakup_shut_up(struct vc_data *vc) spk_shut_up |= 0x01; spk_parked &= 0xfe; speakup_date(vc); - if (synth != NULL) + if (synth) spk_do_flush(); } @@ -449,7 +449,7 @@ static void speak_char(u16 ch) } cp = spk_characters[ch]; - if (cp == NULL) { + if (!cp) { pr_info("speak_char: cp == NULL!\n"); return; } @@ -1177,7 +1177,7 @@ static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag) { unsigned long flags; - if (synth == NULL || up_flag || spk_killed) + if (!synth || up_flag || spk_killed) return; spin_lock_irqsave(&speakup_info.spinlock, flags); if (cursor_track == read_all_mode) { @@ -1215,7 +1215,7 @@ static void do_handle_latin(struct vc_data *vc, u_char value, char up_flag) spin_unlock_irqrestore(&speakup_info.spinlock, flags); return; } - if (synth == NULL || spk_killed) { + if (!synth || spk_killed) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); return; } @@ -1341,7 +1341,7 @@ static int speakup_allocate(struct vc_data *vc) int vc_num; vc_num = vc->vc_num; - if (speakup_console[vc_num] == NULL) { + if (!speakup_console[vc_num]) { speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]), GFP_ATOMIC); if (!speakup_console[vc_num]) @@ -1394,7 +1394,7 @@ static void kbd_fakekey2(struct vc_data *vc, int command) static void read_all_doc(struct vc_data *vc) { - if ((vc->vc_num != fg_console) || synth == NULL || spk_shut_up) + if ((vc->vc_num != fg_console) || !synth || spk_shut_up) return; if (!synth_supports_indexing()) return; @@ -1509,7 +1509,7 @@ static int pre_handle_cursor(struct vc_data *vc, u_char value, char up_flag) spin_lock_irqsave(&speakup_info.spinlock, flags); if (cursor_track == read_all_mode) { spk_parked &= 0xfe; - if (synth == NULL || up_flag || spk_shut_up) { + if (!synth || up_flag || spk_shut_up) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); return NOTIFY_STOP; } @@ -1531,7 +1531,7 @@ static void do_handle_cursor(struct vc_data *vc, u_char value, char up_flag) spin_lock_irqsave(&speakup_info.spinlock, flags); spk_parked &= 0xfe; - if (synth == NULL || up_flag || spk_shut_up || cursor_track == CT_Off) { + if (!synth || up_flag || spk_shut_up || cursor_track == CT_Off) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); return; } @@ -1730,7 +1730,7 @@ static void speakup_bs(struct vc_data *vc) return; if (!spk_parked) speakup_date(vc); - if (spk_shut_up || synth == NULL) { + if (spk_shut_up || !synth) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); return; } @@ -1747,7 +1747,7 @@ static void speakup_con_write(struct vc_data *vc, u16 *str, int len) { unsigned long flags; - if ((vc->vc_num != fg_console) || spk_shut_up || synth == NULL) + if ((vc->vc_num != fg_console) || spk_shut_up || !synth) return; if (!spin_trylock_irqsave(&speakup_info.spinlock, flags)) /* Speakup output, discard */ @@ -1776,7 +1776,7 @@ static void speakup_con_update(struct vc_data *vc) { unsigned long flags; - if (speakup_console[vc->vc_num] == NULL || spk_parked) + if (!speakup_console[vc->vc_num] || spk_parked) return; if (!spin_trylock_irqsave(&speakup_info.spinloc
[PATCH 4/4] staging: speakup: Fix alignment with parenthesis.
This patch fixes the warnings reported by checkpatch.pl for please use a blank line after function/struct/union/enum declarations. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/speakup_apollo.c | 2 +- drivers/staging/speakup/speakup_decext.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/speakup/speakup_apollo.c b/drivers/staging/speakup/speakup_apollo.c index 9cfdbbfb9742..6ad83dc642c4 100644 --- a/drivers/staging/speakup/speakup_apollo.c +++ b/drivers/staging/speakup/speakup_apollo.c @@ -173,7 +173,7 @@ static void do_catch_up(struct spk_synth *synth) if (!synth->io_ops->synth_out(synth, ch)) { outb(UART_MCR_DTR, speakup_info.port_tts + UART_MCR); outb(UART_MCR_DTR | UART_MCR_RTS, - speakup_info.port_tts + UART_MCR); +speakup_info.port_tts + UART_MCR); schedule_timeout(msecs_to_jiffies(full_time_val)); continue; } diff --git a/drivers/staging/speakup/speakup_decext.c b/drivers/staging/speakup/speakup_decext.c index 929a28d618dc..c564bf8e1531 100644 --- a/drivers/staging/speakup/speakup_decext.c +++ b/drivers/staging/speakup/speakup_decext.c @@ -206,11 +206,11 @@ static void do_catch_up(struct spk_synth *synth) if (!in_escape) synth->io_ops->synth_out(synth, PROCSPEECH); spin_lock_irqsave(&speakup_info.spinlock, - flags); + flags); jiffy_delta_val = jiffy_delta->u.n.value; delay_time_val = delay_time->u.n.value; spin_unlock_irqrestore(&speakup_info.spinlock, - flags); + flags); schedule_timeout(msecs_to_jiffies (delay_time_val)); jiff_max = jiffies + jiffy_delta_val; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: speakup: Match alignment with open parenthesis.
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis". Signed-off-by: Arushi Singhal --- drivers/staging/speakup/main.c | 2 +- drivers/staging/speakup/selection.c | 2 +- drivers/staging/speakup/serialio.c | 2 +- drivers/staging/speakup/speakup_acntpc.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index 7568e8149613..55bf7af1d6ea 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -1160,7 +1160,7 @@ static void spkup_write(const u16 *in_buf, int count) if (last_type & CH_RPT) { synth_printf(" "); synth_printf(spk_msg_get(MSG_REPEAT_DESC2), - ++rep_count); +++rep_count); synth_printf(" "); } rep_count = 0; diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c index 4417c00e68a7..08f68fc2864e 100644 --- a/drivers/staging/speakup/selection.c +++ b/drivers/staging/speakup/selection.c @@ -75,7 +75,7 @@ int speakup_set_selection(struct tty_struct *tty) speakup_clear_selection(); spk_sel_cons = vc_cons[fg_console].d; dev_warn(tty->dev, - "Selection: mark console not the same as cut\n"); +"Selection: mark console not the same as cut\n"); return -EINVAL; } diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c index e860e48818a4..5e31acac19de 100644 --- a/drivers/staging/speakup/serialio.c +++ b/drivers/staging/speakup/serialio.c @@ -125,7 +125,7 @@ static void start_serial_interrupt(int irq) pr_err("Unable to request Speakup serial I R Q\n"); /* Set MCR */ outb(UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2, - speakup_info.port_tts + UART_MCR); +speakup_info.port_tts + UART_MCR); /* Turn on Interrupts */ outb(UART_IER_MSI|UART_IER_RLSI|UART_IER_RDI, speakup_info.port_tts + UART_IER); diff --git a/drivers/staging/speakup/speakup_acntpc.c b/drivers/staging/speakup/speakup_acntpc.c index b4058bd82e42..ad72f8e883fc 100644 --- a/drivers/staging/speakup/speakup_acntpc.c +++ b/drivers/staging/speakup/speakup_acntpc.c @@ -261,9 +261,9 @@ static int synth_probe(struct spk_synth *synth) if (port_forced) { speakup_info.port_tts = port_forced; pr_info("probe forced to %x by kernel command line\n", - speakup_info.port_tts); + speakup_info.port_tts); if (synth_request_region(speakup_info.port_tts - 1, - SYNTH_IO_EXTENT)) { +SYNTH_IO_EXTENT)) { pr_warn("sorry, port already reserved\n"); return -EBUSY; } @@ -272,7 +272,7 @@ static int synth_probe(struct spk_synth *synth) } else { for (i = 0; synth_portlist[i]; i++) { if (synth_request_region(synth_portlist[i], - SYNTH_IO_EXTENT)) { +SYNTH_IO_EXTENT)) { pr_warn ("request_region: failed with 0x%x, %d\n", synth_portlist[i], SYNTH_IO_EXTENT); -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: speakup: Removed Unnecessary parentheses.
Unnecessary parentheses are removed to improve readability. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/kobjects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index afb61e153592..ca85476e3ff7 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -392,7 +392,7 @@ static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr, len--; new_synth_name[len] = '\0'; spk_strlwr(new_synth_name); - if (synth && (!strcmp(new_synth_name, synth->name))) { + if (synth && !strcmp(new_synth_name, synth->name)) { pr_warn("%s already in use\n", new_synth_name); } else if (synth_init(new_synth_name) != 0) { pr_warn("failed to init synth %s\n", new_synth_name); -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 3/6] staging: rtl8192e: Rectify pointer comparisions with NULL
From: Suniel Mahesh This patch simplifies code by replacing explicit NULL comparison with ! or unmark operator Reported by checkpatch.pl for comparison to NULL could be written '!foo' or 'foo' Signed-off-by: Suniel Mahesh --- Changes for v5: - Changed email address from suni...@techveda.org to suniel.spar...@gmail.com, reason being few patches were being dropped and not getting delivered, couldn't resolve that issue - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v4: - Dropped two patches from the series, as they were not adding significant value suggested by Dan Carpenter. staging: rtl8192e: Fix coding style, this was fixing line over 80 characters. staging: rtl8192e: Fix unbalanced braces - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v3: - Split earlier patches into multiple commits for easy review as suggested by Greg K-H - Modified description for better readability - Rebased on top of next-20170310 - Patches were tested and built on next-20170310 and staging-testing as suggested by Greg K-H, no errors reported Changes for v2: - Rectify pointer comparisions reported by checkpatch.pl in rtl_core.c - new patch addition to the series - Rebased on top of next-20170306 --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index f00ee3b..4f4cd07 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -472,7 +472,7 @@ static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv, u32 size = sizeof(struct rtllib_qos_parameters); int set_qos_param = 0; - if ((priv == NULL) || (network == NULL)) + if (!priv || !network) return 0; if (priv->rtllib->state != RTLLIB_LINKED) @@ -785,7 +785,7 @@ static int _rtl92e_sta_down(struct net_device *dev, bool shutdownrf) if (priv->up == 0) return -1; - if (priv->rtllib->rtllib_ips_leave != NULL) + if (priv->rtllib->rtllib_ips_leave) priv->rtllib->rtllib_ips_leave(dev); if (priv->rtllib->state == RTLLIB_LINKED) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 4/6] staging: rtl8192e: Pass a pointer as an argument to sizeof() instead of struct
From: Suniel Mahesh Replaced sizeof(struct foo) into sizeof(*ptr), found by checkpatch.pl Signed-off-by: Suniel Mahesh --- Changes for v5: - Changed email address from suni...@techveda.org to suniel.spar...@gmail.com, reason being few patches were being dropped and not getting delivered, couldn't resolve that issue - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v4: - Dropped two patches from the series, as they were not adding significant value suggested by Dan Carpenter. staging: rtl8192e: Fix coding style, this was fixing line over 80 characters. staging: rtl8192e: Fix unbalanced braces - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v3: - Split earlier patches into multiple commits for easy review as suggested by Greg K-H - Modified description for better readability - Rebased on top of next-20170310 - Patches were tested and built on next-20170310 and staging-testing as suggested by Greg K-H, no errors reported Changes for v2: - new patch addition to the series - Rebased on top of next-20170306 --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 4f4cd07..999af05 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -969,7 +969,7 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) priv->card_type = PCI; - priv->pFirmware = vzalloc(sizeof(struct rt_firmware)); + priv->pFirmware = vzalloc(sizeof(*priv->pFirmware)); if (!priv->pFirmware) return; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 0/6] staging: rtl8192e: Fix coding style, warnings and checks
From: Suniel Mahesh Changed email address from suni...@techveda.org to suniel.spar...@gmail.com, reason being few patches were being dropped and not getting delivered, couldn't resolve that issue. Split earlier patches into multiple commits for easy review as suggested by Dan Carpenter. Modified subject, description and in few patches both for better readability as suggested by Greg KH. Dropped two patches from the earler series, as they were not adding significant value, suggested by Dan Carpenter. Fixed the following issues reported by checkpatch.pl: Block comments should align the * on each line, aligned. Block comments use * on subsequent lines, other characters are replaced by * . Removed unnecessary 'out of memory' message. Comparison's to NULL could be written '!foo' or 'foo', modified. Replaced sizeof(struct foo) into sizeof(*ptr). Spaces preferred around that 'operator', spacing provided. Logical continuations should be on the previous line, modified accordingly. Unnecessary parentheses around variables, removed. Please use a blank line after function/struct/union/enum declarations, used. Blank lines aren't necessary after an open brace '{' and before a close brace '}', removed. No space is necessary after a cast, removed. Please don't use multiple blank lines, removed. Rebased on top of next-20170310. Patches were tested and built on next-20170310 and staging-testing as suggested by Greg K-H, no errors reported. Suniel Mahesh (6): staging: rtl8192e: Fix comments as per kernel coding style staging: rtl8192e: Remove unnecessary 'out of memory' message staging: rtl8192e: Rectify pointer comparisions with NULL staging: rtl8192e: Pass a pointer as an argument to sizeof() instead of struct staging: rtl8192e: Fix issues reported by checkpatch.pl staging: rtl8192e: Fix blank lines and space after a cast drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 141 ++- 1 file changed, 50 insertions(+), 91 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 2/6] staging: rtl8192e: Remove unnecessary 'out of memory' message
From: Suniel Mahesh Fixed the following checkpatch.pl warning: Possible unnecessary 'out of memory' message If it is out of memory, function should return with an appropriate error code. Since this function is of type void, a return statement is used. Signed-off-by: Suniel Mahesh --- Changes for v5: - Changed email address from suni...@techveda.org to suniel.spar...@gmail.com, reason being few patches were being dropped and not getting delivered, couldn't resolve that issue - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v4: - Modified description for better readability as pointed out by Dan Carpenter - Dropped two patches from the series, as they were not adding significant value suggested by Dan Carpenter. staging: rtl8192e: Fix coding style, this was fixing line over 80 characters. staging: rtl8192e: Fix unbalanced braces - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v3: - Split earlier patches into multiple commits for easy review as suggested by Greg K-H - Modified subject and description for better readability - Rebased on top of next-20170310 - Patches were tested and built on next-20170310 and staging-testing as suggested by Greg K-H, no errors reported Changes for v2: - Improve error handling reported by checkpatch.pl in rtl_core.c - new patch addition to the series - Rebased on top of next-20170306 --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index a648064..f00ee3b 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -971,8 +971,8 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) priv->pFirmware = vzalloc(sizeof(struct rt_firmware)); if (!priv->pFirmware) - netdev_err(dev, - "rtl8192e: Unable to allocate space for firmware\n"); + return; + skb_queue_head_init(&priv->skb_queue); for (i = 0; i < MAX_QUEUE_SIZE; i++) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v5 1/6] staging: rtl8192e: Fix comments as per kernel coding style
From: Suniel Mahesh Fixed the following checkpatch.pl warnings: Block comments should align the * on each line Block comments use * on subsequent lines Signed-off-by: Suniel Mahesh --- Changes for v5: - Changed email address from suni...@techveda.org to suniel.spar...@gmail.com, reason being few patches were being dropped and not getting delivered, couldn't resolve that issue - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v4: - Dropped two patches from the series, as they were not adding significant value suggested by Dan Carpenter. staging: rtl8192e: Fix coding style, this was fixing line over 80 characters. staging: rtl8192e: Fix unbalanced braces - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v3: - Split earlier patches into multiple commits for easy review as suggested by Greg K-H - Modified subject and description for better readability - Rebased on top of next-20170310 - Patches were tested and built on next-20170310 and staging-testing as suggested by Greg K-H, no errors reported Changes for v2: - Split larger patch into multiple commits as suggested by Dan Carpenter - This patch fixes coding style issues, comments in rtl_core.c reported by checkpatch.pl - Modified short description to 'Fix coding style issues' from 'Fix coding style issues, improve error handling' - Improve error handling is taken care by the following patch in the series - Removed statements, 'Return -ENOMEM, if it is out of memory', 'Pointer comparison with NULL replaced by logical NOT' from the body of the patch - Rebased on top of next-20170306 --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 61 ++-- 1 file changed, 22 insertions(+), 39 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 4c0caa6..a648064 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -1,4 +1,4 @@ -/** +/* * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. * * Based on the r8180 driver, which is: @@ -17,7 +17,7 @@ * * Contact Information: * wlanfae -**/ + */ #include #include #include @@ -75,12 +75,12 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev, static irqreturn_t _rtl92e_irq(int irq, void *netdev); static struct pci_driver rtl8192_pci_driver = { - .name = DRV_NAME, /* Driver name */ - .id_table = rtl8192_pci_id_tbl, /* PCI_ID table */ - .probe = _rtl92e_pci_probe,/* probe fn */ - .remove = _rtl92e_pci_disconnect, /* remove fn */ - .suspend = rtl92e_suspend, /* PM suspend fn */ - .resume = rtl92e_resume, /* PM resume fn */ + .name = DRV_NAME, + .id_table = rtl8192_pci_id_tbl, + .probe = _rtl92e_pci_probe, + .remove = _rtl92e_pci_disconnect, + .suspend = rtl92e_suspend, + .resume = rtl92e_resume, }; static short _rtl92e_is_tx_queue_empty(struct net_device *dev); @@ -100,10 +100,7 @@ static void _rtl92e_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, static int _rtl92e_down(struct net_device *dev, bool shutdownrf); static void _rtl92e_restart(void *data); -/ - -IO STUFF- -*/ - +/* IO STUFF */ u8 rtl92e_readb(struct net_device *dev, int x) { return 0xff & readb((u8 __iomem *)dev->mem_start + x); @@ -140,9 +137,7 @@ void rtl92e_writew(struct net_device *dev, int x, u16 y) udelay(20); } -/ - -GENERAL FUNCTION- -*/ +/* GENERAL FUNCTION */ bool rtl92e_set_rf_state(struct net_device *dev, enum rt_rf_power_state StateToSet, RT_RF_CHANGE_SOURCE ChangeSource) @@ -978,7 +973,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) if (!priv->pFirmware) netdev_err(dev, "rtl8192e: Unable to allocate space for firmware\n"); - skb_queue_head_init(&priv->skb_queue); for (i = 0; i < MAX_QUEUE_SIZE; i++) @@ -1101,9 +1095,7 @@ static short _rtl92e_init(struct net_device *dev) return 0; } -/*** - ---WATC
[PATCH v5 5/6] staging: rtl8192e: Fix issues reported by checkpatch.pl
From: Suniel Mahesh Fixed the following checkpatch.pl checks: spaces preferred around that 'operator', spacing provided Logical continuations should be on the previous line, modified accordingly Unnecessary parentheses around variables, removed Please use a blank line after function/struct/union/enum declarations, used Signed-off-by: Suniel Mahesh --- Changes for v5: - Changed email address from suni...@techveda.org to suniel.spar...@gmail.com, reason being few patches were being dropped and not getting delivered, couldn't resolve that issue - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v4: - Dropped two patches from the series, as they were not adding significant value suggested by Dan Carpenter. staging: rtl8192e: Fix coding style, this was fixing line over 80 characters. staging: rtl8192e: Fix unbalanced braces - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v3: - Split earlier patches into multiple commits for easy review as suggested by Greg K-H - New patch addition to the series - Rebased on top of next-20170310 - Patches were tested and built on next-20170310 and staging-testing as suggested by Greg K-H, no errors reported Changes for v2: --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 46 +++- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 999af05..1d22f18 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -341,7 +341,7 @@ static void _rtl92e_update_cap(struct net_device *dev, u16 cap) } } - if (net->mode & (IEEE_G|IEEE_N_24G)) { + if (net->mode & (IEEE_G | IEEE_N_24G)) { u8 slot_time_val; u8 CurSlotTime = priv->slot_time; @@ -675,7 +675,7 @@ static u8 _rtl92e_get_supported_wireless_mode(struct net_device *dev) case RF_8256: case RF_6052: case RF_PSEUDO_11N: - ret = (WIRELESS_MODE_N_24G|WIRELESS_MODE_G | WIRELESS_MODE_B); + ret = (WIRELESS_MODE_N_24G | WIRELESS_MODE_G | WIRELESS_MODE_B); break; case RF_8258: ret = (WIRELESS_MODE_A | WIRELESS_MODE_N_5G); @@ -737,7 +737,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset) { struct r8192_priv *priv = rtllib_priv(dev); struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) - (&(priv->rtllib->PowerSaveControl)); + (&priv->rtllib->PowerSaveControl); bool init_status = true; priv->bDriverIsGoingToUnload = false; @@ -883,7 +883,7 @@ static void _rtl92e_init_priv_constant(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) - &(priv->rtllib->PowerSaveControl); + &priv->rtllib->PowerSaveControl; pPSC->RegMaxLPSAwakeIntvl = 5; } @@ -1009,9 +1009,9 @@ static void _rtl92e_init_priv_task(struct net_device *dev) (void *)_rtl92e_update_beacon, dev); INIT_WORK_RSL(&priv->qos_activate, (void *)_rtl92e_qos_activate, dev); INIT_DELAYED_WORK_RSL(&priv->rtllib->hw_wakeup_wq, - (void *) rtl92e_hw_wakeup_wq, dev); + (void *)rtl92e_hw_wakeup_wq, dev); INIT_DELAYED_WORK_RSL(&priv->rtllib->hw_sleep_wq, - (void *) rtl92e_hw_sleep_wq, dev); + (void *)rtl92e_hw_sleep_wq, dev); tasklet_init(&priv->irq_rx_tasklet, (void(*)(unsigned long))_rtl92e_irq_rx_tasklet, (unsigned long)priv); @@ -1029,8 +1029,8 @@ static short _rtl92e_get_channel_map(struct net_device *dev) struct r8192_priv *priv = rtllib_priv(dev); - if ((priv->rf_chip != RF_8225) && (priv->rf_chip != RF_8256) - && (priv->rf_chip != RF_6052)) { + if ((priv->rf_chip != RF_8225) && (priv->rf_chip != RF_8256) && + (priv->rf_chip != RF_6052)) { netdev_err(dev, "%s: unknown rf chip, can't set channel map\n", __func__); return -1; @@ -1056,7 +1056,7 @@ static short _rtl92e_init(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); - memset(&(priv->stats), 0, sizeof(struct rt_stats)); + memset(&priv->stats, 0, sizeof(struct rt_stats)); _rtl92e_init_priv_handler(dev); _rtl92e_init_priv_constant(dev); @@ -1071,7 +1071,7 @@ sta
[PATCH v5 6/6] staging: rtl8192e: Fix blank lines and space after a cast
From: Suniel Mahesh Fixed the following checkpatch.pl checks: Blank lines aren't necessary after an open brace '{' and before a close brace '}', removed No space is necessary after a cast, removed Please don't use multiple blank lines, removed Signed-off-by: Suniel Mahesh --- Changes for v5: - Changed email address from suni...@techveda.org to suniel.spar...@gmail.com, reason being few patches were being dropped and not getting delivered, couldn't resolve that issue - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v4: - Dropped two patches from the series, as they were not adding significant value suggested by Dan Carpenter. staging: rtl8192e: Fix coding style, this was fixing line over 80 characters. staging: rtl8192e: Fix unbalanced braces - Resending the whole series as requested by Greg K-H - Patches were tested and built on next-20170310 and staging-testing Changes for v3: - Split earlier patches into multiple commits for easy review as suggested by Greg K-H - New patch addition to the series - Rebased on top of next-20170310 - Patches were tested and built on next-20170310 and staging-testing as suggested by Greg K-H, no errors reported Changes for v2: --- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 26 -- 1 file changed, 26 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 1d22f18..bc2c732 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -37,7 +37,6 @@ static int channels = 0x3fff; static char *ifname = "wlan%d"; - static const struct rtl819x_ops rtl819xp_ops = { .nic_type = NIC_8192E, .get_eeprom_size= rtl92e_get_eeprom_size, @@ -195,7 +194,6 @@ bool rtl92e_set_rf_state(struct net_device *dev, priv->rtllib->RfOffReason = 0; bActionAllowed = true; - if (rtState == eRfOff && ChangeSource >= RF_CHANGE_BY_HW) bConnectBySSID = true; @@ -242,7 +240,6 @@ bool rtl92e_set_rf_state(struct net_device *dev, StateToSet, priv->rtllib->RfOffReason); PHY_SetRFPowerState(dev, StateToSet); if (StateToSet == eRfOn) { - if (bConnectBySSID && priv->blinked_ingpio) { schedule_delayed_work( &ieee->associate_procedure_wq, 0); @@ -401,8 +398,6 @@ static void _rtl92e_qos_activate(void *data) for (i = 0; i < QOS_QUEUE_NUM; i++) priv->rtllib->SetHwRegHandler(dev, HW_VAR_AC_PARAM, (u8 *)(&i)); - - success: mutex_unlock(&priv->mutex); } @@ -462,7 +457,6 @@ static int _rtl92e_handle_beacon(struct net_device *dev, schedule_delayed_work(&priv->update_beacon_wq, 0); return 0; - } static int _rtl92e_qos_assoc_resp(struct r8192_priv *priv, @@ -888,7 +882,6 @@ static void _rtl92e_init_priv_constant(struct net_device *dev) pPSC->RegMaxLPSAwakeIntvl = 5; } - static void _rtl92e_init_priv_variable(struct net_device *dev) { struct r8192_priv *priv = rtllib_priv(dev); @@ -1211,7 +1204,6 @@ static enum reset_type _rtl92e_if_check_reset(struct net_device *dev) } else { return RESET_TYPE_NORESET; } - } static void _rtl92e_if_silent_reset(struct net_device *dev) @@ -1223,7 +1215,6 @@ static void _rtl92e_if_silent_reset(struct net_device *dev) unsigned long flag; if (priv->ResetProgress == RESET_TYPE_NORESET) { - RT_TRACE(COMP_RESET, "=>Reset progress!!\n"); priv->ResetProgress = RESET_TYPE_SILENT; @@ -1417,7 +1408,6 @@ static void _rtl92e_watchdog_wq_cb(void *data) ieee->LinkDetectInfo.NumTxOkInPeriod > 100) bBusyTraffic = true; - if (ieee->LinkDetectInfo.NumRxOkInPeriod > 4000 || ieee->LinkDetectInfo.NumTxOkInPeriod > 4000) { bHigherBusyTraffic = true; @@ -1466,7 +1456,6 @@ static void _rtl92e_watchdog_wq_cb(void *data) else priv->check_roaming_cnt = 0; - if (priv->check_roaming_cnt > 0) { if (ieee->eRFPowerState == eRfOff) netdev_info(dev, "%s(): RF is off\n", __func__); @@ -1497,7 +1486,6 @@ static void _rtl92e_watchdog_wq_cb(void *data) } ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0; ieee->LinkDetectInfo.NumRecvDataInPeriod = 0; - } spin_lock_irqsave(&priv->tx_lock, flags); @@ -1549,7 +1537,6 @@ void rtl92e_tx_enable(struct net_device *dev) rtllib_reset_queue(priv->rtl
Re: [PATCH 2/5] staging: bcm2835-camera: Fix integer underrun in port_parameter_get
You're fixing a bug you introduced in [PATCH 1/5]. Don't do that. Just fix Dave's patch and add a note in the commit log. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5 00/39] i.MX Media Driver
On 2017-03-20 16:57:54 +0100, Hans Verkuil wrote: > On 03/20/2017 03:11 PM, Russell King - ARM Linux wrote: > > On Mon, Mar 20, 2017 at 02:57:03PM +0100, Hans Verkuil wrote: > >> On 03/20/2017 02:29 PM, Russell King - ARM Linux wrote: > >>> It's what I have - remember, not everyone is happy to constantly replace > >>> their distro packages with random new stuff. > >> > >> This is a compliance test, which is continuously developed in tandem with > >> new kernel versions. If you are working with an upstream kernel, then you > >> should also use the corresponding v4l2-compliance test. What's the point > >> of using an old one? > >> > >> I will not support driver developers that use an old version of the > >> compliance test, that's a waste of my time. > > > > The reason that people may _not_ wish to constantly update v4l-utils > > is that it changes the libraries installed on their systems. > > > > So, the solution to that is not to complain about developers not using > > the latest version, but instead to de-couple it from the rest of the > > package, and provide it as a separate, stand-alone package that doesn't > > come with all the extra baggage. > > > > Now, there's two possible answers to that: > > > > 1. it depends on the libv4l2 version. If that's so, then you are > >insisting that people constantly move to the latest libv4l2 because > >of API changes, and those API changes may upset applications they're > >using. So this isn't really on. > > > > 2. it doesn't depend on libv4l2 version, in which case there's no reason > >for it to be packaged with v4l-utils. > > Run configure with --disable-v4l2-compliance-libv4l. > > This avoids linking with libv4l and allows you to build it stand-alone. > > Perhaps I should invert this option since in most cases you don't want to > run v4l2-compliance with libv4l (it's off by default unless you pass the > -w option to v4l2-compliance). > > > > > The reality is that v4l2-compliance links with libv4l2, so I'm not sure > > which it is. What I am sure of is that I don't want to upgrade libv4l2 > > on an ad-hoc basis, potentially causing issues with applications. > > > To test actual streaming you need to provide the -s option. > > Note: v4l2-compliance has been developed for 'regular' video devices, > not MC devices. It may or may not work with the -s option. > >>> > >>> Right, and it exists to verify that the establised v4l2 API is correctly > >>> implemented. If the v4l2 API is being offered to user applications, > >>> then it must be conformant, otherwise it's not offering the v4l2 API. > >>> (That's very much a definition statement in itself.) > >>> > >>> So, are we really going to say MC devices do not offer the v4l2 API to > >>> userspace, but something that might work? We've already seen today > >>> one user say that they're not going to use mainline because of the > >>> crud surrounding MC. > >>> > >> > >> Actually, my understanding was that he was stuck on the old kernel code. > > > > Err, sorry, I really don't follow. Who is "he"? > > "one user say that they're not going to use mainline because of the > crud surrounding MC." > > > > > _I_ was the one who reported the EXPBUF problem. Your comment makes no > > sense. > > > >> In the case of v4l2-compliance, I never had the time to make it work with > >> MC devices. Same for that matter of certain memory to memory devices. > >> > >> Just like MC devices these too behave differently. They are partially > >> supported in v4l2-compliance, but not fully. > > > > It seems you saying that the API provided by /dev/video* for a MC device > > breaks the v4l2-compliance tests? > > There may be tests in the compliance suite that do not apply for MC devices > and for which I never check. The compliance suite was never written with MC > devices in mind, and it certainly hasn't been tested much with such devices. > > It's only very recent that I even got hardware that has MC support... > > From what I can tell from the feedback I got it seems to be OKish, but I > just can't guarantee that the compliance utility is correct for such devices. > > In particular I doubt the streaming tests (-s, -f, etc.) will work. The -s > test *might* work if the pipeline is configured correctly before running > v4l2-compliance. I can't imagine that the -f option would work at all since > I would expect pipeline validation errors. I successfully use v4l2-compliance with the -s option to test the Renesas R-Car Gen3 driver which uses MC, I first have to setup the pipeline using media-ctl. I have had much use of the tool and it have helped me catch many errors in the rcar-vin driver both on Gen2 (no MC involved) and Gen3. And yes the -f option is only usable on Gen2 where MC is not used. For what it's worth, the first versions of the R-Car Gen3 patches did not use MC for anything else then setting up the pipeline, all format propagation and communication with subdevice where do
Re: [PATCH v5 00/39] i.MX Media Driver
On 03/21/17 11:42, Niklas Söderlund wrote: > On 2017-03-20 16:57:54 +0100, Hans Verkuil wrote: >> On 03/20/2017 03:11 PM, Russell King - ARM Linux wrote: >>> On Mon, Mar 20, 2017 at 02:57:03PM +0100, Hans Verkuil wrote: On 03/20/2017 02:29 PM, Russell King - ARM Linux wrote: > It's what I have - remember, not everyone is happy to constantly replace > their distro packages with random new stuff. This is a compliance test, which is continuously developed in tandem with new kernel versions. If you are working with an upstream kernel, then you should also use the corresponding v4l2-compliance test. What's the point of using an old one? I will not support driver developers that use an old version of the compliance test, that's a waste of my time. >>> >>> The reason that people may _not_ wish to constantly update v4l-utils >>> is that it changes the libraries installed on their systems. >>> >>> So, the solution to that is not to complain about developers not using >>> the latest version, but instead to de-couple it from the rest of the >>> package, and provide it as a separate, stand-alone package that doesn't >>> come with all the extra baggage. >>> >>> Now, there's two possible answers to that: >>> >>> 1. it depends on the libv4l2 version. If that's so, then you are >>>insisting that people constantly move to the latest libv4l2 because >>>of API changes, and those API changes may upset applications they're >>>using. So this isn't really on. >>> >>> 2. it doesn't depend on libv4l2 version, in which case there's no reason >>>for it to be packaged with v4l-utils. >> >> Run configure with --disable-v4l2-compliance-libv4l. >> >> This avoids linking with libv4l and allows you to build it stand-alone. >> >> Perhaps I should invert this option since in most cases you don't want to >> run v4l2-compliance with libv4l (it's off by default unless you pass the >> -w option to v4l2-compliance). >> >>> >>> The reality is that v4l2-compliance links with libv4l2, so I'm not sure >>> which it is. What I am sure of is that I don't want to upgrade libv4l2 >>> on an ad-hoc basis, potentially causing issues with applications. >>> >> To test actual streaming you need to provide the -s option. >> >> Note: v4l2-compliance has been developed for 'regular' video devices, >> not MC devices. It may or may not work with the -s option. > > Right, and it exists to verify that the establised v4l2 API is correctly > implemented. If the v4l2 API is being offered to user applications, > then it must be conformant, otherwise it's not offering the v4l2 API. > (That's very much a definition statement in itself.) > > So, are we really going to say MC devices do not offer the v4l2 API to > userspace, but something that might work? We've already seen today > one user say that they're not going to use mainline because of the > crud surrounding MC. > Actually, my understanding was that he was stuck on the old kernel code. >>> >>> Err, sorry, I really don't follow. Who is "he"? >> >> "one user say that they're not going to use mainline because of the >> crud surrounding MC." >> >>> >>> _I_ was the one who reported the EXPBUF problem. Your comment makes no >>> sense. >>> In the case of v4l2-compliance, I never had the time to make it work with MC devices. Same for that matter of certain memory to memory devices. Just like MC devices these too behave differently. They are partially supported in v4l2-compliance, but not fully. >>> >>> It seems you saying that the API provided by /dev/video* for a MC device >>> breaks the v4l2-compliance tests? >> >> There may be tests in the compliance suite that do not apply for MC devices >> and for which I never check. The compliance suite was never written with MC >> devices in mind, and it certainly hasn't been tested much with such devices. >> >> It's only very recent that I even got hardware that has MC support... >> >> From what I can tell from the feedback I got it seems to be OKish, but I >> just can't guarantee that the compliance utility is correct for such devices. >> >> In particular I doubt the streaming tests (-s, -f, etc.) will work. The -s >> test *might* work if the pipeline is configured correctly before running >> v4l2-compliance. I can't imagine that the -f option would work at all since >> I would expect pipeline validation errors. > > I successfully use v4l2-compliance with the -s option to test the > Renesas R-Car Gen3 driver which uses MC, I first have to setup the > pipeline using media-ctl. I have had much use of the tool and it have > helped me catch many errors in the rcar-vin driver both on Gen2 (no MC > involved) and Gen3. And yes the -f option is only usable on Gen2 where > MC is not used. Ah, good to hear that -s works with MC. I was not sure about that. Thanks for the feedback! Regards, Hans _
Re: [PATCH v4 14/36] [media] v4l2-mc: add a function to inherit controls from a pipeline
Hi! > > Making use of the full potential of the hardware requires using a more > > expressive interface. > > That's the core of the problem: most users don't need "full potential > of the hardware". It is actually worse than that: several boards > don't allow "full potential" of the SoC capabilities. Well, in kernel we usually try to support "full hardware" potential. And we are pretty sure users would like to take still photos, even if common v4l2 applications can not do it. > > That's what the kernel interface must provide. If > > we decide to limit ourselves to a small sub-set of that potential on the > > level of the kernel interface, we have made a wrong decision. It's as > > simple as that. This is why the functionality (and which requires taking > > a lot of policy decisions) belongs to the user space. We cannot have > > multiple drivers providing multiple kernel interfaces for the same hardware. > > I strongly disagree. Looking only at the hardware capabilities without > having a solution to provide what the user wants is *wrong*. Hardware manufacturers already did this kind of research for us. They don't usually include features noone wants... > Another case: the cx25821 hardware supports 12 video streams, > consuming almost all available bandwidth of an ePCI bus. Each video > stream connector can either be configured to be capture or output, in > runtime. The hardware vendor chose to hardcode the driver to provide > 8 inputs and 4 outputs. Their decision was based in the fact that > the driver is already very complex, and it satisfies their customer's > needs. The cost/efforts of make the driver to be reconfigured in > runtime were too high for almost no benefit. Well, it is okay to provide 'limited' driver -- there's possibility to fix the driver. But IMO it is not okay to provide 'limited' kernel interface -- because if you try to fix it, you'll suddenly have regressions. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html signature.asc Description: Digital signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] Remove Typrdefs
Typedefs are removed in sm750fb driver. Arushi Singhal (2): staging: sm750fb: Remove typedefs from struct staging: sm750fb: Remove typedefs from enum drivers/staging/sm750fb/ddk750_mode.c | 8 +--- drivers/staging/sm750fb/ddk750_mode.h | 19 --- drivers/staging/sm750fb/sm750_hw.c| 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: sm750fb: Remove typedefs from struct
This patch removes typedefs from structure and renames them as per kernel coding standards. Signed-off-by: Arushi Singhal --- drivers/staging/sm750fb/ddk750_mode.c | 8 +--- drivers/staging/sm750fb/ddk750_mode.h | 8 +++- drivers/staging/sm750fb/sm750_hw.c| 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index 37b5d4850fb9..bb673e18999b 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -12,7 +12,8 @@ * HW only supports 7 predefined pixel clocks, and clock select is * in bit 29:27 of Display Control register. */ -static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, unsigned long dispControl) +static unsigned long displayControlAdjust_SM750LE(struct mode_parameter *pModeParam, + unsigned long dispControl) { unsigned long x, y; @@ -72,7 +73,8 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, } /* only timing related registers will be programed */ -static int programModeRegisters(mode_parameter_t *pModeParam, struct pll_value *pll) +static int programModeRegisters(struct mode_parameter *pModeParam, + struct pll_value *pll) { int ret = 0; int cnt = 0; @@ -203,7 +205,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, struct pll_value * return ret; } -int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock) +int ddk750_setModeTiming(struct mode_parameter *parm, clock_type_t clock) { struct pll_value pll; unsigned int uiActualPixelClk; diff --git a/drivers/staging/sm750fb/ddk750_mode.h b/drivers/staging/sm750fb/ddk750_mode.h index 6d204b8b4a01..9dc4d6c5a779 100644 --- a/drivers/staging/sm750fb/ddk750_mode.h +++ b/drivers/staging/sm750fb/ddk750_mode.h @@ -9,7 +9,7 @@ typedef enum _spolarity_t { } spolarity_t; -typedef struct _mode_parameter_t { +struct mode_parameter { /* Horizontal timing. */ unsigned long horizontal_total; unsigned long horizontal_display_end; @@ -31,9 +31,7 @@ typedef struct _mode_parameter_t { /* Clock Phase. This clock phase only applies to Panel. */ spolarity_t clock_phase_polarity; -} -mode_parameter_t; - -int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock); +}; +int ddk750_setModeTiming(struct mode_parameter *parm, clock_type_t clock); #endif diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index fab3fc9c8330..baf1bbdc92ff 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -252,7 +252,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, { int ret, fmt; u32 reg; - mode_parameter_t modparm; + struct mode_parameter modparm; clock_type_t clock; struct sm750_dev *sm750_dev; struct lynxfb_par *par; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: sm750fb: Remove typedefs from enum
This patch removes typedefs from enum and renames them as per kernel coding standards. Signed-off-by: Arushi Singhal --- drivers/staging/sm750fb/ddk750_mode.h | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_mode.h b/drivers/staging/sm750fb/ddk750_mode.h index 9dc4d6c5a779..d5eae36d85cb 100644 --- a/drivers/staging/sm750fb/ddk750_mode.h +++ b/drivers/staging/sm750fb/ddk750_mode.h @@ -3,11 +3,10 @@ #include "ddk750_chip.h" -typedef enum _spolarity_t { +enum spolarity { POS = 0, /* positive */ NEG, /* negative */ -} -spolarity_t; +}; struct mode_parameter { /* Horizontal timing. */ @@ -15,14 +14,14 @@ struct mode_parameter { unsigned long horizontal_display_end; unsigned long horizontal_sync_start; unsigned long horizontal_sync_width; - spolarity_t horizontal_sync_polarity; + enum spolarity horizontal_sync_polarity; /* Vertical timing. */ unsigned long vertical_total; unsigned long vertical_display_end; unsigned long vertical_sync_start; unsigned long vertical_sync_height; - spolarity_t vertical_sync_polarity; + enum spolarity vertical_sync_polarity; /* Refresh timing. */ unsigned long pixel_clock; @@ -30,7 +29,7 @@ struct mode_parameter { unsigned long vertical_frequency; /* Clock Phase. This clock phase only applies to Panel. */ - spolarity_t clock_phase_polarity; + enum spolarity clock_phase_polarity; }; int ddk750_setModeTiming(struct mode_parameter *parm, clock_type_t clock); -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in sink set_fmt
On Mon, Mar 20, 2017 at 06:23:24PM +0100, Philipp Zabel wrote: > @@ -1173,15 +1196,8 @@ static void csi_try_fmt(struct csi_priv *priv, > incc = imx_media_find_mbus_format(infmt->code, > CS_SEL_ANY, true); > > - if (sdformat->format.width < priv->crop.width * 3 / 4) > - sdformat->format.width = priv->crop.width / 2; > - else > - sdformat->format.width = priv->crop.width; > - > - if (sdformat->format.height < priv->crop.height * 3 / 4) > - sdformat->format.height = priv->crop.height / 2; > - else > - sdformat->format.height = priv->crop.height; > + sdformat->format.width = compose->width; > + sdformat->format.height = compose->height; > > if (incc->bayer) { > sdformat->format.code = infmt->code; We need to do more in here, because right now setting the source pads overwrites the colorimetry etc information. Maybe something like the below? I'm wondering if it would be a saner approach to copy the sink format and update the parameters that can be changed, rather than trying to list all the parameters that shouldn't be changed. What if the format structure gains a new member? diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index 1492b92e1970..756204ced53c 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1221,6 +1221,12 @@ static void csi_try_fmt(struct csi_priv *priv, sdformat->format.field = (infmt->height == 480) ? V4L2_FIELD_SEQ_TB : V4L2_FIELD_SEQ_BT; } + + /* copy settings we can't change */ + sdformat->format.colorspace = infmt->colorspace; + sdformat->format.ycbcr_enc = infmt->ycbcr_enc; + sdformat->format.quantization = infmt->quantization; + sdformat->format.xfer_func = infmt->xfer_func; break; case CSI_SINK_PAD: v4l_bound_align_image(&sdformat->format.width, MIN_W, MAX_W, -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/5] staging: bcm2835-camera: Fix integer underrun in port_parameter_get
On Tue, 2017-03-21 at 13:41 +0300, Dan Carpenter wrote: > You're fixing a bug you introduced in [PATCH 1/5]. Don't do > that. Just > fix Dave's patch and add a note in the commit log. > > regards, > dan carpenter > OK, thanks I'm still learning about the whole process. It looks like Dave's version has already been applied though. I just want to have as much as possible a separation between what I'm passing upstream from the github(as a favor to him mostly) just to keep the two trees in sync, and what I'm submitting. I don't want the logs to get too mixed up. It's just a personal thing. The sound driver enhancements where 100% original for example. I wrote all of that. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5 00/39] i.MX Media Driver
On Tue, Mar 21, 2017 at 11:59:02AM +0100, Hans Verkuil wrote: > Ah, good to hear that -s works with MC. I was not sure about that. > Thanks for the feedback! Not soo good on iMX6: $ v4l2-compliance -d /dev/video10 -s --expbuf-device=/dev/video0 ... Input ioctls: test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported) fail: v4l2-test-input-output.cpp(420): G_INPUT not supported for a capture device test VIDIOC_G/S/ENUMINPUT: FAIL test VIDIOC_G/S_AUDIO: OK (Not Supported) Inputs: 0 Audio Inputs: 0 Tuners: 0 ... Control ioctls: test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK test VIDIOC_QUERYCTRL: OK test VIDIOC_G/S_CTRL: OK test VIDIOC_G/S/TRY_EXT_CTRLS: OK fail: v4l2-test-controls.cpp(782): subscribe event for control 'User Controls' failed test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL ... Streaming ioctls: test read/write: OK (Not Supported) fail: v4l2-test-buffers.cpp(297): g_field() == V4L2_FIELD_ANY fail: v4l2-test-buffers.cpp(703): buf.check(q, last_seq) fail: v4l2-test-buffers.cpp(973): captureBufs(node, q, m2m_q, frame_count, false) test MMAP: FAIL test USERPTR: OK (Not Supported) fail: v4l2-test-buffers.cpp(1188): can_stream && ret != EINVAL test DMABUF: FAIL (/dev/video0 being CODA). CODA itself seems to have failures: Format ioctls: test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK warn: v4l2-test-formats.cpp(1187): S_PARM is supported for buftype 2, but not ENUM_FRAMEINTERVALS warn: v4l2-test-formats.cpp(1194): S_PARM is supported but doesn't report V4L2_CAP_TIMEPERFRAME test VIDIOC_G/S_PARM: OK test VIDIOC_G_FBUF: OK (Not Supported) test VIDIOC_G_FMT: OK test VIDIOC_TRY_FMT: OK fail: v4l2-test-formats.cpp(774): fmt_out.g_colorspace() != col ... Streaming ioctls: test read/write: OK (Not Supported) fail: v4l2-test-buffers.cpp(956): q.create_bufs(node, 1, &fmt) != EINVAL test MMAP: FAIL test USERPTR: OK (Not Supported) test DMABUF: Cannot test, specify --expbuf-device -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RESEND PATCH 00/11] staging:speakup: Multiple Checkpatch issues.
Improve readability by fixing multiple checkpatch.pl issues in speakup driver. Arushi Singhal (11): staging: speakup: Moved logical to previous line. staging: speakup: Remove multiple assignments staging: speakup: Simplify "NULL" comparisons staging: speakup: fixes braces {} should be used on all arms of this statement staging: speakup: Remove multiple assignments staging: speakup: Moved OR operator to previous line. staging: speakup: spaces preferred around operator staging: speakup: Removed Unnecessary parentheses. staging: speakup: Simplify the NULL comparisons staging: speakup: Match alignment with open parenthesis. staging: speakup: Fix alignment with parenthesis. drivers/staging/speakup/fakekey.c| 2 +- drivers/staging/speakup/kobjects.c | 2 +- drivers/staging/speakup/main.c | 110 +-- drivers/staging/speakup/selection.c | 4 +- drivers/staging/speakup/serialio.c | 2 +- drivers/staging/speakup/speakup.h| 12 ++-- drivers/staging/speakup/speakup_acntpc.c | 8 +-- drivers/staging/speakup/speakup_apollo.c | 2 +- drivers/staging/speakup/speakup_decext.c | 10 +-- drivers/staging/speakup/speakup_decpc.c | 26 drivers/staging/speakup/speakup_dectlk.c | 6 +- drivers/staging/speakup/speakup_dtlk.c | 2 +- drivers/staging/speakup/speakup_keypc.c | 6 +- drivers/staging/speakup/speakup_ltlk.c | 2 +- drivers/staging/speakup/varhandlers.c| 18 ++--- 15 files changed, 114 insertions(+), 98 deletions(-) -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/11] staging: speakup: Moved logical to previous line.
Moved logical operator to previous line to fix the following checkpatch issue: CHECK: Logical continuations should be on the previous line. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/main.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index f280e22d7e15..f71206878363 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -905,8 +905,8 @@ static int get_sentence_buf(struct vc_data *vc, int read_punc) while (start < end) { sentbuf[bn][i] = get_char(vc, (u_short *)start, &tmp); if (i > 0) { - if (sentbuf[bn][i] == SPACE && sentbuf[bn][i - 1] == '.' - && numsentences[bn] < 9) { + if (sentbuf[bn][i] == SPACE && sentbuf[bn][i - 1] == '.' && + numsentences[bn] < 9) { /* Sentence Marker */ numsentences[bn]++; sentmarks[bn][numsentences[bn]] = @@ -1292,8 +1292,8 @@ void spk_reset_default_chars(void) /* First, free any non-default */ for (i = 0; i < 256; i++) { - if ((spk_characters[i] != NULL) - && (spk_characters[i] != spk_default_chars[i])) + if (spk_characters[i] && + (spk_characters[i] != spk_default_chars[i])) kfree(spk_characters[i]); } @@ -2088,8 +2088,8 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym, tty = vc->port.tty; if (type >= 0xf0) type -= 0xf0; - if (type == KT_PAD - && (vt_get_leds(fg_console, VC_NUMLOCK))) { + if (type == KT_PAD && + (vt_get_leds(fg_console, VC_NUMLOCK))) { if (up_flag) { spk_keydown = 0; goto out; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/11] staging: speakup: Simplify "NULL" comparisons
Fixed coding style for null comparisons in speakup driver to be more consistant with the rest of the kernel coding style. Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/selection.c | 2 +- drivers/staging/speakup/varhandlers.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c index afd9a446a06f..4417c00e68a7 100644 --- a/drivers/staging/speakup/selection.c +++ b/drivers/staging/speakup/selection.c @@ -175,7 +175,7 @@ static struct speakup_paste_work speakup_paste_work = { int speakup_paste_selection(struct tty_struct *tty) { - if (cmpxchg(&speakup_paste_work.tty, NULL, tty) != NULL) + if (cmpxchg(&speakup_paste_work.tty, NULL, tty)) return -EBUSY; tty_kref_get(tty); diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index cc984196020f..5910fe0b1365 100644 --- a/drivers/staging/speakup/varhandlers.c +++ b/drivers/staging/speakup/varhandlers.c @@ -98,7 +98,7 @@ void speakup_register_var(struct var_t *var) } } p_header = var_ptrs[var->var_id]; - if (p_header->data != NULL) + if (p_header->data) return; p_header->data = var; switch (p_header->var_type) { @@ -210,11 +210,11 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) return -ERANGE; var_data->u.n.value = val; - if (var->var_type == VAR_TIME && p_val != NULL) { + if (var->var_type == VAR_TIME && p_val) { *p_val = msecs_to_jiffies(val); return 0; } - if (p_val != NULL) + if (p_val) *p_val = val; if (var->var_id == PUNC_LEVEL) { spk_punc_mask = spk_punc_masks[val]; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/11] staging: speakup: Remove multiple assignments
This patch fixes the checkpatch.pl warning "multiple assignments should be avoided." Signed-off-by: Arushi Singhal --- drivers/staging/speakup/main.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index f71206878363..f8fccc8bf6b2 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -270,9 +270,12 @@ static unsigned char get_attributes(struct vc_data *vc, u16 *pos) static void speakup_date(struct vc_data *vc) { - spk_x = spk_cx = vc->vc_x; - spk_y = spk_cy = vc->vc_y; - spk_pos = spk_cp = vc->vc_pos; + spk_x = vc->vc_x; + spk_cx = spk_x; + spk_y = vc->vc_y; + spk_cy = spk_y; + spk_pos = vc->vc_pos; + spk_cp = spk_pos; spk_old_attr = spk_attr; spk_attr = get_attributes(vc, (u_short *)spk_pos); } @@ -1655,9 +1658,12 @@ static int speak_highlight(struct vc_data *vc) spk_do_flush(); spkup_write(speakup_console[vc_num]->ht.highbuf[hc], speakup_console[vc_num]->ht.highsize[hc]); - spk_pos = spk_cp = speakup_console[vc_num]->ht.rpos[hc]; - spk_x = spk_cx = speakup_console[vc_num]->ht.rx[hc]; - spk_y = spk_cy = speakup_console[vc_num]->ht.ry[hc]; + spk_pos = speakup_console[vc_num]->ht.rpos[hc]; + spk_cp = spk_pos; + spk_x = speakup_console[vc_num]->ht.rx[hc]; + spk_cx = spk_x; + spk_y = speakup_console[vc_num]->ht.ry[hc]; + spk_cy = spk_y; return 1; } return 0; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/11] staging: speakup: Remove multiple assignments
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 21e76b031449..c10445624e92 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -2106,7 +2106,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 04/11] staging: speakup: fixes braces {} should be used on all arms of this statement
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 | 35 +++- 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, 37 insertions(+), 28 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index f8fccc8bf6b2..21e76b031449 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -409,8 +409,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)); } @@ -643,8 +644,9 @@ static void say_prev_word(struct vc_data *vc) break; spk_y--; spk_x = vc->vc_cols - 1; - } else + } else { spk_x--; + } spk_pos -= 2; ch = get_char(vc, (u_short *)spk_pos, &temp); if (ch == SPACE || ch == 0) @@ -697,8 +699,9 @@ static void say_next_word(struct vc_data *vc) spk_y++; spk_x = 0; edge_said = edge_right; - } else + } else { spk_x++; + } spk_pos += 2; last_state = state; } @@ -729,8 +732,9 @@ static void spell_word(struct vc_data *vc) spk_pitch_shift++; else/* synth has no pitch */ last_cap = spk_str_caps_stop; - } else + } else { str_cap = spk_str_caps_stop; + } if (str_cap != last_cap) { synth_printf("%s", str_cap); last_cap = str_cap; @@ -1343,8 +1347,9 @@ static int speakup_allocate(struct vc_data *vc) if (!speakup_console[vc_num]) return -ENOMEM; speakup_date(vc); - } else if (!spk_parked) + } else if (!spk_parked) { speakup_date(vc); + } return 0; } @@ -1397,9 +1402,9 @@ static void read_all_doc(struct vc_data *vc) prev_cursor_track = cursor_track; cursor_track = read_all_mode; spk_reset_index_count(0); - if (get_sentence_buf(vc, 0) == -1) + if (get_sentence_buf(vc, 0) == -1) { kbd_fakekey2(vc, RA_DOWN_ARROW); - else { + } else { say_sentence_num(0, 0); synth_insert_next_index(0); start_read_all_timer(vc, RA_TIMER); @@ -1446,8 +1451,9 @@ static void handle_cursor_read_all(struct vc_data *vc, int command) if (!say_sentence_num(sentcount + 1, 1)) { sn = 1; spk_reset_index_count(sn); - } else + } else { synth_insert_next_index(0); + } if (!say_sentence_num(sn, 0)) { kbd_fakekey2(vc, RA_FIND_NEXT_SENT); return; @@ -1476,9 +1482,9 @@ static void handle_cursor_read_all(struct vc_data *vc, int command) rv = get_sentence_buf(vc, 0); if (rv == -1) read_all_doc(vc); - if (rv == 0) + if (rv == 0) { kbd_fakekey2(vc, RA_FIND_NEXT_SENT); - else { + } else { say_sentence_num(1, 0); synth_insert_next_index(0); start_read_all_timer(vc, RA_TIMER); @@ -2177,10 +2183,11 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym, if (type == KT_SPEC && value == 1) { value = '\n'; type = KT_LATIN; - } else if (type == KT_LETTER) + } else if (type == KT_LETTER) { type = KT_LATIN; - else if (value == 0x7f) + } else if (value == 0x7f) { value = 8; /* make del = backspace */ + } ret = (*spk_special_handler) (vc, type, value, keycode); spk_close_press = 0; if (ret < 0) @@ -2274,9 +2281,9 @@ static int vt_notifier_call(struct notifier_block *n
[PATCH 09/11] staging: speakup: Simplify the NULL comparisons
Fixed coding style for null comparisons in speakup driver to be more consistant with the rest of the kernel coding style. Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/fakekey.c | 2 +- drivers/staging/speakup/main.c| 32 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/speakup/fakekey.c b/drivers/staging/speakup/fakekey.c index d76da0a1382c..294c74b47224 100644 --- a/drivers/staging/speakup/fakekey.c +++ b/drivers/staging/speakup/fakekey.c @@ -56,7 +56,7 @@ int speakup_add_virtual_keyboard(void) void speakup_remove_virtual_keyboard(void) { - if (virt_keyboard != NULL) { + if (virt_keyboard) { input_unregister_device(virt_keyboard); virt_keyboard = NULL; } diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index def1a36da9dd..7568e8149613 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -304,7 +304,7 @@ static void speakup_shut_up(struct vc_data *vc) spk_shut_up |= 0x01; spk_parked &= 0xfe; speakup_date(vc); - if (synth != NULL) + if (synth) spk_do_flush(); } @@ -449,7 +449,7 @@ static void speak_char(u16 ch) } cp = spk_characters[ch]; - if (cp == NULL) { + if (!cp) { pr_info("speak_char: cp == NULL!\n"); return; } @@ -1177,7 +1177,7 @@ static void do_handle_shift(struct vc_data *vc, u_char value, char up_flag) { unsigned long flags; - if (synth == NULL || up_flag || spk_killed) + if (!synth || up_flag || spk_killed) return; spin_lock_irqsave(&speakup_info.spinlock, flags); if (cursor_track == read_all_mode) { @@ -1215,7 +1215,7 @@ static void do_handle_latin(struct vc_data *vc, u_char value, char up_flag) spin_unlock_irqrestore(&speakup_info.spinlock, flags); return; } - if (synth == NULL || spk_killed) { + if (!synth || spk_killed) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); return; } @@ -1341,7 +1341,7 @@ static int speakup_allocate(struct vc_data *vc) int vc_num; vc_num = vc->vc_num; - if (speakup_console[vc_num] == NULL) { + if (!speakup_console[vc_num]) { speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]), GFP_ATOMIC); if (!speakup_console[vc_num]) @@ -1394,7 +1394,7 @@ static void kbd_fakekey2(struct vc_data *vc, int command) static void read_all_doc(struct vc_data *vc) { - if ((vc->vc_num != fg_console) || synth == NULL || spk_shut_up) + if ((vc->vc_num != fg_console) || !synth || spk_shut_up) return; if (!synth_supports_indexing()) return; @@ -1509,7 +1509,7 @@ static int pre_handle_cursor(struct vc_data *vc, u_char value, char up_flag) spin_lock_irqsave(&speakup_info.spinlock, flags); if (cursor_track == read_all_mode) { spk_parked &= 0xfe; - if (synth == NULL || up_flag || spk_shut_up) { + if (!synth || up_flag || spk_shut_up) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); return NOTIFY_STOP; } @@ -1531,7 +1531,7 @@ static void do_handle_cursor(struct vc_data *vc, u_char value, char up_flag) spin_lock_irqsave(&speakup_info.spinlock, flags); spk_parked &= 0xfe; - if (synth == NULL || up_flag || spk_shut_up || cursor_track == CT_Off) { + if (!synth || up_flag || spk_shut_up || cursor_track == CT_Off) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); return; } @@ -1730,7 +1730,7 @@ static void speakup_bs(struct vc_data *vc) return; if (!spk_parked) speakup_date(vc); - if (spk_shut_up || synth == NULL) { + if (spk_shut_up || !synth) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); return; } @@ -1747,7 +1747,7 @@ static void speakup_con_write(struct vc_data *vc, u16 *str, int len) { unsigned long flags; - if ((vc->vc_num != fg_console) || spk_shut_up || synth == NULL) + if ((vc->vc_num != fg_console) || spk_shut_up || !synth) return; if (!spin_trylock_irqsave(&speakup_info.spinlock, flags)) /* Speakup output, discard */ @@ -1776,7 +1776,7 @@ static void speakup_con_update(struct vc_data *vc) { unsigned long flags; - if (speakup_console[vc->vc_num] == NULL || spk_parked) + if (!speakup_console[vc->vc_num] || spk_parked) return; if (!spin_trylock_irqsave(&speakup_info.spinloc
[PATCH 07/11] staging: speakup: spaces preferred around operator
Fixed the checkpatch.pl issues like: CHECK: spaces preferred around that '&' (ctx:VxV) CHECK: spaces preferred around that '|' (ctx:VxV) CHECK: spaces preferred around that '-' (ctx:VxV) CHECK: spaces preferred around that '+' (ctx:VxV) etc. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/speakup.h| 12 ++-- drivers/staging/speakup/speakup_acntpc.c | 2 +- drivers/staging/speakup/speakup_decpc.c | 20 ++-- drivers/staging/speakup/speakup_dtlk.c | 2 +- drivers/staging/speakup/speakup_keypc.c | 6 +++--- drivers/staging/speakup/speakup_ltlk.c | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/staging/speakup/speakup.h b/drivers/staging/speakup/speakup.h index 0bc8d6afadfa..a654334c98b9 100644 --- a/drivers/staging/speakup/speakup.h +++ b/drivers/staging/speakup/speakup.h @@ -20,7 +20,7 @@ #define A_CAP 0x0007 #define B_NUM 0x0008 #define NUM 0x0009 -#define ALPHANUM (B_ALPHA|B_NUM) +#define ALPHANUM (B_ALPHA | B_NUM) #define SOME 0x0010 #define MOST 0x0020 #define PUNC 0x0040 @@ -30,14 +30,14 @@ #define B_EXNUM 0x0100 #define CH_RPT 0x0200 #define B_CTL 0x0400 -#define A_CTL (B_CTL+SYNTH_OK) +#define A_CTL (B_CTL + SYNTH_OK) #define B_SYM 0x0800 -#define B_CAPSYM (B_CAP|B_SYM) +#define B_CAPSYM (B_CAP | B_SYM) /* FIXME: u16 */ -#define IS_WDLM(x) (spk_chartab[((u_char)x)]&B_WDLM) -#define IS_CHAR(x, type) (spk_chartab[((u_char)x)]&type) -#define IS_TYPE(x, type) ((spk_chartab[((u_char)x)]&type) == type) +#define IS_WDLM(x) (spk_chartab[((u_char)x)] & B_WDLM) +#define IS_CHAR(x, type) (spk_chartab[((u_char)x)] & type) +#define IS_TYPE(x, type) ((spk_chartab[((u_char)x)] & type) == type) int speakup_thread(void *data); void spk_reset_default_chars(void); diff --git a/drivers/staging/speakup/speakup_acntpc.c b/drivers/staging/speakup/speakup_acntpc.c index c5beb5602c42..b4058bd82e42 100644 --- a/drivers/staging/speakup/speakup_acntpc.c +++ b/drivers/staging/speakup/speakup_acntpc.c @@ -282,7 +282,7 @@ static int synth_probe(struct spk_synth *synth) if (port_val == 0x53fc) { /* 'S' and out&input bits */ synth_port_control = synth_portlist[i]; - speakup_info.port_tts = synth_port_control+1; + speakup_info.port_tts = synth_port_control + 1; break; } } diff --git a/drivers/staging/speakup/speakup_decpc.c b/drivers/staging/speakup/speakup_decpc.c index 5e35d7e11361..5d22c3b7edd4 100644 --- a/drivers/staging/speakup/speakup_decpc.c +++ b/drivers/staging/speakup/speakup_decpc.c @@ -250,7 +250,7 @@ static int dt_getstatus(void) static void dt_sendcmd(u_int cmd) { outb_p(cmd & 0xFF, speakup_info.port_tts); - outb_p((cmd >> 8) & 0xFF, speakup_info.port_tts+1); + outb_p((cmd >> 8) & 0xFF, speakup_info.port_tts + 1); } static int dt_waitbit(int bit) @@ -286,11 +286,11 @@ static int dt_ctrl(u_int cmd) if (!dt_waitbit(STAT_cmd_ready)) return -1; - outb_p(0, speakup_info.port_tts+2); - outb_p(0, speakup_info.port_tts+3); + outb_p(0, speakup_info.port_tts + 2); + outb_p(0, speakup_info.port_tts + 3); dt_getstatus(); - dt_sendcmd(CMD_control|cmd); - outb_p(0, speakup_info.port_tts+6); + dt_sendcmd(CMD_control | cmd); + outb_p(0, speakup_info.port_tts + 6); while (dt_getstatus() & STAT_cmd_ready) { udelay(20); if (--timeout == 0) @@ -318,8 +318,8 @@ udelay(50); break; udelay(50); } - outb_p(DMA_sync, speakup_info.port_tts+4); - outb_p(0, speakup_info.port_tts+4); + outb_p(DMA_sync, speakup_info.port_tts + 4); + outb_p(0, speakup_info.port_tts + 4); udelay(100); for (timeout = 0; timeout < 10; timeout++) { if (!(dt_getstatus() & STAT_flushing)) @@ -337,8 +337,8 @@ static int dt_sendchar(char ch) return -1; if (!(dt_stat & STAT_rr_char)) return -2; - outb_p(DMA_single_in, speakup_info.port_tts+4); - outb_p(ch, speakup_info.port_tts+4); + outb_p(DMA_single_in, speakup_info.port_tts + 4); + outb_p(ch, speakup_info.port_tts + 4); dma_state ^= STAT_dma_state; return 0; } @@ -354,7 +354,7 @@ static int testkernel(void) dt_sendcmd(CMD_sync); if (!dt_waitbit(STAT_cmd_ready)) status = -2; - else if (dt_stat&0x8000) + else if (dt_stat & 0x8000) return 0; else if (dt_stat == 0x0dec) pr_warn("dec_pc at 0x%x, software not loaded\n", diff --git a/drivers/staging/speakup/speakup_dtlk.c b/drivers/staging/speakup/speakup_dtlk.c index 693fac4365c3..5973acc0a006 100644 --- a/drivers/staging/speakup/speakup_dtlk.c +++ b/drivers/stagin
[PATCH 10/11] staging: speakup: Match alignment with open parenthesis.
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis". Signed-off-by: Arushi Singhal --- drivers/staging/speakup/main.c | 2 +- drivers/staging/speakup/selection.c | 2 +- drivers/staging/speakup/serialio.c | 2 +- drivers/staging/speakup/speakup_acntpc.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index 7568e8149613..55bf7af1d6ea 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -1160,7 +1160,7 @@ static void spkup_write(const u16 *in_buf, int count) if (last_type & CH_RPT) { synth_printf(" "); synth_printf(spk_msg_get(MSG_REPEAT_DESC2), - ++rep_count); +++rep_count); synth_printf(" "); } rep_count = 0; diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c index 4417c00e68a7..08f68fc2864e 100644 --- a/drivers/staging/speakup/selection.c +++ b/drivers/staging/speakup/selection.c @@ -75,7 +75,7 @@ int speakup_set_selection(struct tty_struct *tty) speakup_clear_selection(); spk_sel_cons = vc_cons[fg_console].d; dev_warn(tty->dev, - "Selection: mark console not the same as cut\n"); +"Selection: mark console not the same as cut\n"); return -EINVAL; } diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c index e860e48818a4..5e31acac19de 100644 --- a/drivers/staging/speakup/serialio.c +++ b/drivers/staging/speakup/serialio.c @@ -125,7 +125,7 @@ static void start_serial_interrupt(int irq) pr_err("Unable to request Speakup serial I R Q\n"); /* Set MCR */ outb(UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2, - speakup_info.port_tts + UART_MCR); +speakup_info.port_tts + UART_MCR); /* Turn on Interrupts */ outb(UART_IER_MSI|UART_IER_RLSI|UART_IER_RDI, speakup_info.port_tts + UART_IER); diff --git a/drivers/staging/speakup/speakup_acntpc.c b/drivers/staging/speakup/speakup_acntpc.c index b4058bd82e42..ad72f8e883fc 100644 --- a/drivers/staging/speakup/speakup_acntpc.c +++ b/drivers/staging/speakup/speakup_acntpc.c @@ -261,9 +261,9 @@ static int synth_probe(struct spk_synth *synth) if (port_forced) { speakup_info.port_tts = port_forced; pr_info("probe forced to %x by kernel command line\n", - speakup_info.port_tts); + speakup_info.port_tts); if (synth_request_region(speakup_info.port_tts - 1, - SYNTH_IO_EXTENT)) { +SYNTH_IO_EXTENT)) { pr_warn("sorry, port already reserved\n"); return -EBUSY; } @@ -272,7 +272,7 @@ static int synth_probe(struct spk_synth *synth) } else { for (i = 0; synth_portlist[i]; i++) { if (synth_request_region(synth_portlist[i], - SYNTH_IO_EXTENT)) { +SYNTH_IO_EXTENT)) { pr_warn ("request_region: failed with 0x%x, %d\n", synth_portlist[i], SYNTH_IO_EXTENT); -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 08/11] staging: speakup: Removed Unnecessary parentheses.
Unnecessary parentheses are removed to improve readability. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/kobjects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index afb61e153592..ca85476e3ff7 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -392,7 +392,7 @@ static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr, len--; new_synth_name[len] = '\0'; spk_strlwr(new_synth_name); - if (synth && (!strcmp(new_synth_name, synth->name))) { + if (synth && !strcmp(new_synth_name, synth->name)) { pr_warn("%s already in use\n", new_synth_name); } else if (synth_init(new_synth_name) != 0) { pr_warn("failed to init synth %s\n", new_synth_name); -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/11] staging: speakup: Moved OR operator to previous line.
Moved logical OR operator to previous line to fix the following checkpatch issue: CHECK: Logical continuations should be on the previous line. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/main.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index c10445624e92..def1a36da9dd 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -2173,10 +2173,10 @@ speakup_key(struct vc_data *vc, int shift_state, int keycode, u_short keysym, if (up_flag || spk_killed || type == KT_SHIFT) goto out; spk_shut_up &= 0xfe; - kh = (value == KVAL(K_DOWN)) - || (value == KVAL(K_UP)) - || (value == KVAL(K_LEFT)) - || (value == KVAL(K_RIGHT)); + kh = (value == KVAL(K_DOWN)) || + (value == KVAL(K_UP)) || + (value == KVAL(K_LEFT)) || + (value == KVAL(K_RIGHT)); if ((cursor_track != read_all_mode) || !kh) if (!spk_no_intr) spk_do_flush(); -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/11] staging: speakup: Fix alignment with parenthesis.
This patch fixes the warnings reported by checkpatch.pl for please use a blank line after function/struct/union/enum declarations. Signed-off-by: Arushi Singhal --- drivers/staging/speakup/speakup_apollo.c | 2 +- drivers/staging/speakup/speakup_decext.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/speakup/speakup_apollo.c b/drivers/staging/speakup/speakup_apollo.c index 9cfdbbfb9742..6ad83dc642c4 100644 --- a/drivers/staging/speakup/speakup_apollo.c +++ b/drivers/staging/speakup/speakup_apollo.c @@ -173,7 +173,7 @@ static void do_catch_up(struct spk_synth *synth) if (!synth->io_ops->synth_out(synth, ch)) { outb(UART_MCR_DTR, speakup_info.port_tts + UART_MCR); outb(UART_MCR_DTR | UART_MCR_RTS, - speakup_info.port_tts + UART_MCR); +speakup_info.port_tts + UART_MCR); schedule_timeout(msecs_to_jiffies(full_time_val)); continue; } diff --git a/drivers/staging/speakup/speakup_decext.c b/drivers/staging/speakup/speakup_decext.c index 929a28d618dc..c564bf8e1531 100644 --- a/drivers/staging/speakup/speakup_decext.c +++ b/drivers/staging/speakup/speakup_decext.c @@ -206,11 +206,11 @@ static void do_catch_up(struct spk_synth *synth) if (!in_escape) synth->io_ops->synth_out(synth, PROCSPEECH); spin_lock_irqsave(&speakup_info.spinlock, - flags); + flags); jiffy_delta_val = jiffy_delta->u.n.value; delay_time_val = delay_time->u.n.value; spin_unlock_irqrestore(&speakup_info.spinlock, - flags); + flags); schedule_timeout(msecs_to_jiffies (delay_time_val)); jiff_max = jiffies + jiffy_delta_val; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/5] staging: bcm2835-camera: Fix integer underrun in port_parameter_get
On Tue, Mar 21, 2017 at 04:36:16AM -0700, Michael Zoran wrote: > On Tue, 2017-03-21 at 13:41 +0300, Dan Carpenter wrote: > > You're fixing a bug you introduced in [PATCH 1/5]. Don't do > > that. Just > > fix Dave's patch and add a note in the commit log. > > > > regards, > > dan carpenter > > > > OK, thanks I'm still learning about the whole process. It looks like > Dave's version has already been applied though. > > I just want to have as much as possible a separation between what I'm > passing upstream from the github(as a favor to him mostly) just to keep > the two trees in sync, and what I'm submitting. I don't want the logs > to get too mixed up. It's just a personal thing. > Sure. I understand that. But please do what I am saying? Also I feel like there should be a tag for bugfixes to a patch like: Fixes-from: Michael Zoran A good deal of my work gets folded into the original patches and I don't get any sort of credit that you can measure for it. I've lobbied for the Fixes-from: tag for a while... It would only cover bug fixes not bike shedding or style issues. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/5] staging: bcm2835-camera: Fix integer underrun in port_parameter_get
On Tue, 2017-03-21 at 14:45 +0300, Dan Carpenter wrote: > On Tue, Mar 21, 2017 at 04:36:16AM -0700, Michael Zoran wrote: > > On Tue, 2017-03-21 at 13:41 +0300, Dan Carpenter wrote: > > > You're fixing a bug you introduced in [PATCH 1/5]. Don't do > > > that. Just > > > fix Dave's patch and add a note in the commit log. > > > > > > regards, > > > dan carpenter > > > > > > > OK, thanks I'm still learning about the whole process. It looks > > like > > Dave's version has already been applied though. > > > > I just want to have as much as possible a separation between what > > I'm > > passing upstream from the github(as a favor to him mostly) just to > > keep > > the two trees in sync, and what I'm submitting. I don't want the > > logs > > to get too mixed up. It's just a personal thing. > > > > Sure. I understand that. But please do what I am saying? > > Also I feel like there should be a tag for bugfixes to a patch like: > > Fixes-from: Michael Zoran > > A good deal of my work gets folded into the original patches and I > don't > get any sort of credit that you can measure for it. I've lobbied for > the Fixes-from: tag for a while... It would only cover bug fixes not > bike shedding or style issues. > > regards, > dan carpenter > Sure, I'll do that from now on. The original version seems to have been applied at this point. The whole function looks like it could use some cleanup in general. Should I just submit those an independent patch when I get to it or should I submit a V2 the way you describe and have GregK replace it? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: sm750fb: Remove typedefs from struct
On Tue, Mar 21, 2017 at 04:56:38PM +0530, Arushi Singhal wrote: > This patch removes typedefs from structure and renames them as > per kernel coding standards. In the subject, and in the text, say _which_ typedef you changed, and what you changed it to. Same for your patch 2/2. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/5] staging: bcm2835-camera: Fix integer underrun in port_parameter_get
On Tue, Mar 21, 2017 at 04:51:03AM -0700, Michael Zoran wrote: > The original version seems to have been applied at this point. The > whole function looks like it could use some cleanup in general. Should > I just submit those an independent patch when I get to it or should I > submit a V2 the way you describe and have GregK replace it? Send them as independent follow up patches. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 04/10] staging: ks7010: fix checkpatch BRACES
On Tue, Mar 21, 2017 at 01:37:06PM +1100, Tobin C. Harding wrote: > Checkpatch emits CHECK: Unbalanced braces around else > statement. Statements in question are single statements so we do not > need braces. Checkpatch also warns about multiple line dereference for > this code. > > Fix if/else/else if statement use of braces. Fix function argument layout > at the same time since it is the same statement. > > Signed-off-by: Tobin C. Harding > --- > drivers/staging/ks7010/ks_hostif.c | 22 +- > 1 file changed, 9 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/ks7010/ks_hostif.c > b/drivers/staging/ks7010/ks_hostif.c > index db10e16..68e26f4 100644 > --- a/drivers/staging/ks7010/ks_hostif.c > +++ b/drivers/staging/ks7010/ks_hostif.c > @@ -2456,19 +2456,15 @@ void hostif_sme_execute(struct ks_wlan_private *priv, > int event) > hostif_phy_information_request(priv); > break; > case SME_MIC_FAILURE_REQUEST: > - if (priv->wpa.mic_failure.failure == 1) { > - hostif_mic_failure_request(priv, > -priv->wpa.mic_failure. > -failure - 1, 0); > - } else if (priv->wpa.mic_failure.failure == 2) { > - hostif_mic_failure_request(priv, > -priv->wpa.mic_failure. > -failure - 1, > -priv->wpa.mic_failure. > -counter); > - } else > - DPRINTK(4, > - "SME_MIC_FAILURE_REQUEST: failure count=%u > error?\n", > + if (priv->wpa.mic_failure.failure == 1) > + hostif_mic_failure_request( > + priv, priv->wpa.mic_failure.failure - 1, 0); > + else if (priv->wpa.mic_failure.failure == 2) > + hostif_mic_failure_request( > + priv, priv->wpa.mic_failure.failure - 1, > + priv->wpa.mic_failure.counter); > + else > + DPRINTK(4, "SME_MIC_FAILURE_REQUEST: failure count=%u > error?\n", > priv->wpa.mic_failure.failure); No. This isn't nice. Multi-line indents get curly braces generally for readability. It's better to go over the 80 character limit here. if (priv->wpa.mic_failure.failure == 1) { hostif_mic_failure_request(priv, priv->wpa.mic_failure.failure - 1, 0); } else if priv->wpa.mic_failure.failure == 2) { hostif_mic_failure_request(priv, priv->wpa.mic_failure.failure - 1, priv->wpa.mic_failure.counter); } else { DPRINTK(4, "SME_MIC_FAILURE_REQUEST: failure count=%u error?\n", priv->wpa.mic_failure.failure); } regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: lustre: replace simple_strtoul with kstrtoint
Replace simple_strtoul with kstrtoint. simple_strtoul is marked for obsoletion as reported by checkpatch.pl Signed-off-by: Marcin Ciupak --- v2: -improving kstrtoint error handling -updating commit message drivers/staging/lustre/lustre/obdclass/obd_mount.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 8e0d4b1d86dc..42858ee5b444 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -924,12 +924,20 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) lmd->lmd_flags |= LMD_FLG_ABORT_RECOV; clear++; } else if (strncmp(s1, "recovery_time_soft=", 19) == 0) { - lmd->lmd_recovery_time_soft = max_t(int, - simple_strtoul(s1 + 19, NULL, 10), time_min); + int res; + + rc = kstrtoint(s1 + 19, 10, &res); + if (rc) + goto invalid; + lmd->lmd_recovery_time_soft = max_t(int, res, time_min); clear++; } else if (strncmp(s1, "recovery_time_hard=", 19) == 0) { - lmd->lmd_recovery_time_hard = max_t(int, - simple_strtoul(s1 + 19, NULL, 10), time_min); + int res; + + rc = kstrtoint(s1 + 19, 10, &res); + if (rc) + goto invalid; + lmd->lmd_recovery_time_hard = max_t(int, res, time_min); clear++; } else if (strncmp(s1, "noir", 4) == 0) { lmd->lmd_flags |= LMD_FLG_NOIR; /* test purpose only. */ -- 2.11.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/10] staging: ks7010: remove zero comparison
On Tue, Mar 21, 2017 at 01:37:11PM +1100, Tobin C. Harding wrote: > Comparison, equal to zero, is redundant > > 'if (foo == 0)' is equal to 'if (!foo)' > > Typical kernel coding style is to use the shorter form. > > Remove unnecessary zero comparison. Not exactly. If you're talking about the number zero then == 0 and != 0 are good style. "if (size == 0) ". Other times we're talking about error codes or whatever and not the number zero so it should be "if (ret) ". Also for strcmp() functions, please use != 0 and == 0. if (strcmp(foo, bar) != 0) <-- read this as "foo != bar" if (strcmp(foo, bar) == 0) <-- read this as "foo == bar" if (strcmp(foo, bar) < 0) <-- read this as "foo < bar" regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 10/10] staging: ks7010: rename return value identifier
On Tue, Mar 21, 2017 at 01:37:12PM +1100, Tobin C. Harding wrote: > static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 > address, > unsigned char *data, unsigned int size) > { > - int rc; > + int ret; > unsigned char *read_buf; > > read_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL); > if (!read_buf) > return -ENOMEM; > > - rc = ks7010_sdio_read(priv, address, read_buf, size); > - if (rc) > + ret = ks7010_sdio_read(priv, address, read_buf, size); > + if (ret) > goto err_free_read_buf; > > - rc = memcmp(data, read_buf, size); > - if (rc) { > - DPRINTK(0, "data compare error (%d)\n", rc); > + ret = memcmp(data, read_buf, size); > + if (ret) { You didn't introduce this, but this is a bug. memcpy() doesn't return error codes. Could you fix it in a follow on patch? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: vt6656: rf.c: spaces preferred around that '-'
On Mon, Mar 20, 2017 at 08:46:01PM -0700, Matthew Giassa wrote: > Resolving 2 checkpatch warnings generated due to: > CHECK: spaces preferred around that '-' > > Signed-off-by: Matthew Giassa > --- > drivers/staging/vt6656/rf.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c > index 0e3a62a..fe09627 100644 > --- a/drivers/staging/vt6656/rf.c > +++ b/drivers/staging/vt6656/rf.c > @@ -611,7 +611,7 @@ int vnt_rf_write_embedded(struct vnt_private *priv, u32 > data) > reg_data[3] = (u8)(data >> 24); > > vnt_control_out(priv, MESSAGE_TYPE_WRITE_IFRF, > - 0, 0, ARRAY_SIZE(reg_data), reg_data); > + 0, 0, ARRAY_SIZE(reg_data), reg_data); This isn't described in the changelog. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] IIO coding tasks
Patchseries of IIO coding tasks Arushi Singhal (2): staging: ad7759: Replace mlock with driver private lock staging: iio: ade7759: Move header content to implementation file drivers/staging/iio/meter/ade7759.c | 56 +-- drivers/staging/iio/meter/ade7759.h | 53 - 2 files changed, 54 insertions(+), 57 deletions(-) -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: ad7759: Replace mlock with driver private lock
The IIO subsystem is redefining iio_dev->mlock to be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. In this driver, mlock was being used to protect hardware state changes. Replace it with a lock in the devices global data. Signed-off-by: Arushi Singhal --- drivers/staging/iio/meter/ade7759.c | 4 ++-- drivers/staging/iio/meter/ade7759.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c index 944ee3401029..1d1e0b33021f 100644 --- a/drivers/staging/iio/meter/ade7759.c +++ b/drivers/staging/iio/meter/ade7759.c @@ -381,7 +381,7 @@ static ssize_t ade7759_write_frequency(struct device *dev, if (!val) return -EINVAL; - mutex_lock(&indio_dev->mlock); + mutex_lock(&st->buf_lock); t = 27900 / val; if (t > 0) @@ -402,7 +402,7 @@ static ssize_t ade7759_write_frequency(struct device *dev, ret = ade7759_spi_write_reg_16(dev, ADE7759_MODE, reg); out: - mutex_unlock(&indio_dev->mlock); + mutex_unlock(&st->buf_lock); return ret ? ret : len; } diff --git a/drivers/staging/iio/meter/ade7759.h b/drivers/staging/iio/meter/ade7759.h index f0716d2fdf8e..4f69bb93cc45 100644 --- a/drivers/staging/iio/meter/ade7759.h +++ b/drivers/staging/iio/meter/ade7759.h @@ -42,6 +42,7 @@ * @buf_lock: mutex to protect tx and rx * @tx:transmit buffer * @rx:receive buffer + * @lock protect sensor state **/ struct ade7759_state { struct spi_device *us; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: iio: ade7759: Move header content to implementation file
The contents of ade7759.h are only used in ade7759.c. Move the header contents to the implemtation file, and delete the header file. Signed-off-by: Arushi Singhal --- drivers/staging/iio/meter/ade7759.c | 52 ++- drivers/staging/iio/meter/ade7759.h | 54 - 2 files changed, 51 insertions(+), 55 deletions(-) diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c index 1d1e0b33021f..86ac103dffe5 100644 --- a/drivers/staging/iio/meter/ade7759.c +++ b/drivers/staging/iio/meter/ade7759.c @@ -21,7 +21,57 @@ #include #include #include "meter.h" -#include "ade7759.h" + +#define ADE7759_WAVEFORM 0x01 +#define ADE7759_AENERGY 0x02 +#define ADE7759_RSTENERGY 0x03 +#define ADE7759_STATUS0x04 +#define ADE7759_RSTSTATUS 0x05 +#define ADE7759_MODE 0x06 +#define ADE7759_CFDEN 0x07 +#define ADE7759_CH1OS 0x08 +#define ADE7759_CH2OS 0x09 +#define ADE7759_GAIN 0x0A +#define ADE7759_APGAIN0x0B +#define ADE7759_PHCAL 0x0C +#define ADE7759_APOS 0x0D +#define ADE7759_ZXTOUT0x0E +#define ADE7759_SAGCYC0x0F +#define ADE7759_IRQEN 0x10 +#define ADE7759_SAGLVL0x11 +#define ADE7759_TEMP 0x12 +#define ADE7759_LINECYC 0x13 +#define ADE7759_LENERGY 0x14 +#define ADE7759_CFNUM 0x15 +#define ADE7759_CHKSUM0x1E +#define ADE7759_DIEREV0x1F + +#define ADE7759_READ_REG(a)a +#define ADE7759_WRITE_REG(a) ((a) | 0x80) + +#define ADE7759_MAX_TX6 +#define ADE7759_MAX_RX6 +#define ADE7759_STARTUP_DELAY 1000 + +#define ADE7759_SPI_SLOW(u32)(300 * 1000) +#define ADE7759_SPI_BURST (u32)(1000 * 1000) +#define ADE7759_SPI_FAST(u32)(2000 * 1000) + +/** + * struct ade7759_state - device instance specific data + * @us:actual spi_device + * @buf_lock: mutex to protect tx and rx + * @tx:transmit buffer + * @rx:receive buffer + * @lock protect sensor state + **/ + +struct ade7759_state { + struct spi_device *us; + struct mutexbuf_lock; /* protect tx and rx */ + u8 tx[ADE7759_MAX_TX] cacheline_aligned; + u8 rx[ADE7759_MAX_RX]; +}; static int ade7759_spi_write_reg_8(struct device *dev, u8 reg_address, diff --git a/drivers/staging/iio/meter/ade7759.h b/drivers/staging/iio/meter/ade7759.h index 4f69bb93cc45..e69de29bb2d1 100644 --- a/drivers/staging/iio/meter/ade7759.h +++ b/drivers/staging/iio/meter/ade7759.h @@ -1,54 +0,0 @@ -#ifndef _ADE7759_H -#define _ADE7759_H - -#define ADE7759_WAVEFORM 0x01 -#define ADE7759_AENERGY 0x02 -#define ADE7759_RSTENERGY 0x03 -#define ADE7759_STATUS0x04 -#define ADE7759_RSTSTATUS 0x05 -#define ADE7759_MODE 0x06 -#define ADE7759_CFDEN 0x07 -#define ADE7759_CH1OS 0x08 -#define ADE7759_CH2OS 0x09 -#define ADE7759_GAIN 0x0A -#define ADE7759_APGAIN0x0B -#define ADE7759_PHCAL 0x0C -#define ADE7759_APOS 0x0D -#define ADE7759_ZXTOUT0x0E -#define ADE7759_SAGCYC0x0F -#define ADE7759_IRQEN 0x10 -#define ADE7759_SAGLVL0x11 -#define ADE7759_TEMP 0x12 -#define ADE7759_LINECYC 0x13 -#define ADE7759_LENERGY 0x14 -#define ADE7759_CFNUM 0x15 -#define ADE7759_CHKSUM0x1E -#define ADE7759_DIEREV0x1F - -#define ADE7759_READ_REG(a)a -#define ADE7759_WRITE_REG(a) ((a) | 0x80) - -#define ADE7759_MAX_TX6 -#define ADE7759_MAX_RX6 -#define ADE7759_STARTUP_DELAY 1000 - -#define ADE7759_SPI_SLOW (u32)(300 * 1000) -#define ADE7759_SPI_BURST (u32)(1000 * 1000) -#define ADE7759_SPI_FAST (u32)(2000 * 1000) - -/** - * struct ade7759_state - device instance specific data - * @us:actual spi_device - * @buf_lock: mutex to protect tx and rx - * @tx:transmit buffer - * @rx:receive buffer - * @lock protect sensor state - **/ -struct ade7759_state { - struct spi_device *us; - struct mutexbuf_lock; - u8 tx[ADE7759_MAX_TX] cacheline_aligned; - u8 rx[ADE7759_MAX_RX]; -}; - -#endif -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: vt6656: rf.c: spaces preferred around that '-'
* Dan Carpenter [2017-03-21 15:55:52 +0300]: On Mon, Mar 20, 2017 at 08:46:01PM -0700, Matthew Giassa wrote: Resolving 2 checkpatch warnings generated due to: CHECK: spaces preferred around that '-' Signed-off-by: Matthew Giassa --- drivers/staging/vt6656/rf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 0e3a62a..fe09627 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -611,7 +611,7 @@ int vnt_rf_write_embedded(struct vnt_private *priv, u32 data) reg_data[3] = (u8)(data >> 24); vnt_control_out(priv, MESSAGE_TYPE_WRITE_IFRF, - 0, 0, ARRAY_SIZE(reg_data), reg_data); + 0, 0, ARRAY_SIZE(reg_data), reg_data); This isn't described in the changelog. regards, dan carpenter Would it be preferable if the changelog was more verbose? The literal text from the checkpatch.pl warning itself is indeed in the changelog: On Mon, Mar 20, 2017 at 08:46:01PM -0700, Matthew Giassa wrote: Resolving 2 checkpatch warnings generated due to: CHECK: spaces preferred around that '-' Cheers. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5] staging: Use buf_lock instead of mlock and Refactor code
Hi simran, [auto build test WARNING on iio/togreg] [also build test WARNING on v4.11-rc3 next-20170321] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/simran-singhal/staging-Use-buf_lock-instead-of-mlock-and-Refactor-code/20170321-213956 base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg config: x86_64-randconfig-x016-201712 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/list.h:4, from include/linux/module.h:9, from drivers/staging/iio/gyro/adis16060_core.c:9: drivers/staging/iio/gyro/adis16060_core.c: In function 'adis16060_read_raw': include/linux/compiler.h:149:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ include/linux/compiler.h:147:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~ >> drivers/staging/iio/gyro/adis16060_core.c:89:3: note: in expansion of macro >> 'if' if (ret < 0) ^~ drivers/staging/iio/gyro/adis16060_core.c:91:4: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' return ret; ^~ vim +/if +89 drivers/staging/iio/gyro/adis16060_core.c e071f6b8 Barry Song 2010-10-27 3 * e071f6b8 Barry Song 2010-10-27 4 * Copyright 2010 Analog Devices Inc. e071f6b8 Barry Song 2010-10-27 5 * e071f6b8 Barry Song 2010-10-27 6 * Licensed under the GPL-2 or later. e071f6b8 Barry Song 2010-10-27 7 */ e071f6b8 Barry Song 2010-10-27 8 45296236 Paul Gortmaker 2011-08-30 @9 #include e071f6b8 Barry Song 2010-10-27 10 #include e071f6b8 Barry Song 2010-10-27 11 #include e071f6b8 Barry Song 2010-10-27 12 #include e071f6b8 Barry Song 2010-10-27 13 #include e071f6b8 Barry Song 2010-10-27 14 #include e071f6b8 Barry Song 2010-10-27 15 #include e071f6b8 Barry Song 2010-10-27 16 #include 14f98326 Jonathan Cameron 2011-02-28 17 06458e27 Jonathan Cameron 2012-04-25 18 #include 06458e27 Jonathan Cameron 2012-04-25 19 #include e071f6b8 Barry Song 2010-10-27 20 14f98326 Jonathan Cameron 2011-02-28 21 #define ADIS16060_GYRO 0x20 /* Measure Angular Rate (Gyro) */ 14f98326 Jonathan Cameron 2011-02-28 22 #define ADIS16060_TEMP_OUT0x10 /* Measure Temperature */ 14f98326 Jonathan Cameron 2011-02-28 23 #define ADIS16060_AIN2 0x80 /* Measure AIN2 */ 14f98326 Jonathan Cameron 2011-02-28 24 #define ADIS16060_AIN1 0x40 /* Measure AIN1 */ 14f98326 Jonathan Cameron 2011-02-28 25 14f98326 Jonathan Cameron 2011-02-28 26 /** 14f98326 Jonathan Cameron 2011-02-28 27 * struct adis16060_state - device instance specific data 14f98326 Jonathan Cameron 2011-02-28 28 * @us_w: actual spi_device to write config 14f98326 Jonathan Cameron 2011-02-28 29 * @us_r: actual spi_device to read back data 25985edc Lucas De Marchi 2011-03-30 30 * @buf: transmit or receive buffer 14f98326 Jonathan Cameron 2011-02-28 31 * @buf_lock: mutex to protect tx and rx 14f98326 Jonathan Cameron 2011-02-28 32 **/ 14f98326 Jonathan Cameron 2011-02-28 33 struct adis16060_state { 14f98326 Jonathan Cameron 2011-02-28 34struct spi_device *us_w; 14f98326 Jonathan Cameron 2011-02-28 35struct spi_device *us_r; 14f98326 Jonathan Cameron 2011-02-28 36struct mutex buf_lock; 14f98326 Jonathan Cameron 2011-02-28 37 14f98326 Jonathan Cameron 2011-02-28 38u8 buf[3] cacheline_aligned; 14f98326 Jonathan Cameron 2011-02-28 39 }; e071f6b8 Barry Song 2010-10-27 40 3a5952f9 Jonathan Cameron 2011-06-27 41 static struct iio_dev *adis16060_iio_dev; e071f6b8 Barry Song 2010-10-27 42 71db16e5 simran singhal 2017-03-19 43 static int adis16060_spi_write_than_read(struct iio_dev *indio_dev, 71db16e5 simran singhal 2017-03-19 44 u8 conf, u16 *val) e071f6b8 Barry Song 2010-10-27 45 { e071f6b8 Barry Song 2010-10-27 46int ret; 3a5952f9 Jonathan Cameron 2011-06-27 47
[PATCH] drivers: staging: vt6656: fixed coding style errors
Fixed coding style errors. No errors with checkpatch.pl Signed-off-by: Prasant Jalan --- drivers/staging/vt6656/rf.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 068c1c8..3a9d19a 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -611,7 +611,7 @@ int vnt_rf_write_embedded(struct vnt_private *priv, u32 data) reg_data[3] = (u8)(data >> 24); vnt_control_out(priv, MESSAGE_TYPE_WRITE_IFRF, - 0, 0, ARRAY_SIZE(reg_data), reg_data); + 0, 0, ARRAY_SIZE(reg_data), reg_data); return true; } @@ -643,9 +643,9 @@ int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel) case RATE_48M: case RATE_54M: if (channel > CB_MAX_CHANNEL_24G) - power = priv->ofdm_a_pwr_tbl[channel-15]; + power = priv->ofdm_a_pwr_tbl[channel - 15]; else - power = priv->ofdm_pwr_tbl[channel-1]; + power = priv->ofdm_pwr_tbl[channel - 1]; break; } @@ -771,7 +771,7 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate) ret &= vnt_rf_write_embedded(priv, 0x015C0800); } else { dev_dbg(&priv->usb->dev, - " vnt_rf_set_txpower> 11G mode\n"); + " %s> 11G mode\n", __func__); power_setting = ((0x3f - power) << 20) | (0x7 << 8); @@ -876,7 +876,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr1, length1); vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT, length1, array); + MESSAGE_REQUEST_RF_INIT, length1, array); /* Channel Table 0 */ value = 0; @@ -889,7 +889,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH0, length, array); + value, MESSAGE_REQUEST_RF_CH0, length, array); length2 -= length; value += length; @@ -907,7 +907,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr3, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH1, length, array); + value, MESSAGE_REQUEST_RF_CH1, length, array); length3 -= length; value += length; @@ -924,7 +924,7 @@ void vnt_rf_table_download(struct vnt_private *priv) /* Init Table 2 */ vnt_control_out(priv, MESSAGE_TYPE_WRITE, - 0, MESSAGE_REQUEST_RF_INIT2, length1, array); + 0, MESSAGE_REQUEST_RF_INIT2, length1, array); /* Channel Table 0 */ value = 0; @@ -937,7 +937,8 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH2, length, array); + value, MESSAGE_REQUEST_RF_CH2, + length, array); length2 -= length; value += length; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v5] staging: Use buf_lock instead of mlock and Refactor code
On Tue, Mar 21, 2017 at 8:01 PM, kbuild test robot wrote: > Hi simran, > > [auto build test WARNING on iio/togreg] > [also build test WARNING on v4.11-rc3 next-20170321] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/simran-singhal/staging-Use-buf_lock-instead-of-mlock-and-Refactor-code/20170321-213956 > base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg > config: x86_64-randconfig-x016-201712 (attached as .config) > compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 > reproduce: > # save the attached .config to linux build tree > make ARCH=x86_64 > > All warnings (new ones prefixed by >>): > I am not getting any error, and I have already sent the v7 of this patch please check out that: https://groups.google.com/forum/#!topic/outreachy-kernel/5uz6IpcOpMA >In file included from include/uapi/linux/stddef.h:1:0, > from include/linux/stddef.h:4, > from include/uapi/linux/posix_types.h:4, > from include/uapi/linux/types.h:13, > from include/linux/types.h:5, > from include/linux/list.h:4, > from include/linux/module.h:9, > from drivers/staging/iio/gyro/adis16060_core.c:9: >drivers/staging/iio/gyro/adis16060_core.c: In function > 'adis16060_read_raw': >include/linux/compiler.h:149:2: warning: this 'if' clause does not > guard... [-Wmisleading-indentation] > if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ > ^ >include/linux/compiler.h:147:23: note: in expansion of macro '__trace_if' > #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) > ^~ >>> drivers/staging/iio/gyro/adis16060_core.c:89:3: note: in expansion of macro >>> 'if' > if (ret < 0) > ^~ >drivers/staging/iio/gyro/adis16060_core.c:91:4: note: ...this statement, > but the latter is misleadingly indented as if it is guarded by the 'if' >return ret; >^~ > > vim +/if +89 drivers/staging/iio/gyro/adis16060_core.c > > e071f6b8 Barry Song 2010-10-27 3 * > e071f6b8 Barry Song 2010-10-27 4 * Copyright 2010 Analog Devices > Inc. > e071f6b8 Barry Song 2010-10-27 5 * > e071f6b8 Barry Song 2010-10-27 6 * Licensed under the GPL-2 or > later. > e071f6b8 Barry Song 2010-10-27 7 */ > e071f6b8 Barry Song 2010-10-27 8 > 45296236 Paul Gortmaker 2011-08-30 @9 #include > e071f6b8 Barry Song 2010-10-27 10 #include > e071f6b8 Barry Song 2010-10-27 11 #include > e071f6b8 Barry Song 2010-10-27 12 #include > e071f6b8 Barry Song 2010-10-27 13 #include > e071f6b8 Barry Song 2010-10-27 14 #include > e071f6b8 Barry Song 2010-10-27 15 #include > e071f6b8 Barry Song 2010-10-27 16 #include > 14f98326 Jonathan Cameron 2011-02-28 17 > 06458e27 Jonathan Cameron 2012-04-25 18 #include > 06458e27 Jonathan Cameron 2012-04-25 19 #include > e071f6b8 Barry Song 2010-10-27 20 > 14f98326 Jonathan Cameron 2011-02-28 21 #define ADIS16060_GYRO > 0x20 /* Measure Angular Rate (Gyro) */ > 14f98326 Jonathan Cameron 2011-02-28 22 #define ADIS16060_TEMP_OUT0x10 > /* Measure Temperature */ > 14f98326 Jonathan Cameron 2011-02-28 23 #define ADIS16060_AIN2 > 0x80 /* Measure AIN2 */ > 14f98326 Jonathan Cameron 2011-02-28 24 #define ADIS16060_AIN1 > 0x40 /* Measure AIN1 */ > 14f98326 Jonathan Cameron 2011-02-28 25 > 14f98326 Jonathan Cameron 2011-02-28 26 /** > 14f98326 Jonathan Cameron 2011-02-28 27 * struct adis16060_state - device > instance specific data > 14f98326 Jonathan Cameron 2011-02-28 28 * @us_w: actual > spi_device to write config > 14f98326 Jonathan Cameron 2011-02-28 29 * @us_r: actual > spi_device to read back data > 25985edc Lucas De Marchi 2011-03-30 30 * @buf: transmit or > receive buffer > 14f98326 Jonathan Cameron 2011-02-28 31 * @buf_lock: mutex to > protect tx and rx > 14f98326 Jonathan Cameron 2011-02-28 32 **/ > 14f98326 Jonathan Cameron 2011-02-28 33 struct adis16060_state { > 14f98326 Jonathan Cameron 2011-02-28 34struct spi_device > *us_w; > 14f98326 Jonathan Cameron 2011-02-28 35struct spi_device > *us_r; > 14f98326 Jonathan Cameron 2011-02-28 36struct mutex > buf_lock; > 14f98326 J
[PATCH v2 0/2] Remove Typedefs.
Typedefs are removed in sm750fb driver. Arushi Singhal (2): staging: sm750fb: Remove typedef from "typedef struct _mode_parameter_t" staging: sm750fb: Remove typedef from "typedef enum _spolarity_t" drivers/staging/sm750fb/ddk750_mode.c | 8 +--- drivers/staging/sm750fb/ddk750_mode.h | 19 --- drivers/staging/sm750fb/sm750_hw.c| 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) -- changes in v2 -change the spelling of coverpatch subject. 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: sm750fb: Remove typedef from "typedef struct _mode_parameter_t"
This patch removes typedefs from struct and renames it from "typedef struct _mode_parameter_t" to "struct mode_parameter" as per kernel coding standards." Signed-off-by: Arushi Singhal --- changes in v2 -change the subject and commit message of PATCH. drivers/staging/sm750fb/ddk750_mode.c | 8 +--- drivers/staging/sm750fb/ddk750_mode.h | 8 +++- drivers/staging/sm750fb/sm750_hw.c| 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c index eea5aef2956f..9665bb9478dc 100644 --- a/drivers/staging/sm750fb/ddk750_mode.c +++ b/drivers/staging/sm750fb/ddk750_mode.c @@ -12,7 +12,8 @@ * HW only supports 7 predefined pixel clocks, and clock select is * in bit 29:27 of Display Control register. */ -static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, unsigned long dispControl) +static unsigned long displayControlAdjust_SM750LE(struct mode_parameter *pModeParam, + unsigned long dispControl) { unsigned long x, y; @@ -72,7 +73,8 @@ static unsigned long displayControlAdjust_SM750LE(mode_parameter_t *pModeParam, } /* only timing related registers will be programed */ -static int programModeRegisters(mode_parameter_t *pModeParam, struct pll_value *pll) +static int programModeRegisters(struct mode_parameter *pModeParam, + struct pll_value *pll) { int ret = 0; int cnt = 0; @@ -198,7 +200,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, struct pll_value * return ret; } -int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock) +int ddk750_setModeTiming(struct mode_parameter *parm, clock_type_t clock) { struct pll_value pll; unsigned int uiActualPixelClk; diff --git a/drivers/staging/sm750fb/ddk750_mode.h b/drivers/staging/sm750fb/ddk750_mode.h index 6d204b8b4a01..9dc4d6c5a779 100644 --- a/drivers/staging/sm750fb/ddk750_mode.h +++ b/drivers/staging/sm750fb/ddk750_mode.h @@ -9,7 +9,7 @@ typedef enum _spolarity_t { } spolarity_t; -typedef struct _mode_parameter_t { +struct mode_parameter { /* Horizontal timing. */ unsigned long horizontal_total; unsigned long horizontal_display_end; @@ -31,9 +31,7 @@ typedef struct _mode_parameter_t { /* Clock Phase. This clock phase only applies to Panel. */ spolarity_t clock_phase_polarity; -} -mode_parameter_t; - -int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock); +}; +int ddk750_setModeTiming(struct mode_parameter *parm, clock_type_t clock); #endif diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index fab3fc9c8330..baf1bbdc92ff 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -252,7 +252,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, { int ret, fmt; u32 reg; - mode_parameter_t modparm; + struct mode_parameter modparm; clock_type_t clock; struct sm750_dev *sm750_dev; struct lynxfb_par *par; -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: sm750fb: Remove typedef from "typedef enum _spolarity_t"
This patch removes typedefs from enum and renames it from "typedef enum _spolarity_t" to "enum spolarity" as per kernel coding standards." Signed-off-by: Arushi Singhal --- changes in v2 -change the subject and commit message of PATCH. drivers/staging/sm750fb/ddk750_mode.h | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_mode.h b/drivers/staging/sm750fb/ddk750_mode.h index 9dc4d6c5a779..d5eae36d85cb 100644 --- a/drivers/staging/sm750fb/ddk750_mode.h +++ b/drivers/staging/sm750fb/ddk750_mode.h @@ -3,11 +3,10 @@ #include "ddk750_chip.h" -typedef enum _spolarity_t { +enum spolarity { POS = 0, /* positive */ NEG, /* negative */ -} -spolarity_t; +}; struct mode_parameter { /* Horizontal timing. */ @@ -15,14 +14,14 @@ struct mode_parameter { unsigned long horizontal_display_end; unsigned long horizontal_sync_start; unsigned long horizontal_sync_width; - spolarity_t horizontal_sync_polarity; + enum spolarity horizontal_sync_polarity; /* Vertical timing. */ unsigned long vertical_total; unsigned long vertical_display_end; unsigned long vertical_sync_start; unsigned long vertical_sync_height; - spolarity_t vertical_sync_polarity; + enum spolarity vertical_sync_polarity; /* Refresh timing. */ unsigned long pixel_clock; @@ -30,7 +29,7 @@ struct mode_parameter { unsigned long vertical_frequency; /* Clock Phase. This clock phase only applies to Panel. */ - spolarity_t clock_phase_polarity; + enum spolarity clock_phase_polarity; }; int ddk750_setModeTiming(struct mode_parameter *parm, clock_type_t clock); -- 2.11.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] drivers: staging: vt6656: fixed coding style errors
This patch fixes the following: - Replace spaces with tabs for indentation - adds spaces around symbol '-' - uses __func__ macro to print function name - truncated the line such that it is within 80 char limit as per kernel coding standards. Signed-off-by: Prasant Jalan --- drivers/staging/vt6656/rf.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 068c1c8..3a9d19a 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -611,7 +611,7 @@ int vnt_rf_write_embedded(struct vnt_private *priv, u32 data) reg_data[3] = (u8)(data >> 24); vnt_control_out(priv, MESSAGE_TYPE_WRITE_IFRF, - 0, 0, ARRAY_SIZE(reg_data), reg_data); + 0, 0, ARRAY_SIZE(reg_data), reg_data); return true; } @@ -643,9 +643,9 @@ int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel) case RATE_48M: case RATE_54M: if (channel > CB_MAX_CHANNEL_24G) - power = priv->ofdm_a_pwr_tbl[channel-15]; + power = priv->ofdm_a_pwr_tbl[channel - 15]; else - power = priv->ofdm_pwr_tbl[channel-1]; + power = priv->ofdm_pwr_tbl[channel - 1]; break; } @@ -771,7 +771,7 @@ int vnt_rf_set_txpower(struct vnt_private *priv, u8 power, u32 rate) ret &= vnt_rf_write_embedded(priv, 0x015C0800); } else { dev_dbg(&priv->usb->dev, - " vnt_rf_set_txpower> 11G mode\n"); + " %s> 11G mode\n", __func__); power_setting = ((0x3f - power) << 20) | (0x7 << 8); @@ -876,7 +876,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr1, length1); vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT, length1, array); + MESSAGE_REQUEST_RF_INIT, length1, array); /* Channel Table 0 */ value = 0; @@ -889,7 +889,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH0, length, array); + value, MESSAGE_REQUEST_RF_CH0, length, array); length2 -= length; value += length; @@ -907,7 +907,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr3, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH1, length, array); + value, MESSAGE_REQUEST_RF_CH1, length, array); length3 -= length; value += length; @@ -924,7 +924,7 @@ void vnt_rf_table_download(struct vnt_private *priv) /* Init Table 2 */ vnt_control_out(priv, MESSAGE_TYPE_WRITE, - 0, MESSAGE_REQUEST_RF_INIT2, length1, array); + 0, MESSAGE_REQUEST_RF_INIT2, length1, array); /* Channel Table 0 */ value = 0; @@ -937,7 +937,8 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH2, length, array); + value, MESSAGE_REQUEST_RF_CH2, + length, array); length2 -= length; value += length; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH 0/2] IIO coding tasks
On Tue, Mar 21, 2017 at 07:00:17PM +0530, Arushi Singhal wrote: > Patchseries of IIO coding tasks This wouldn't be a patchset. Although they touch the same driver, the changes are unrelated. See more below... > > Arushi Singhal (2): > staging: ad7759: Replace mlock with driver private lock This one is already been submitted. If you have a v2 for it, then v2 the original patch. > staging: iio: ade7759: Move header content to implementation file This patch is done and applied already. See the Coding Task #1 notes in the IIO Tasks page. alisons > > drivers/staging/iio/meter/ade7759.c | 56 > +-- > drivers/staging/iio/meter/ade7759.h | 53 - > 2 files changed, 54 insertions(+), 57 deletions(-) > > -- > 2.11.0 > > -- > 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/20170321133021.6737-1-arushisinghal19971997%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 0/2] IIO coding tasks
On Tue, 21 Mar 2017, Arushi Singhal wrote: > On Tue, Mar 21, 2017 at 9:33 PM, Alison Schofield > wrote: > On Tue, Mar 21, 2017 at 07:00:17PM +0530, Arushi Singhal wrote: > > Patchseries of IIO coding tasks > > This wouldn't be a patchset. Although they touch the same > driver, the changes are unrelated. See more below... > > This I have send as a Patchset because as you have mentioned below that the > [PATCH 2/2] was already done before by someone but I think so it is not yet > applied in the Greg's tree yet.So I have done both the changes and as they > should be applied one after other so that's why I have send them as > Patchset. For the IIO patches, it is better to work on the IIO tree, not Greg's. Greg manages staging, not IIO. The IIO patches should appear in Greg's tree eventually. julia > > > > Arushi Singhal (2): > > staging: ad7759: Replace mlock with driver private lock > > This one is already been submitted. If you have a v2 for it, > then v2 > the original patch. > > Is it submitted by me only before? And this is not the v2. > I have just resed it. > > staging: iio: ade7759: Move header content to implementation > file > > This patch is done and applied already. See the Coding Task #1 > notes > in the IIO Tasks page. > > Not at applied I think so. > Thanks > Arushi > > alisons > > > > > drivers/staging/iio/meter/ade7759.c | 56 > +-- > > drivers/staging/iio/meter/ade7759.h | 53 > - > > 2 files changed, 54 insertions(+), 57 deletions(-) > > > > -- > > 2.11.0 > > > > -- > > 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 > > visithttps://groups.google.com/d/msgid/outreachy-kernel/20170321133021.6737-1-ar > ushisinghal19971997%40gmail.com. > > 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 outreachy-kernel+unsubscr...@googlegroups.com. > To post to this group, send email to outreachy-ker...@googlegroups.com. > To view this discussion on the web > visithttps://groups.google.com/d/msgid/outreachy-kernel/CA%2BXqjF9dVy33Dsv0H2z8x > taNeMOW7SQgr4qa4wLwz6xFNVTsUA%40mail.gmail.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 v6] staging: Use buf_lock instead of mlock and Refactor code
On Mon, Mar 20, 2017 at 01:36:21AM +0530, simran singhal wrote: Hi Simran, I going to ask for a v7 without looking at the code ;) Subject line needs subsystem and driver. Subject and log message can be improved. > The IIO subsystem is redefining iio_dev->mlock to be used by > the IIO core only for protecting device operating mode changes. > ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. > > In this driver, mlock was being used to protect hardware state > changes. Replace it with buf_lock in the devices global data. ^^^ this was not done > > As buf_lock protects both the adis16060_spi_write() and > adis16060_spi_read() functions and both are always called in > pair. First write, then read. Thus, refactor the code to have > one single function adis16060_spi_write_than_read() which is > protected by the existing buf_lock. This was done. So, you were able to obsolete the need for mlock by creating the paired function. > > Removed nested locks as the function adis16060_read_raw call > a lock on &st->buf_lock and then calls the function > adis16060_spi_write which again tries to get hold > of the same lock. this was not done. Yes, you avoided nested locks through proper coding, but we don't want to give the impression in the log message that there was a pre-existing nested lock issue. I did checkpatch & compile it...but looked no further yet. alisons > > Signed-off-by: simran singhal > --- > > v6: >-Change commit message >-Remove nested lock > > drivers/staging/iio/gyro/adis16060_core.c | 40 > ++- > 1 file changed, 13 insertions(+), 27 deletions(-) > > diff --git a/drivers/staging/iio/gyro/adis16060_core.c > b/drivers/staging/iio/gyro/adis16060_core.c > index c9d46e7..1c6de46 100644 > --- a/drivers/staging/iio/gyro/adis16060_core.c > +++ b/drivers/staging/iio/gyro/adis16060_core.c > @@ -40,25 +40,17 @@ struct adis16060_state { > > static struct iio_dev *adis16060_iio_dev; > > -static int adis16060_spi_write(struct iio_dev *indio_dev, u8 val) > +static int adis16060_spi_write_than_read(struct iio_dev *indio_dev, > + u8 conf, u16 *val) > { > int ret; > struct adis16060_state *st = iio_priv(indio_dev); > > - mutex_lock(&st->buf_lock); > - st->buf[2] = val; /* The last 8 bits clocked in are latched */ > + st->buf[2] = conf; /* The last 8 bits clocked in are latched */ > ret = spi_write(st->us_w, st->buf, 3); > - mutex_unlock(&st->buf_lock); > - > - return ret; > -} > - > -static int adis16060_spi_read(struct iio_dev *indio_dev, u16 *val) > -{ > - int ret; > - struct adis16060_state *st = iio_priv(indio_dev); > > - mutex_lock(&st->buf_lock); > + if (ret < 0) > + return ret; > > ret = spi_read(st->us_r, st->buf, 3); > > @@ -69,8 +61,8 @@ static int adis16060_spi_read(struct iio_dev *indio_dev, > u16 *val) >*/ > if (!ret) > *val = ((st->buf[0] & 0x3) << 12) | > - (st->buf[1] << 4) | > - ((st->buf[2] >> 4) & 0xF); > + (st->buf[1] << 4) | > + ((st->buf[2] >> 4) & 0xF); > mutex_unlock(&st->buf_lock); > > return ret; > @@ -83,20 +75,18 @@ static int adis16060_read_raw(struct iio_dev *indio_dev, > { > u16 tval = 0; > int ret; > + struct adis16060_state *st = iio_priv(indio_dev); > > switch (mask) { > case IIO_CHAN_INFO_RAW: > /* Take the iio_dev status lock */ > - mutex_lock(&indio_dev->mlock); > - ret = adis16060_spi_write(indio_dev, chan->address); > + mutex_lock(&st->buf_lock); > + ret = adis16060_spi_write_than_read(indio_dev, > + chan->address, &tval); > + mutex_unlock(&st->buf_lock); > if (ret < 0) > - goto out_unlock; > + return ret; > > - ret = adis16060_spi_read(indio_dev, &tval); > - if (ret < 0) > - goto out_unlock; > - > - mutex_unlock(&indio_dev->mlock); > *val = tval; > return IIO_VAL_INT; > case IIO_CHAN_INFO_OFFSET: > @@ -110,10 +100,6 @@ static int adis16060_read_raw(struct iio_dev *indio_dev, > } > > return -EINVAL; > - > -out_unlock: > - mutex_unlock(&indio_dev->mlock); > - return ret; > } > > static const struct iio_info adis16060_info = { > -- > 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/msgi
[PATCH] drivers: staging: vt6656: fxed coding style errors
This patch replaces spaces with tabs for indentation as per kernel coding standards. Signed-off-by: Prasant Jalan --- drivers/staging/vt6656/rf.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 068c1c8..f69bced 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -876,7 +876,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr1, length1); vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT, length1, array); + MESSAGE_REQUEST_RF_INIT, length1, array); /* Channel Table 0 */ value = 0; @@ -889,7 +889,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH0, length, array); + value, MESSAGE_REQUEST_RF_CH0, length, array); length2 -= length; value += length; @@ -907,7 +907,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr3, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH1, length, array); + value, MESSAGE_REQUEST_RF_CH1, length, array); length3 -= length; value += length; @@ -924,7 +924,7 @@ void vnt_rf_table_download(struct vnt_private *priv) /* Init Table 2 */ vnt_control_out(priv, MESSAGE_TYPE_WRITE, - 0, MESSAGE_REQUEST_RF_INIT2, length1, array); + 0, MESSAGE_REQUEST_RF_INIT2, length1, array); /* Channel Table 0 */ value = 0; @@ -937,7 +937,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH2, length, array); + value, MESSAGE_REQUEST_RF_CH2, length, array); length2 -= length; value += length; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH 0/2] IIO coding tasks
On Tue, Mar 21, 2017 at 05:39:38PM +0100, Julia Lawall wrote: > > > On Tue, 21 Mar 2017, Arushi Singhal wrote: > > > On Tue, Mar 21, 2017 at 9:33 PM, Alison Schofield > > wrote: > > On Tue, Mar 21, 2017 at 07:00:17PM +0530, Arushi Singhal wrote: > > > Patchseries of IIO coding tasks > > > > This wouldn't be a patchset. Although they touch the same > > driver, the changes are unrelated. See more below... > > > > This I have send as a Patchset because as you have mentioned below that the > > [PATCH 2/2] was already done before by someone but I think so it is not yet > > applied in the Greg's tree yet.So I have done both the changes and as they > > should be applied one after other so that's why I have send them as > > Patchset. > > For the IIO patches, it is better to work on the IIO tree, not Greg's. > Greg manages staging, not IIO. The IIO patches should appear in Greg's > tree eventually. > > julia We didn't direct applicants to create an iio tree. At this point, it seems more than is necessary. They can follow the directions in the task descriptions and avoid the collisions. Of course, they are welcome to create a tree to iio/testing. (IMHO it's more overhead/busy work and maybe not the best use of time in the home stretch of the application period.) alisons > > > > > > > Arushi Singhal (2): > > > staging: ad7759: Replace mlock with driver private lock > > > > This one is already been submitted. If you have a v2 for it, > > then v2 > > the original patch. > > > > Is it submitted by me only before? And this is not the v2. > > I have just resed it. > > > staging: iio: ade7759: Move header content to implementation > > file > > > > This patch is done and applied already. See the Coding Task #1 > > notes > > in the IIO Tasks page. > > > > Not at applied I think so. > > Thanks > > Arushi > > > > alisons > > > > > > > > drivers/staging/iio/meter/ade7759.c | 56 > > +-- > > > drivers/staging/iio/meter/ade7759.h | 53 > > - > > > 2 files changed, 54 insertions(+), 57 deletions(-) > > > > > > -- > > > 2.11.0 > > > > > > -- > > > 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 > > > visithttps://groups.google.com/d/msgid/outreachy-kernel/20170321133021.6737-1-ar > > ushisinghal19971997%40gmail.com. > > > 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 outreachy-kernel+unsubscr...@googlegroups.com. > > To post to this group, send email to outreachy-ker...@googlegroups.com. > > To view this discussion on the web > > visithttps://groups.google.com/d/msgid/outreachy-kernel/CA%2BXqjF9dVy33Dsv0H2z8x > > taNeMOW7SQgr4qa4wLwz6xFNVTsUA%40mail.gmail.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 v6] staging: Use buf_lock instead of mlock and Refactor code
On Tue, Mar 21, 2017 at 10:18 PM, Alison Schofield wrote: > On Mon, Mar 20, 2017 at 01:36:21AM +0530, simran singhal wrote: > > Hi Simran, > > I going to ask for a v7 without looking at the code ;) > Subject line needs subsystem and driver. > Subject and log message can be improved. Hi Alison, I have already sent v7 with changed subject. > >> The IIO subsystem is redefining iio_dev->mlock to be used by >> the IIO core only for protecting device operating mode changes. >> ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. >> >> In this driver, mlock was being used to protect hardware state >> changes. Replace it with buf_lock in the devices global data. >^^^ this was not done >> >> As buf_lock protects both the adis16060_spi_write() and >> adis16060_spi_read() functions and both are always called in >> pair. First write, then read. Thus, refactor the code to have >> one single function adis16060_spi_write_than_read() which is >> protected by the existing buf_lock. > This was done. So, you were able to obsolete the need for mlock > by creating the paired function. > >> >> Removed nested locks as the function adis16060_read_raw call >> a lock on &st->buf_lock and then calls the function >> adis16060_spi_write which again tries to get hold >> of the same lock. > this was not done. Yes, you avoided nested locks through > proper coding, but we don't want to give the impression in the > log message that there was a pre-existing nested lock issue. > > I did checkpatch & compile it...but looked no further yet. > > alisons >> >> Signed-off-by: simran singhal >> --- >> >> v6: >>-Change commit message >>-Remove nested lock >> >> drivers/staging/iio/gyro/adis16060_core.c | 40 >> ++- >> 1 file changed, 13 insertions(+), 27 deletions(-) >> >> diff --git a/drivers/staging/iio/gyro/adis16060_core.c >> b/drivers/staging/iio/gyro/adis16060_core.c >> index c9d46e7..1c6de46 100644 >> --- a/drivers/staging/iio/gyro/adis16060_core.c >> +++ b/drivers/staging/iio/gyro/adis16060_core.c >> @@ -40,25 +40,17 @@ struct adis16060_state { >> >> static struct iio_dev *adis16060_iio_dev; >> >> -static int adis16060_spi_write(struct iio_dev *indio_dev, u8 val) >> +static int adis16060_spi_write_than_read(struct iio_dev *indio_dev, >> + u8 conf, u16 *val) >> { >> int ret; >> struct adis16060_state *st = iio_priv(indio_dev); >> >> - mutex_lock(&st->buf_lock); >> - st->buf[2] = val; /* The last 8 bits clocked in are latched */ >> + st->buf[2] = conf; /* The last 8 bits clocked in are latched */ >> ret = spi_write(st->us_w, st->buf, 3); >> - mutex_unlock(&st->buf_lock); >> - >> - return ret; >> -} >> - >> -static int adis16060_spi_read(struct iio_dev *indio_dev, u16 *val) >> -{ >> - int ret; >> - struct adis16060_state *st = iio_priv(indio_dev); >> >> - mutex_lock(&st->buf_lock); >> + if (ret < 0) >> + return ret; >> >> ret = spi_read(st->us_r, st->buf, 3); >> >> @@ -69,8 +61,8 @@ static int adis16060_spi_read(struct iio_dev *indio_dev, >> u16 *val) >>*/ >> if (!ret) >> *val = ((st->buf[0] & 0x3) << 12) | >> - (st->buf[1] << 4) | >> - ((st->buf[2] >> 4) & 0xF); >> + (st->buf[1] << 4) | >> + ((st->buf[2] >> 4) & 0xF); >> mutex_unlock(&st->buf_lock); >> >> return ret; >> @@ -83,20 +75,18 @@ static int adis16060_read_raw(struct iio_dev *indio_dev, >> { >> u16 tval = 0; >> int ret; >> + struct adis16060_state *st = iio_priv(indio_dev); >> >> switch (mask) { >> case IIO_CHAN_INFO_RAW: >> /* Take the iio_dev status lock */ >> - mutex_lock(&indio_dev->mlock); >> - ret = adis16060_spi_write(indio_dev, chan->address); >> + mutex_lock(&st->buf_lock); >> + ret = adis16060_spi_write_than_read(indio_dev, >> + chan->address, &tval); >> + mutex_unlock(&st->buf_lock); >> if (ret < 0) >> - goto out_unlock; >> + return ret; >> >> - ret = adis16060_spi_read(indio_dev, &tval); >> - if (ret < 0) >> - goto out_unlock; >> - >> - mutex_unlock(&indio_dev->mlock); >> *val = tval; >> return IIO_VAL_INT; >> case IIO_CHAN_INFO_OFFSET: >> @@ -110,10 +100,6 @@ static int adis16060_read_raw(struct iio_dev *indio_dev, >> } >> >> return -EINVAL; >> - >> -out_unlock: >> - mutex_unlock(&indio_dev->mlock); >> - return ret; >> } >> >> static const struct iio_info adis16060_info = { >> -- >> 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 receivin
Re: [Outreachy kernel] [PATCH 0/2] IIO coding tasks
On Tue, 21 Mar 2017, Alison Schofield wrote: > On Tue, Mar 21, 2017 at 05:39:38PM +0100, Julia Lawall wrote: > > > > > > On Tue, 21 Mar 2017, Arushi Singhal wrote: > > > > > On Tue, Mar 21, 2017 at 9:33 PM, Alison Schofield > > > wrote: > > > On Tue, Mar 21, 2017 at 07:00:17PM +0530, Arushi Singhal wrote: > > > > Patchseries of IIO coding tasks > > > > > > This wouldn't be a patchset. Although they touch the same > > > driver, the changes are unrelated. See more below... > > > > > > This I have send as a Patchset because as you have mentioned below that > > > the > > > [PATCH 2/2] was already done before by someone but I think so it is not > > > yet > > > applied in the Greg's tree yet.So I have done both the changes and as they > > > should be applied one after other so that's why I have send them as > > > Patchset. > > > > For the IIO patches, it is better to work on the IIO tree, not Greg's. > > Greg manages staging, not IIO. The IIO patches should appear in Greg's > > tree eventually. > > > > julia > > We didn't direct applicants to create an iio tree. At this point, > it seems more than is necessary. They can follow the directions in the > task descriptions and avoid the collisions. I meant just pull from the IIO tree you mentioned, work on that, submit patches, and then expect to see the patches show up there at some time in the future. If someone make IIO patches on Greg's tree, then they will have an out of date view. julia > > Of course, they are welcome to create a tree to iio/testing. > > (IMHO it's more overhead/busy work and maybe not the best use > of time in the home stretch of the application period.) > > alisons > > > > > > > > > > Arushi Singhal (2): > > > > staging: ad7759: Replace mlock with driver private lock > > > > > > This one is already been submitted. If you have a v2 for it, > > > then v2 > > > the original patch. > > > > > > Is it submitted by me only before? And this is not the v2. > > > I have just resed it. > > > > staging: iio: ade7759: Move header content to implementation > > > file > > > > > > This patch is done and applied already. See the Coding Task #1 > > > notes > > > in the IIO Tasks page. > > > > > > Not at applied I think so. > > > Thanks > > > Arushi > > > > > > alisons > > > > > > > > > > > drivers/staging/iio/meter/ade7759.c | 56 > > > +-- > > > > drivers/staging/iio/meter/ade7759.h | 53 > > > - > > > > 2 files changed, 54 insertions(+), 57 deletions(-) > > > > > > > > -- > > > > 2.11.0 > > > > > > > > -- > > > > 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 > > > > visithttps://groups.google.com/d/msgid/outreachy-kernel/20170321133021.6737-1-ar > > > ushisinghal19971997%40gmail.com. > > > > 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 outreachy-kernel+unsubscr...@googlegroups.com. > > > To post to this group, send email to outreachy-ker...@googlegroups.com. > > > To view this discussion on the web > > > visithttps://groups.google.com/d/msgid/outreachy-kernel/CA%2BXqjF9dVy33Dsv0H2z8x > > > taNeMOW7SQgr4qa4wLwz6xFNVTsUA%40mail.gmail.com. > > > 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 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/20170321170221.GB2793%40d830.WORKGROUP. > 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 0/2] IIO coding tasks
On Tue, 21 Mar 2017, Arushi Singhal wrote: > > > On Tue, Mar 21, 2017 at 10:32 PM, Alison Schofield > wrote: > On Tue, Mar 21, 2017 at 05:39:38PM +0100, Julia Lawall wrote: > > > > > > On Tue, 21 Mar 2017, Arushi Singhal wrote: > > > > > On Tue, Mar 21, 2017 at 9:33 PM, Alison Schofield > > > > wrote: > > > On Tue, Mar 21, 2017 at 07:00:17PM +0530, Arushi > Singhal wrote: > > > > Patchseries of IIO coding tasks > > > > > > This wouldn't be a patchset. Although they touch the > same > > > driver, the changes are unrelated. See more below... > > > > > > This I have send as a Patchset because as you have mentioned > below that the > > > [PATCH 2/2] was already done before by someone but I think > so it is not yet > > > applied in the Greg's tree yet.So I have done both the > changes and as they > > > should be applied one after other so that's why I have send > them as > > > Patchset. > > > > For the IIO patches, it is better to work on the IIO tree, not > Greg's. > > Greg manages staging, not IIO. The IIO patches should appear > in Greg's > > tree eventually. > > > > julia > > We didn't direct applicants to create an iio tree. At this > point, > it seems more than is necessary. They can follow the directions > in the > task descriptions and avoid the collisions. > > Of course, they are welcome to create a tree to iio/testing. > > (IMHO it's more overhead/busy work and maybe not the best use > of time in the home stretch of the application period.) > > alisons > > > Hi Alison > As you have mentioned that my [PATCH 2/2] is already being done someone. So > how can I make the changes of [PATCH 1/2] on top of it as [PATCH 2/2] is not > yet applied on the staging tree. Make a patch that applies to the current state of the IIO tree. Just clone that one like you cloned the staging one. julia > Please suggest me. > Thanks > Arushi > > > > > > > > > > Arushi Singhal (2): > > > > staging: ad7759: Replace mlock with driver private > lock > > > > > > This one is already been submitted. If you have a v2 > for it, > > > then v2 > > > the original patch. > > > > > > Is it submitted by me only before? And this is not the v2. > > > I have just resed it. > > > > staging: iio: ade7759: Move header content to > implementation > > > file > > > > > > This patch is done and applied already. See the > Coding Task #1 > > > notes > > > in the IIO Tasks page. > > > > > > Not at applied I think so. > > > Thanks > > > Arushi > > > > > > alisons > > > > > > > > > > > drivers/staging/iio/meter/ade7759.c | 56 > > > +-- > > > > drivers/staging/iio/meter/ade7759.h | 53 > > > - > > > > 2 files changed, 54 insertions(+), 57 deletions(-) > > > > > > > > -- > > > > 2.11.0 > > > > > > > > -- > > > > 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 > webvisithttps://groups.google.com/d/msgid/outreachy-kernel/20170321133021.6737 > -1-ar > > > ushisinghal19971997%40gmail.com. > > > > 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 outreachy-kernel+unsubscr...@googlegroups.com. > > > To post to this group, send email to > outreachy-ker...@googlegroups.com. > > > To view this discussion on the > webvisithttps://groups.google.com/d/msgid/outreachy-kernel/CA%2BXqjF9dVy33Dsv0 > H2z8x > > > taNeMOW7SQgr4qa4wLwz6xFNVTsUA%40mail.gmail.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: Eric Anholt offically announces support of VC4 without access to expander on the RPI 3
Michael Zoran writes: > On Mon, 2017-03-20 at 10:22 -0700, Eric Anholt wrote: >> Michael Zoran writes: >> >> > > > Since the API is completely documented, I see no reason we or >> > > > anybody >> > > > couldn't essentially rewrite the driver while it's in >> > > > staging. I >> > > > just >> > > > think it would be best for everyone if the new version was a >> > > > drop >> > > > in >> > > > replacement for the original version. Essential an enhancement >> > > > rather >> > > > then a competitor. >> > > >> > > I think my comments weren't fundamental changes, but you surely >> > > mean >> > > the devicetree ABI? I like to see this driver ASAP out of staging >> > > and >> > > i'm not interested to maintain 2 functional identical driver only >> > > to >> > > keep compability with the Foundation tree. Currently i'm afraid >> > > that >> > > we build up many drivers in staging, which need a complete >> > > rewrite >> > > later if they should come out of staging. It would be nice if we >> > > could avoid the situation we have with the thermal driver. >> > > >> > > Stefan >> > >> > The API I'm talking about here is the mailbox API that is used to >> > talk >> > to the firmware. The numbers and structures to pass are >> > documented. >> > Nothing prevents anybody from rewriting this driver and submitting >> > it >> > to the appropriate subsystems. It's certainly small enough. >> > >> > If you really want working thermal or cpu speed drivers today, >> > nothing >> > stops anybody from submitting the downstream drivers after doing >> > some >> > minor touchups and submitting them to staging. That would at least >> > get >> > things working while people argue about what the correct DT nodes >> > should be. >> > >> > I would also like to point out that the RPI 3 has been out for over >> > a >> > year and nobody has been able to get working video out of it >> > through >> > VC4 on a mainline tree. At least until now. So I'm not sure the >> > best >> > way to go is for the expander driver to go under the GPIO subtree. >> >> Excuse me? Display works fine on my Pi3. VC4 uses DDC to probe for >> connection when the GPIO line isn't present in the DT. > > Just a FYI, Eric Anholt has offically announced support for VC4 for > HDMI on mainline Linus build without any support from the expander on > the RPI 3. > > Sounds like this particular driver isn't needed then, correct? That's the HDMI audio that just landed. HDMI has been working on the pi3 since 9d44a8d530e8cc97d71ffcbc0ff3b5553c62. In the absence of a GPIO line for hotplug detect, we use DDC, which is slower and throws an error in dmesg when the probe happens but HDMI is disconnected. As such, having a GPIO driver would improve things for people. signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH 0/2] IIO coding tasks
On Tue, Mar 21, 2017 at 10:52:46PM +0530, Arushi Singhal wrote: > On Tue, Mar 21, 2017 at 10:32 PM, Alison Schofield > wrote: > > > On Tue, Mar 21, 2017 at 05:39:38PM +0100, Julia Lawall wrote: > > > > > > > > > On Tue, 21 Mar 2017, Arushi Singhal wrote: > > > > > > > On Tue, Mar 21, 2017 at 9:33 PM, Alison Schofield < > > amsfiel...@gmail.com> > > > > wrote: > > > > On Tue, Mar 21, 2017 at 07:00:17PM +0530, Arushi Singhal wrote: > > > > > Patchseries of IIO coding tasks > > > > > > > > This wouldn't be a patchset. Although they touch the same > > > > driver, the changes are unrelated. See more below... > > > > > > > > This I have send as a Patchset because as you have mentioned below > > that the > > > > [PATCH 2/2] was already done before by someone but I think so it is > > not yet > > > > applied in the Greg's tree yet.So I have done both the changes and as > > they > > > > should be applied one after other so that's why I have send them as > > > > Patchset. > > > > > > For the IIO patches, it is better to work on the IIO tree, not Greg's. > > > Greg manages staging, not IIO. The IIO patches should appear in Greg's > > > tree eventually. > > > > > > julia > > > > We didn't direct applicants to create an iio tree. At this point, > > it seems more than is necessary. They can follow the directions in the > > task descriptions and avoid the collisions. > > > > Of course, they are welcome to create a tree to iio/testing. > > > > (IMHO it's more overhead/busy work and maybe not the best use > > of time in the home stretch of the application period.) > > > > alisons > > > > Hi Alison > As you have mentioned that my [PATCH 2/2] is already being done someone. So > how can I make the changes of [PATCH 1/2] on top of it as [PATCH 2/2] is > not yet applied on the staging tree. > Please suggest me. > Thanks > Arushi Arushi - I don't see anything needing to be done by you! Your ad7759 mlock patch is awaiting review. It's not your issue to keep up with all changes going into the file. When it gets applied will most likely merge with no merge issue at all. alisons > > > > > > > > > > > > > > Arushi Singhal (2): > > > > > staging: ad7759: Replace mlock with driver private lock > > > > > > > > This one is already been submitted. If you have a v2 for it, > > > > then v2 > > > > the original patch. > > > > > > > > Is it submitted by me only before? And this is not the v2. > > > > I have just resed it. > > > > > staging: iio: ade7759: Move header content to implementation > > > > file > > > > > > > > This patch is done and applied already. See the Coding Task #1 > > > > notes > > > > in the IIO Tasks page. > > > > > > > > Not at applied I think so. > > > > Thanks > > > > Arushi > > > > > > > > alisons > > > > > > > > > > > > > > drivers/staging/iio/meter/ade7759.c | 56 > > > > +-- > > > > > drivers/staging/iio/meter/ade7759.h | 53 > > > > - > > > > > 2 files changed, 54 insertions(+), 57 deletions(-) > > > > > > > > > > -- > > > > > 2.11.0 > > > > > > > > > > -- > > > > > 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 visithttps://groups.google. > > com/d/msgid/outreachy-kernel/20170321133021.6737-1-ar > > > > ushisinghal19971997%40gmail.com. > > > > > 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 outreachy-kernel+unsubscr...@googlegroups.com. > > > > To post to this group, send email to outreachy-ker...@googlegroups.com > > . > > > > To view this discussion on the web visithttps://groups.google. > > com/d/msgid/outreachy-kernel/CA%2BXqjF9dVy33Dsv0H2z8x > > > > taNeMOW7SQgr4qa4wLwz6xFNVTsUA%40mail.gmail.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 v6] staging: Use buf_lock instead of mlock and Refactor code
On Tue, Mar 21, 2017 at 10:34:01PM +0530, SIMRAN SINGHAL wrote: > On Tue, Mar 21, 2017 at 10:18 PM, Alison Schofield > wrote: > > On Mon, Mar 20, 2017 at 01:36:21AM +0530, simran singhal wrote: > > > > Hi Simran, > > > > I going to ask for a v7 without looking at the code ;) > > Subject line needs subsystem and driver. > > Subject and log message can be improved. > > Hi Alison, > I have already sent v7 with changed subject. Simran, I see v7. Needs subsystem (iio) and to nitpick, driver name is "adis16060" ;) Other comments still apply. Please append all version histories below the --- for review. v7: v6: . . v2: thanks, alisons > > > > >> The IIO subsystem is redefining iio_dev->mlock to be used by > >> the IIO core only for protecting device operating mode changes. > >> ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. > >> > >> In this driver, mlock was being used to protect hardware state > >> changes. Replace it with buf_lock in the devices global data. > >^^^ this was not done > >> > >> As buf_lock protects both the adis16060_spi_write() and > >> adis16060_spi_read() functions and both are always called in > >> pair. First write, then read. Thus, refactor the code to have > >> one single function adis16060_spi_write_than_read() which is > >> protected by the existing buf_lock. > > This was done. So, you were able to obsolete the need for mlock > > by creating the paired function. > > > >> > >> Removed nested locks as the function adis16060_read_raw call > >> a lock on &st->buf_lock and then calls the function > >> adis16060_spi_write which again tries to get hold > >> of the same lock. > > this was not done. Yes, you avoided nested locks through > > proper coding, but we don't want to give the impression in the > > log message that there was a pre-existing nested lock issue. > > > > I did checkpatch & compile it...but looked no further yet. > > > > alisons > >> > >> Signed-off-by: simran singhal > >> --- > >> > >> v6: > >>-Change commit message > >>-Remove nested lock > >> > >> drivers/staging/iio/gyro/adis16060_core.c | 40 > >> ++- > >> 1 file changed, 13 insertions(+), 27 deletions(-) > >> > >> diff --git a/drivers/staging/iio/gyro/adis16060_core.c > >> b/drivers/staging/iio/gyro/adis16060_core.c > >> index c9d46e7..1c6de46 100644 > >> --- a/drivers/staging/iio/gyro/adis16060_core.c > >> +++ b/drivers/staging/iio/gyro/adis16060_core.c > >> @@ -40,25 +40,17 @@ struct adis16060_state { > >> > >> static struct iio_dev *adis16060_iio_dev; > >> > >> -static int adis16060_spi_write(struct iio_dev *indio_dev, u8 val) > >> +static int adis16060_spi_write_than_read(struct iio_dev *indio_dev, > >> + u8 conf, u16 *val) > >> { > >> int ret; > >> struct adis16060_state *st = iio_priv(indio_dev); > >> > >> - mutex_lock(&st->buf_lock); > >> - st->buf[2] = val; /* The last 8 bits clocked in are latched */ > >> + st->buf[2] = conf; /* The last 8 bits clocked in are latched */ > >> ret = spi_write(st->us_w, st->buf, 3); > >> - mutex_unlock(&st->buf_lock); > >> - > >> - return ret; > >> -} > >> - > >> -static int adis16060_spi_read(struct iio_dev *indio_dev, u16 *val) > >> -{ > >> - int ret; > >> - struct adis16060_state *st = iio_priv(indio_dev); > >> > >> - mutex_lock(&st->buf_lock); > >> + if (ret < 0) > >> + return ret; > >> > >> ret = spi_read(st->us_r, st->buf, 3); > >> > >> @@ -69,8 +61,8 @@ static int adis16060_spi_read(struct iio_dev *indio_dev, > >> u16 *val) > >>*/ > >> if (!ret) > >> *val = ((st->buf[0] & 0x3) << 12) | > >> - (st->buf[1] << 4) | > >> - ((st->buf[2] >> 4) & 0xF); > >> + (st->buf[1] << 4) | > >> + ((st->buf[2] >> 4) & 0xF); > >> mutex_unlock(&st->buf_lock); > >> > >> return ret; > >> @@ -83,20 +75,18 @@ static int adis16060_read_raw(struct iio_dev > >> *indio_dev, > >> { > >> u16 tval = 0; > >> int ret; > >> + struct adis16060_state *st = iio_priv(indio_dev); > >> > >> switch (mask) { > >> case IIO_CHAN_INFO_RAW: > >> /* Take the iio_dev status lock */ > >> - mutex_lock(&indio_dev->mlock); > >> - ret = adis16060_spi_write(indio_dev, chan->address); > >> + mutex_lock(&st->buf_lock); > >> + ret = adis16060_spi_write_than_read(indio_dev, > >> + chan->address, &tval); > >> + mutex_unlock(&st->buf_lock); > >> if (ret < 0) > >> - goto out_unlock; > >> + return ret; > >> > >> - ret = adis16060_spi_read(indio_dev, &tval); > >> - if (ret < 0) > >> - goto out_unlock; > >> - > >> - mutex_unlock(&indio_dev->mlock); > >>
[PATCH v3 0/2] Replace mlock with private lock and delete whitespaces
The patch series replaces mlock with a private lock for driver ad9834 and Fix coding style issues related to white spaces. v3: -Using new private "lock" instead of using "buf_lock" as it can cause deadlock. -Sending it as a series of two patches. v2: -Using the existing buf_lock instead of lock. simran singhal (2): staging: iio: ade7753: Remove trailing whitespaces staging: iio: ade7753: Replace mlock with driver private lock drivers/staging/iio/meter/ade7753.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 1/2] staging: iio: ade7753: Remove trailing whitespaces
This patch removes trailing whitespaces in order to follow the Linux coding style. Signed-off-by: simran singhal --- drivers/staging/iio/meter/ade7753.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c index dfd8b71..b71fbd3 100644 --- a/drivers/staging/iio/meter/ade7753.c +++ b/drivers/staging/iio/meter/ade7753.c @@ -83,10 +83,10 @@ * @buf_lock: mutex to protect tx and rx **/ struct ade7753_state { - struct spi_device *us; - struct mutexbuf_lock; - u8 tx[ADE7753_MAX_TX] cacheline_aligned; - u8 rx[ADE7753_MAX_RX]; + struct spi_device *us; + struct mutexbuf_lock; + u8 tx[ADE7753_MAX_TX] cacheline_aligned; + u8 rx[ADE7753_MAX_RX]; }; static int ade7753_spi_write_reg_8(struct device *dev, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3 2/2] staging: iio: ade7753: Replace mlock with driver private lock
The IIO subsystem is redefining iio_dev->mlock to be used by the IIO core only for protecting device operating mode changes. ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. In this driver, mlock was being used to protect hardware state changes. Replace it with a lock in the devices global data. Signed-off-by: simran singhal --- drivers/staging/iio/meter/ade7753.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c index b71fbd3..9674e05 100644 --- a/drivers/staging/iio/meter/ade7753.c +++ b/drivers/staging/iio/meter/ade7753.c @@ -80,11 +80,13 @@ * @us: actual spi_device * @tx: transmit buffer * @rx: receive buffer + * @lock: protect sensor state * @buf_lock: mutex to protect tx and rx **/ struct ade7753_state { struct spi_device *us; struct mutexbuf_lock; + struct mutexlock; /* protect sensor state */ u8 tx[ADE7753_MAX_TX] cacheline_aligned; u8 rx[ADE7753_MAX_RX]; }; @@ -484,7 +486,7 @@ static ssize_t ade7753_write_frequency(struct device *dev, if (!val) return -EINVAL; - mutex_lock(&indio_dev->mlock); + mutex_lock(&st->lock); t = 27900 / val; if (t > 0) @@ -505,7 +507,7 @@ static ssize_t ade7753_write_frequency(struct device *dev, ret = ade7753_spi_write_reg_16(dev, ADE7753_MODE, reg); out: - mutex_unlock(&indio_dev->mlock); + mutex_unlock(&st->lock); return ret ? ret : len; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH v2] scsi: storvsc: Add support for FC rport.
> -Original Message- > From: Cathy Avery [mailto:cav...@redhat.com] > Sent: Friday, March 17, 2017 8:18 AM > To: KY Srinivasan ; h...@infradead.org; Haiyang Zhang > ; j...@linux.vnet.ibm.com; > martin.peter...@oracle.com > Cc: step...@networkplumber.org; dan.carpen...@oracle.com; > de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; linux- > s...@vger.kernel.org > Subject: [PATCH v2] scsi: storvsc: Add support for FC rport. > > Included in the current storvsc driver for Hyper-V is the ability > to access luns on an FC fabric via a virtualized fiber channel > adapter exposed by the Hyper-V host. The driver also attaches to > the FC transport to allow host and port names to be published under > /sys/class/fc_host/hostX. Current customer tools running on the VM > require that these names be available in the well known standard > location under fc_host/hostX. > > A problem arose when attaching to the FC transport. The scsi_scan > code attempts to call fc_user_scan which has basically become a no-op > due to the fact that the virtualized FC device does not expose rports. > At this point you cannot refresh the scsi bus after mapping or unmapping > luns on the SAN without a reboot of the VM. > > This patch stubs in an rport per fc_host in storvsc so that the > requirement of a defined rport is now met within the fc_transport and > echo "- - -" > /sys/class/scsi_host/hostX/scan now works. > > Signed-off-by: Cathy Avery Acked-by: K. Y. Srinivasan > --- > Changes since v1: > - Fix fc_rport_identifiers init [Stephen Hemminger] > - Better error checking > --- > drivers/scsi/storvsc_drv.c | 23 ++- > 1 file changed, 18 insertions(+), 5 deletions(-) > > diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c > index 638e5f4..37646d1 100644 > --- a/drivers/scsi/storvsc_drv.c > +++ b/drivers/scsi/storvsc_drv.c > @@ -478,6 +478,9 @@ struct storvsc_device { >*/ > u64 node_name; > u64 port_name; > +#if IS_ENABLED(CONFIG_SCSI_FC_ATTRS) > + struct fc_rport *rport; > +#endif > }; > > struct hv_host_device { > @@ -1816,19 +1819,27 @@ static int storvsc_probe(struct hv_device > *device, > target = (device->dev_instance.b[5] << 8 | >device->dev_instance.b[4]); > ret = scsi_add_device(host, 0, target, 0); > - if (ret) { > - scsi_remove_host(host); > - goto err_out2; > - } > + if (ret) > + goto err_out3; > } > #if IS_ENABLED(CONFIG_SCSI_FC_ATTRS) > if (host->transportt == fc_transport_template) { > + struct fc_rport_identifiers ids = { > + .roles = FC_PORT_ROLE_FCP_TARGET, > + }; > + > fc_host_node_name(host) = stor_device->node_name; > fc_host_port_name(host) = stor_device->port_name; > + stor_device->rport = fc_remote_port_add(host, 0, &ids); > + if (!stor_device->rport) > + goto err_out3; > } > #endif > return 0; > > +err_out3: > + scsi_remove_host(host); > + > err_out2: > /* >* Once we have connected with the host, we would need to > @@ -1854,8 +1865,10 @@ static int storvsc_remove(struct hv_device *dev) > struct Scsi_Host *host = stor_device->host; > > #if IS_ENABLED(CONFIG_SCSI_FC_ATTRS) > - if (host->transportt == fc_transport_template) > + if (host->transportt == fc_transport_template) { > + fc_remote_port_delete(stor_device->rport); > fc_remove_host(host); > + } > #endif > scsi_remove_host(host); > storvsc_dev_remove(dev); > -- > 2.5.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH 0/2] IIO coding tasks
On 21 March 2017 17:27:02 GMT+00:00, Julia Lawall wrote: > > >On Tue, 21 Mar 2017, Arushi Singhal wrote: > >> >> >> On Tue, Mar 21, 2017 at 10:32 PM, Alison Schofield > >> wrote: >> On Tue, Mar 21, 2017 at 05:39:38PM +0100, Julia Lawall wrote: >> > >> > >> > On Tue, 21 Mar 2017, Arushi Singhal wrote: >> > >> > > On Tue, Mar 21, 2017 at 9:33 PM, Alison Schofield >> >> > > wrote: >> > > On Tue, Mar 21, 2017 at 07:00:17PM +0530, Arushi >> Singhal wrote: >> > > > Patchseries of IIO coding tasks >> > > >> > > This wouldn't be a patchset. Although they touch the >> same >> > > driver, the changes are unrelated. See more below... >> > > >> > > This I have send as a Patchset because as you have >mentioned >> below that the >> > > [PATCH 2/2] was already done before by someone but I think >> so it is not yet >> > > applied in the Greg's tree yet.So I have done both the >> changes and as they >> > > should be applied one after other so that's why I have send >> them as >> > > Patchset. >> > >> > For the IIO patches, it is better to work on the IIO tree, >not >> Greg's. >> > Greg manages staging, not IIO. The IIO patches should appear >> in Greg's >> > tree eventually. >> > >> > julia >> >> We didn't direct applicants to create an iio tree. At this >> point, >> it seems more than is necessary. They can follow the >directions >> in the >> task descriptions and avoid the collisions. >> >> Of course, they are welcome to create a tree to iio/testing. >> >> (IMHO it's more overhead/busy work and maybe not the best use >> of time in the home stretch of the application period.) >> >> alisons >> >> >> Hi Alison >> As you have mentioned that my [PATCH 2/2] is already being done >someone. So >> how can I make the changes of [PATCH 1/2] on top of it as [PATCH 2/2] >is not >> yet applied on the staging tree. > >Make a patch that applies to the current state of the IIO tree. Just >clone that one like you cloned the staging one. > >julia > Slight amendment,. Normally would be the togreg branch which doesn't rebase. With all the current churn might be best to use the testing branch and i will fix up any issues if i have to rebase as result of build tests. Will.send Greg a pull later anyway, so should be less difference after he pulls that. J >> Please suggest me. >> Thanks >> Arushi >> > >> > > > >> > > > Arushi Singhal (2): >> > > > staging: ad7759: Replace mlock with driver >private >> lock >> > > >> > > This one is already been submitted. If you have a v2 >> for it, >> > > then v2 >> > > the original patch. >> > > >> > > Is it submitted by me only before? And this is not the v2. >> > > I have just resed it. >> > > > staging: iio: ade7759: Move header content to >> implementation >> > > file >> > > >> > > This patch is done and applied already. See the >> Coding Task #1 >> > > notes >> > > in the IIO Tasks page. >> > > >> > > Not at applied I think so. >> > > Thanks >> > > Arushi >> > > >> > > alisons >> > > >> > > > >> > > > drivers/staging/iio/meter/ade7759.c | 56 >> > > +-- >> > > > drivers/staging/iio/meter/ade7759.h | 53 >> > > - >> > > > 2 files changed, 54 insertions(+), 57 deletions(-) >> > > > >> > > > -- >> > > > 2.11.0 >> > > > >> > > > -- >> > > > 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 >webvisithttps://groups.google.com/d/msgid/outreachy-kernel/20170321133021.6737 >> -1-ar >> > > ushisinghal19971997%40gmail.com. >> > > > 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 outreachy-kernel+unsubscr...@googlegroups.com. >> > > To post to this group, send email to >>
Re: [PATCH] Staging: ks7010 - fixed style block comments
On Tue, Mar 21, 2017 at 08:56:25AM +0100, Greg KH wrote: > On Sun, Mar 19, 2017 at 01:07:17PM +1300, Derek Robson wrote: > > Fixed style of all block comments across whole driver > > Found by checkpatch > > > > Signed-off-by: Derek Robson > > --- > > drivers/staging/ks7010/ks7010_sdio.c | 3 ++- > > drivers/staging/ks7010/ks_hostif.h | 35 +- > > drivers/staging/ks7010/ks_wlan.h | 3 ++- > > drivers/staging/ks7010/ks_wlan_net.c | 41 > > +++- > > 4 files changed, 55 insertions(+), 27 deletions(-) > > This patch doesn't apply to my tree at all :( > Am I working from the right/best tree for driver/staging? https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git Thanks for helping the new guy :-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] drivers: staging: vt6656: fxed coding style errors
On Tue, Mar 21, 2017 at 10:25:40PM +0530, Prasant Jalan wrote: > This patch replaces spaces with tabs for indentation as per kernel > coding standards. > > Signed-off-by: Prasant Jalan > --- > drivers/staging/vt6656/rf.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c > index 068c1c8..f69bced 100644 > --- a/drivers/staging/vt6656/rf.c > +++ b/drivers/staging/vt6656/rf.c > @@ -876,7 +876,7 @@ void vnt_rf_table_download(struct vnt_private *priv) > memcpy(array, addr1, length1); > > vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, > - MESSAGE_REQUEST_RF_INIT, length1, array); > + MESSAGE_REQUEST_RF_INIT, length1, array); > > /* Channel Table 0 */ > value = 0; > @@ -889,7 +889,7 @@ void vnt_rf_table_download(struct vnt_private *priv) > memcpy(array, addr2, length); > > vnt_control_out(priv, MESSAGE_TYPE_WRITE, > - value, MESSAGE_REQUEST_RF_CH0, length, array); > + value, MESSAGE_REQUEST_RF_CH0, length, array); > > length2 -= length; > value += length; > @@ -907,7 +907,7 @@ void vnt_rf_table_download(struct vnt_private *priv) > memcpy(array, addr3, length); > > vnt_control_out(priv, MESSAGE_TYPE_WRITE, > - value, MESSAGE_REQUEST_RF_CH1, length, array); > + value, MESSAGE_REQUEST_RF_CH1, length, array); > > length3 -= length; > value += length; > @@ -924,7 +924,7 @@ void vnt_rf_table_download(struct vnt_private *priv) > > /* Init Table 2 */ > vnt_control_out(priv, MESSAGE_TYPE_WRITE, > - 0, MESSAGE_REQUEST_RF_INIT2, length1, array); > + 0, MESSAGE_REQUEST_RF_INIT2, length1, array); > > /* Channel Table 0 */ > value = 0; > @@ -937,7 +937,7 @@ void vnt_rf_table_download(struct vnt_private *priv) > memcpy(array, addr2, length); > > vnt_control_out(priv, MESSAGE_TYPE_WRITE, > - value, MESSAGE_REQUEST_RF_CH2, length, > array); > + value, MESSAGE_REQUEST_RF_CH2, length, array); Why make this last change? It's now not indented properly :( thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH v6] staging: Use buf_lock instead of mlock and Refactor code
On Tue, Mar 21, 2017 at 10:18 PM, Alison Schofield wrote: > On Mon, Mar 20, 2017 at 01:36:21AM +0530, simran singhal wrote: > > Hi Simran, > > I going to ask for a v7 without looking at the code ;) > Subject line needs subsystem and driver. > Subject and log message can be improved. > >> The IIO subsystem is redefining iio_dev->mlock to be used by >> the IIO core only for protecting device operating mode changes. >> ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes. >> >> In this driver, mlock was being used to protect hardware state >> changes. Replace it with buf_lock in the devices global data. >^^^ this was not done >> >> As buf_lock protects both the adis16060_spi_write() and >> adis16060_spi_read() functions and both are always called in >> pair. First write, then read. Thus, refactor the code to have >> one single function adis16060_spi_write_than_read() which is >> protected by the existing buf_lock. > This was done. So, you were able to obsolete the need for mlock > by creating the paired function. I am still using mlock but now locking it and performing both write and read and than unlocking. So, now have a single safe function. > >> >> Removed nested locks as the function adis16060_read_raw call >> a lock on &st->buf_lock and then calls the function >> adis16060_spi_write which again tries to get hold >> of the same lock. > this was not done. Yes, you avoided nested locks through > proper coding, but we don't want to give the impression in the > log message that there was a pre-existing nested lock issue. > > I did checkpatch & compile it...but looked no further yet. > > alisons >> >> Signed-off-by: simran singhal >> --- >> >> v6: >>-Change commit message >>-Remove nested lock >> >> drivers/staging/iio/gyro/adis16060_core.c | 40 >> ++- >> 1 file changed, 13 insertions(+), 27 deletions(-) >> >> diff --git a/drivers/staging/iio/gyro/adis16060_core.c >> b/drivers/staging/iio/gyro/adis16060_core.c >> index c9d46e7..1c6de46 100644 >> --- a/drivers/staging/iio/gyro/adis16060_core.c >> +++ b/drivers/staging/iio/gyro/adis16060_core.c >> @@ -40,25 +40,17 @@ struct adis16060_state { >> >> static struct iio_dev *adis16060_iio_dev; >> >> -static int adis16060_spi_write(struct iio_dev *indio_dev, u8 val) >> +static int adis16060_spi_write_than_read(struct iio_dev *indio_dev, >> + u8 conf, u16 *val) >> { >> int ret; >> struct adis16060_state *st = iio_priv(indio_dev); >> >> - mutex_lock(&st->buf_lock); >> - st->buf[2] = val; /* The last 8 bits clocked in are latched */ >> + st->buf[2] = conf; /* The last 8 bits clocked in are latched */ >> ret = spi_write(st->us_w, st->buf, 3); >> - mutex_unlock(&st->buf_lock); >> - >> - return ret; >> -} >> - >> -static int adis16060_spi_read(struct iio_dev *indio_dev, u16 *val) >> -{ >> - int ret; >> - struct adis16060_state *st = iio_priv(indio_dev); >> >> - mutex_lock(&st->buf_lock); >> + if (ret < 0) >> + return ret; >> >> ret = spi_read(st->us_r, st->buf, 3); >> >> @@ -69,8 +61,8 @@ static int adis16060_spi_read(struct iio_dev *indio_dev, >> u16 *val) >>*/ >> if (!ret) >> *val = ((st->buf[0] & 0x3) << 12) | >> - (st->buf[1] << 4) | >> - ((st->buf[2] >> 4) & 0xF); >> + (st->buf[1] << 4) | >> + ((st->buf[2] >> 4) & 0xF); >> mutex_unlock(&st->buf_lock); >> >> return ret; >> @@ -83,20 +75,18 @@ static int adis16060_read_raw(struct iio_dev *indio_dev, >> { >> u16 tval = 0; >> int ret; >> + struct adis16060_state *st = iio_priv(indio_dev); >> >> switch (mask) { >> case IIO_CHAN_INFO_RAW: >> /* Take the iio_dev status lock */ >> - mutex_lock(&indio_dev->mlock); >> - ret = adis16060_spi_write(indio_dev, chan->address); >> + mutex_lock(&st->buf_lock); >> + ret = adis16060_spi_write_than_read(indio_dev, >> + chan->address, &tval); >> + mutex_unlock(&st->buf_lock); >> if (ret < 0) >> - goto out_unlock; >> + return ret; >> >> - ret = adis16060_spi_read(indio_dev, &tval); >> - if (ret < 0) >> - goto out_unlock; >> - >> - mutex_unlock(&indio_dev->mlock); >> *val = tval; >> return IIO_VAL_INT; >> case IIO_CHAN_INFO_OFFSET: >> @@ -110,10 +100,6 @@ static int adis16060_read_raw(struct iio_dev *indio_dev, >> } >> >> return -EINVAL; >> - >> -out_unlock: >> - mutex_unlock(&indio_dev->mlock); >> - return ret; >> } >> >> static const struct iio_info adis16060_info = { >> -- >> 2.7.4 >> >> -- >> You received this message because you are subscribed to the Google Groups >
[PATCH] drivers: staging: vt6656: fixed coding style errors
This patch replaces spaces with tabs for indentation as per kernel coding standards. Signed-off-by: Prasant Jalan --- drivers/staging/vt6656/rf.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 068c1c8..0e3a62a 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -876,7 +876,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr1, length1); vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT, length1, array); + MESSAGE_REQUEST_RF_INIT, length1, array); /* Channel Table 0 */ value = 0; @@ -889,7 +889,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH0, length, array); + value, MESSAGE_REQUEST_RF_CH0, length, array); length2 -= length; value += length; @@ -907,7 +907,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr3, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH1, length, array); + value, MESSAGE_REQUEST_RF_CH1, length, array); length3 -= length; value += length; @@ -924,7 +924,7 @@ void vnt_rf_table_download(struct vnt_private *priv) /* Init Table 2 */ vnt_control_out(priv, MESSAGE_TYPE_WRITE, - 0, MESSAGE_REQUEST_RF_INIT2, length1, array); + 0, MESSAGE_REQUEST_RF_INIT2, length1, array); /* Channel Table 0 */ value = 0; @@ -937,7 +937,8 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH2, length, array); + value, MESSAGE_REQUEST_RF_CH2, length, + array); length2 -= length; value += length; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: ks7010 - fixed style block comments
On Wed, Mar 22, 2017 at 07:29:50AM +1300, Derek Robson wrote: > On Tue, Mar 21, 2017 at 08:56:25AM +0100, Greg KH wrote: > > On Sun, Mar 19, 2017 at 01:07:17PM +1300, Derek Robson wrote: > > > Fixed style of all block comments across whole driver > > > Found by checkpatch > > > > > > Signed-off-by: Derek Robson > > > --- > > > drivers/staging/ks7010/ks7010_sdio.c | 3 ++- > > > drivers/staging/ks7010/ks_hostif.h | 35 +- > > > drivers/staging/ks7010/ks_wlan.h | 3 ++- > > > drivers/staging/ks7010/ks_wlan_net.c | 41 > > > +++- > > > 4 files changed, 55 insertions(+), 27 deletions(-) > > > > This patch doesn't apply to my tree at all :( > > > > Am I working from the right/best tree for driver/staging? > > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git What branch did you use? You should use staging-next, or worse case, staging-testing. Don't use 'master', as that tracks Linus's tree and is usually quite old. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] drivers: staging: vt6656: fixed coding style errors
On Wed, Mar 22, 2017 at 12:10:50AM +0530, Prasant Jalan wrote: > This patch replaces spaces with tabs for indentation as per kernel > coding standards. > > Signed-off-by: Prasant Jalan > --- > drivers/staging/vt6656/rf.c | 11 ++- > 1 file changed, 6 insertions(+), 5 deletions(-) Didn't you just send this same patch? If this is a 'v2' patch, please read Documentation/SubmittingPatches for how to properly do that (hint, you need more info here...) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH v3 0/2] Replace mlock with private lock and delete whitespaces
On Tue, Mar 21, 2017 at 11:33:54PM +0530, simran singhal wrote: > The patch series replaces mlock with a private lock for driver ad9834 and > Fix coding style issues related to white spaces. Hi Simran, I'm getting lost. Patchset Subject Line needs subsystem and driver. The comment above says ad9834 but the patches below say ade7753. Can we drive adis16060 through ACK and then come back to this one? (ie. applyling lessons learned) thanks, alisons > > v3: > -Using new private "lock" instead of using "buf_lock" >as it can cause deadlock. > -Sending it as a series of two patches. > > v2: > -Using the existing buf_lock instead of lock. > > > simran singhal (2): > staging: iio: ade7753: Remove trailing whitespaces > staging: iio: ade7753: Replace mlock with driver private lock > > drivers/staging/iio/meter/ade7753.c | 14 -- > 1 file changed, 8 insertions(+), 6 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/1490119436-20042-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 v2] drivers: staging: vt6656: fixed coding style errors
This patch replaces spaces with tabs for indentation as per kernel coding standards. Signed-off-by: Prasant Jalan --- drivers/staging/vt6656/rf.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 068c1c8..0e3a62a 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -876,7 +876,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr1, length1); vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT, length1, array); + MESSAGE_REQUEST_RF_INIT, length1, array); /* Channel Table 0 */ value = 0; @@ -889,7 +889,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH0, length, array); + value, MESSAGE_REQUEST_RF_CH0, length, array); length2 -= length; value += length; @@ -907,7 +907,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr3, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH1, length, array); + value, MESSAGE_REQUEST_RF_CH1, length, array); length3 -= length; value += length; @@ -924,7 +924,7 @@ void vnt_rf_table_download(struct vnt_private *priv) /* Init Table 2 */ vnt_control_out(priv, MESSAGE_TYPE_WRITE, - 0, MESSAGE_REQUEST_RF_INIT2, length1, array); + 0, MESSAGE_REQUEST_RF_INIT2, length1, array); /* Channel Table 0 */ value = 0; @@ -937,7 +937,8 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH2, length, array); + value, MESSAGE_REQUEST_RF_CH2, length, + array); length2 -= length; value += length; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: Eric Anholt offically announces support of VC4 without access to expander on the RPI 3
On Tue, 2017-03-21 at 10:34 -0700, Eric Anholt wrote: > Michael Zoran writes: > > > On Mon, 2017-03-20 at 10:22 -0700, Eric Anholt wrote: > > > Michael Zoran writes: > > > > > > > > > Since the API is completely documented, I see no reason we > > > > > > or > > > > > > anybody > > > > > > couldn't essentially rewrite the driver while it's in > > > > > > staging. I > > > > > > just > > > > > > think it would be best for everyone if the new version was > > > > > > a > > > > > > drop > > > > > > in > > > > > > replacement for the original version. Essential an > > > > > > enhancement > > > > > > rather > > > > > > then a competitor. > > > > > > > > > > I think my comments weren't fundamental changes, but you > > > > > surely > > > > > mean > > > > > the devicetree ABI? I like to see this driver ASAP out of > > > > > staging > > > > > and > > > > > i'm not interested to maintain 2 functional identical driver > > > > > only > > > > > to > > > > > keep compability with the Foundation tree. Currently i'm > > > > > afraid > > > > > that > > > > > we build up many drivers in staging, which need a complete > > > > > rewrite > > > > > later if they should come out of staging. It would be nice if > > > > > we > > > > > could avoid the situation we have with the thermal driver. > > > > > > > > > > Stefan > > > > > > > > The API I'm talking about here is the mailbox API that is used > > > > to > > > > talk > > > > to the firmware. The numbers and structures to pass are > > > > documented. > > > > Nothing prevents anybody from rewriting this driver and > > > > submitting > > > > it > > > > to the appropriate subsystems. It's certainly small enough. > > > > > > > > If you really want working thermal or cpu speed drivers today, > > > > nothing > > > > stops anybody from submitting the downstream drivers after > > > > doing > > > > some > > > > minor touchups and submitting them to staging. That would at > > > > least > > > > get > > > > things working while people argue about what the correct DT > > > > nodes > > > > should be. > > > > > > > > I would also like to point out that the RPI 3 has been out for > > > > over > > > > a > > > > year and nobody has been able to get working video out of it > > > > through > > > > VC4 on a mainline tree. At least until now. So I'm not sure > > > > the > > > > best > > > > way to go is for the expander driver to go under the GPIO > > > > subtree. > > > > > > Excuse me? Display works fine on my Pi3. VC4 uses DDC to probe > > > for > > > connection when the GPIO line isn't present in the DT. > > > > Just a FYI, Eric Anholt has offically announced support for VC4 for > > HDMI on mainline Linus build without any support from the expander > > on > > the RPI 3. > > > > Sounds like this particular driver isn't needed then, correct? > > That's the HDMI audio that just landed. HDMI has been working on the > pi3 since 9d44a8d530e8cc97d71ffcbc0ff3b5553c62. > > In the absence of a GPIO line for hotplug detect, we use DDC, which > is > slower and throws an error in dmesg when the probe happens but HDMI > is > disconnected. As such, having a GPIO driver would improve things for > people. Would a non DT based solution be outside the realm of possibilities? I wrote a very simple library that emulates vcgencmd from the kernel. One of the commands for vcgencmd is to query the HDMI hotplug status. It's sort of semi documentated on the web. The vcgencmd library works, but I haven't tested if the virtualized hotplug info from the command output is correct in all cases. What I'm thinking is I could package this in a single file library that would get put in upstream, but it would only support 1 command only. To query the virtual hotplug status. The only thing is you would need to take a dependency from VC4 to vchiq/vc04_services. It would get VC4 working better on upstream, but it would mean taking a dependency from VC4 to vc04_services and the stagging tree(with all that imples). I think this may be a better solution then arguing with the DT folks on this expander driver that isn't being directly controlled. What do you think? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] drivers: staging: vt6656: fixed coding style errors
This patch replaces spaces with tabs for indentation as per kernel coding standards. Signed-off-by: Prasant Jalan --- drivers/staging/vt6656/rf.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c index 068c1c8..0e3a62a 100644 --- a/drivers/staging/vt6656/rf.c +++ b/drivers/staging/vt6656/rf.c @@ -876,7 +876,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr1, length1); vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0, - MESSAGE_REQUEST_RF_INIT, length1, array); + MESSAGE_REQUEST_RF_INIT, length1, array); /* Channel Table 0 */ value = 0; @@ -889,7 +889,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH0, length, array); + value, MESSAGE_REQUEST_RF_CH0, length, array); length2 -= length; value += length; @@ -907,7 +907,7 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr3, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH1, length, array); + value, MESSAGE_REQUEST_RF_CH1, length, array); length3 -= length; value += length; @@ -924,7 +924,7 @@ void vnt_rf_table_download(struct vnt_private *priv) /* Init Table 2 */ vnt_control_out(priv, MESSAGE_TYPE_WRITE, - 0, MESSAGE_REQUEST_RF_INIT2, length1, array); + 0, MESSAGE_REQUEST_RF_INIT2, length1, array); /* Channel Table 0 */ value = 0; @@ -937,7 +937,8 @@ void vnt_rf_table_download(struct vnt_private *priv) memcpy(array, addr2, length); vnt_control_out(priv, MESSAGE_TYPE_WRITE, - value, MESSAGE_REQUEST_RF_CH2, length, array); + value, MESSAGE_REQUEST_RF_CH2, length, + array); length2 -= length; value += length; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel