From 61241d97db02559bd83d21ffa783ab327945b925 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 26 Oct 2010 12:25:30 +0200 Subject: [PATCH] drivers/staging: delete double assignment 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/) // @@ expression i; @@ *i = ...; i = ...; // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- 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 87a6487531c2..20d509836d9e 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 702a478d5542..a99e900ec4c9 100644 --- a/drivers/staging/hv/hv_utils.c +++ b/drivers/staging/hv/hv_utils.c @@ -211,9 +211,6 @@ static void heartbeat_onchannelcallback(void *context) DPRINT_DBG(VMBUS, "heartbeat packet: len=%d, requestid=%lld", recvlen, requestid); - icmsghdrp = (struct icmsg_hdr *)&buf[ - sizeof(struct vmbuspipe_hdr)]; - icmsghdrp = (struct icmsg_hdr *)&buf[ sizeof(struct vmbuspipe_hdr)]; diff --git a/drivers/staging/rt2860/common/cmm_aes.c b/drivers/staging/rt2860/common/cmm_aes.c index 1d159ff82fd2..a99879bada42 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 5a2197012065..7777d9a60a52 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] == -- 2.20.1