Skip to content

Commit

Permalink
drivers/staging: delete double assignment
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed Nov 9, 2010
1 parent 22b4dc5 commit 61241d9
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
//
Expand Down
3 changes: 0 additions & 3 deletions drivers/staging/hv/hv_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)];

Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/rt2860/common/cmm_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion drivers/staging/westbridge/astoria/api/src/cyasusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] ==
Expand Down

0 comments on commit 61241d9

Please sign in to comment.