Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1500849

[PATCH 2/5] [media] winbond-cir: Move a variable assignment in wbcir_tx()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 2/5] [media] winbond-cir: Move a variable assignment in wbcir_tx()
Date 2016-10-14 13:50 +0200
Message-ID <ss99U-JJ-29@gated-at.bofh.it> (permalink)
References <qEuGl-43C-5@gated-at.bofh.it> <ss99T-JJ-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 14 Oct 2016 07:34:46 +0200

Move the assignment for the local variable "data" behind the source code
for a memory allocation by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/rc/winbond-cir.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 59050f5..fd997f0 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -655,7 +655,7 @@ wbcir_txmask(struct rc_dev *dev, u32 mask)
 static int
 wbcir_tx(struct rc_dev *dev, unsigned *b, unsigned count)
 {
-	struct wbcir_data *data = dev->priv;
+	struct wbcir_data *data;
 	unsigned *buf;
 	unsigned i;
 	unsigned long flags;
@@ -668,6 +668,7 @@ wbcir_tx(struct rc_dev *dev, unsigned *b, unsigned count)
 	for (i = 0; i < count; i++)
 		buf[i] = DIV_ROUND_CLOSEST(b[i], 10);
 
+	data = dev->priv;
 	/* Not sure if this is possible, but better safe than sorry */
 	spin_lock_irqsave(&data->spinlock, flags);
 	if (data->txstate != WBCIR_TXSTATE_INACTIVE) {
-- 
2.10.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] [media] winbond-cir: Fine-tuning for four function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
  [PATCH 2/5] [media] winbond-cir: Move a variable assignment in  wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
    Re: [PATCH 2/5] [media] winbond-cir: Move a variable assignment  in wbcir_tx() "David Härdeman" <david@hardeman.nu> - 2016-10-19 17:40 +0200
      Re: [media] winbond-cir: Move a variable assignment in wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 18:30 +0200
  [PATCH 5/5] [media] winbond-cir: Move a variable assignment in two  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
    Re: [PATCH 5/5] [media] winbond-cir: Move a variable assignment  in two functions "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
  [PATCH 4/5] [media] winbond-cir: One variable and its check less in  wbcir_shutdown() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
    Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less  in wbcir_shutdown() after error detection Sean Young <sean@mess.org> - 2016-10-15 15:40 +0200
      Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less  in wbcir_shutdown() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-15 18:50 +0200
        Re: [PATCH 4/5] [media] winbond-cir: One variable and its check  less in wbcir_shutdown() after error detection "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
          Re: [PATCH 4/5] [media] winbond-cir: One variable and its check less  in wbcir_shutdown() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 18:30 +0200
      Re: [PATCH 4/5] [media] winbond-cir: One variable and its check  less in wbcir_shutdown() after error detection "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
  [PATCH 1/5] [media] winbond-cir: Use kmalloc_array() in wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
    Re: [PATCH 1/5] [media] winbond-cir: Use kmalloc_array() in  wbcir_tx() "David Härdeman" <david@hardeman.nu> - 2016-10-19 17:40 +0200
  [PATCH 3/5] [media] winbond-cir: Move assignments for three variables  in wbcir_shutdown() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-14 13:50 +0200
    Re: [PATCH 3/5] [media] winbond-cir: Move assignments for three  variables in wbcir_shutdown() "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200
      Re: [media] winbond-cir: Move assignments for three variables in  wbcir_shutdown() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:30 +0200
        Re: [media] winbond-cir: Move assignments for three variables in  wbcir_shutdown() "David Härdeman" <david@hardeman.nu> - 2016-10-19 17:50 +0200
  Re: [media] winbond-cir: Move a variable assignment in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:20 +0200
  Re: [media] winbond-cir: Move a variable assignment in wbcir_tx() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:20 +0200
  Re: [media] winbond-cir: Move assignments for three variables in  wbcir_shutdown() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 16:20 +0200
  Re: [media] winbond-cir: Move a variable assignment in wbcir_tx() "David Härdeman" <david@hardeman.nu> - 2016-10-19 16:30 +0200

csiph-web