Skip to contentSkip to conversation

Staging: speakup: Add comment for spinlock definition

PATCH In review Keerthi Reddy 2 participants 2 messages Sep 28, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: speakup: Add comment for spinlock definition

Its good practice to comment the usage of spinlock variable. Specially because, at the time of congestion, it becomes easy to identify how a particular mutex is used. This improves readability of code. So add comment for spinlock variable.

---
 drivers/staging/speakup/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/main.c +1 -1
index e215d05..bb3908a 100644
@@ -246,7 +246,7 @@ static u_long last_spk_jiffy;
 
 struct st_spk_t *speakup_console[MAX_NR_CONSOLES];
 
-DEFINE_MUTEX(spk_mutex);
+DEFINE_MUTEX(spk_mutex); /* Spinlock for synth_release() */
 
 static int keyboard_notifier_call(struct notifier_block *,
 				  unsigned long code, void *param);
Signature · 1 line
2.7.4
#1 lore raw

Hello,

Quoted 1 line · Keerthi Reddy, on jeu. 28 sept. 2017 20:06:02 +0530, wrote:

Its good practice to comment the usage of spinlock variable.

Yes, but

drivers/staging/speakup/main.c static u_long last_spk_jiffy; · line 249

Quoted 6 lines
drivers/staging/speakup/main.c +1 -1
@@ -246,7 +246,7 @@ static u_long last_spk_jiffy;
 
 struct st_spk_t *speakup_console[MAX_NR_CONSOLES];
 
-DEFINE_MUTEX(spk_mutex);
+DEFINE_MUTEX(spk_mutex); /* Spinlock for synth_release() */

This is far from properly describing its role :)

See the use in all other files, this mutex is meant to lock the whole speakup screen reader.

Samuel