mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia@diku.dk>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: kernel-janitors@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/14] drivers/staging: delete double assignment
Date: Tue, 26 Oct 2010 12:25:30 +0200	[thread overview]
Message-ID: <1288088743-3725-2-git-send-email-julia@diku.dk> (raw)
In-Reply-To: <1288088743-3725-1-git-send-email-julia@diku.dk>

From: Julia Lawall <julia@diku.dk>

Delete successive assignments to the same location.  In three of the cases,
the two assignments are identical.  In the case of the file
rt2860/common/cmm_aes.c, the assigned variable i is never used, so both
assignments are dropped.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression i;
@@

*i = ...;
 i = ...;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c     |    1 -
 drivers/staging/hv/hv_utils.c                        |    3 ---
 drivers/staging/rt2860/common/cmm_aes.c              |    2 --
 drivers/staging/westbridge/astoria/api/src/cyasusb.c |    1 -
 4 files changed, 7 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
index 87a6487..20d5098 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
@@ -286,7 +286,6 @@ int ft1000_CreateDevice(struct ft1000_device *dev)
     pid = kernel_thread (exec_mknod, (void *)info, 0);
 
     // initialize application information
-    info->appcnt = 0;
 
 //    if (ft1000_flarion_cnt == 0) {
 //
diff --git a/drivers/staging/hv/hv_utils.c b/drivers/staging/hv/hv_utils.c
index 702a478..a99e900 100644
--- a/drivers/staging/hv/hv_utils.c
+++ b/drivers/staging/hv/hv_utils.c
@@ -212,9 +212,6 @@ static void heartbeat_onchannelcallback(void *context)
 			   recvlen, requestid);
 
 		icmsghdrp = (struct icmsg_hdr *)&buf[
-			sizeof(struct vmbuspipe_hdr)];
-
-		icmsghdrp = (struct icmsg_hdr *)&buf[
 				sizeof(struct vmbuspipe_hdr)];
 
 		if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
diff --git a/drivers/staging/rt2860/common/cmm_aes.c b/drivers/staging/rt2860/common/cmm_aes.c
index 1d159ff..a99879b 100644
--- a/drivers/staging/rt2860/common/cmm_aes.c
+++ b/drivers/staging/rt2860/common/cmm_aes.c
@@ -330,8 +330,6 @@ void construct_mic_iv(unsigned char *mic_iv,
 	for (i = 8; i < 14; i++)
 		mic_iv[i] = pn_vector[13 - i];	/* mic_iv[8:13] = PN[5:0] */
 #endif
-	i = (payload_length / 256);
-	i = (payload_length % 256);
 	mic_iv[14] = (unsigned char)(payload_length / 256);
 	mic_iv[15] = (unsigned char)(payload_length % 256);
 
diff --git a/drivers/staging/westbridge/astoria/api/src/cyasusb.c b/drivers/staging/westbridge/astoria/api/src/cyasusb.c
index 5a21970..7777d9a 100644
--- a/drivers/staging/westbridge/astoria/api/src/cyasusb.c
+++ b/drivers/staging/westbridge/astoria/api/src/cyasusb.c
@@ -1417,7 +1417,6 @@ cy_as_usb_set_enum_config(cy_as_device_handle handle,
 	 */
 	bus_mask   = 0;
 	media_mask = 0;
-	media_mask = 0;
 	for (bus = 0; bus < CY_AS_MAX_BUSES; bus++) {
 		for (device = 0; device < CY_AS_MAX_STORAGE_DEVICES; device++) {
 			if (config_p->devices_to_enumerate[bus][device] ==


  reply	other threads:[~2010-10-26 10:21 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26 10:25 [PATCH 0/14] " Julia Lawall
2010-10-26 10:25 ` Julia Lawall [this message]
2010-10-26 10:25 ` [PATCH 2/14] drivers/usb/gadget/amd5536udc.c: " Julia Lawall
2010-10-26 13:43   ` Thomas Dahlmann
2010-10-26 10:25 ` [PATCH 3/14] drivers/vhost/vhost.c: " Julia Lawall
2010-10-26 11:06   ` Michael S. Tsirkin
2010-10-26 10:25 ` [PATCH 4/14] drivers/staging/brcm80211/brcmfmac/dhd_linux.c: " Julia Lawall
2010-10-26 10:25 ` [PATCH 5/14] drivers/net/sb1000.c: " Julia Lawall
2010-10-26 11:58   ` walter harms
2010-10-26 12:25     ` Julia Lawall
2010-10-27 19:23   ` David Miller
2010-10-26 10:25 ` [PATCH 6/14] arch/mips/pmc-sierra/yosemite/setup.c: " Julia Lawall
2010-11-09  0:48   ` Ralf Baechle
2010-11-09  7:10     ` Julia Lawall
2010-10-26 10:25 ` [PATCH 7/14] drivers/net/typhoon.c: " Julia Lawall
2010-10-26 11:52   ` David Dillow
2010-10-27 19:24   ` David Miller
2010-10-26 10:25 ` [PATCH 8/14] drivers/platform/x86/thinkpad_acpi.c: " Julia Lawall
2010-10-27  1:09   ` Henrique de Moraes Holschuh
2010-10-27  1:24     ` [ibm-acpi-devel] " Henrique de Moraes Holschuh
2010-10-27  3:54     ` Dan Carpenter
2010-10-27 21:42       ` Henrique de Moraes Holschuh
2010-10-27  5:03     ` Julia Lawall
2010-10-27  7:18     ` walter harms
2010-10-27  8:11       ` Dan Carpenter
2010-11-24 16:51   ` Matthew Garrett
2010-10-26 10:25 ` [PATCH 9/14] sound/oss/sb_ess.c: " Julia Lawall
2010-10-27  7:13   ` Takashi Iwai
2010-10-26 10:25 ` [PATCH 10/14] drivers/isdn: " Julia Lawall
2010-10-26 11:55   ` walter harms
2010-10-26 12:01     ` Julia Lawall
2010-10-26 12:20     ` Julia Lawall
2010-10-27 19:24       ` David Miller
2010-10-26 10:25 ` [PATCH 11/14] drivers/serial/vr41xx_siu.c: " Julia Lawall
2010-10-26 10:25 ` [PATCH 12/14] drivers/video/omap/blizzard.c: " Julia Lawall
2010-10-26 12:36   ` Nicolas Kaiser
2010-10-26 10:25 ` [PATCH 13/14] drivers/scsi/be2iscsi/be_main.c: " Julia Lawall
2010-10-26 10:25 ` [PATCH 14/14] drivers/ata/pata_octeon_cf.c: " Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1288088743-3725-2-git-send-email-julia@diku.dk \
    --to=julia@diku.dk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®