From patchwork Tue Mar 9 21:13:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 2902 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Tue, 09 Mar 2010 21:14:19 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra with IMAP (fetchmail-6.3.6) for (single-drop); Tue, 09 Mar 2010 18:16:24 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Np6ks-00081k-RZ; Tue, 09 Mar 2010 21:14:19 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751749Ab0CIVNy (ORCPT + 1 other); Tue, 9 Mar 2010 16:13:54 -0500 Received: from mgw2.diku.dk ([130.225.96.92]:60154 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972Ab0CIVNx (ORCPT ); Tue, 9 Mar 2010 16:13:53 -0500 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id CF26E19BC50; Tue, 9 Mar 2010 22:13:51 +0100 (CET) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 20785-20; Tue, 9 Mar 2010 22:13:49 +0100 (CET) Received: from nhugin.diku.dk (nhugin.diku.dk [130.225.96.140]) by mgw2.diku.dk (Postfix) with ESMTP id 7F7E219BC4A; Tue, 9 Mar 2010 22:13:49 +0100 (CET) Received: from ask.diku.dk (ask.diku.dk [130.225.96.225]) by nhugin.diku.dk (Postfix) with ESMTP id B76DE6DFB62; Tue, 9 Mar 2010 22:08:05 +0100 (CET) Received: by ask.diku.dk (Postfix, from userid 3767) id 63884200B0; Tue, 9 Mar 2010 22:13:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by ask.diku.dk (Postfix) with ESMTP id 50E84200AF; Tue, 9 Mar 2010 22:13:49 +0100 (CET) Date: Tue, 9 Mar 2010 22:13:49 +0100 (CET) From: Julia Lawall To: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/5] drivers/media: drop redundant memset Message-ID: MIME-Version: 1.0 X-Virus-Scanned: amavisd-new at diku.dk Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Julia Lawall The region set by the call to memset is immediately overwritten by the subsequent call to memcpy. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression e1,e2,e3,e4; @@ - memset(e1,e2,e3); memcpy(e1,e4,e3); // Signed-off-by: Julia Lawall --- drivers/media/dvb/bt8xx/dst.c | 2 -- 1 file changed, 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -u -p a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c --- a/drivers/media/dvb/bt8xx/dst.c +++ b/drivers/media/dvb/bt8xx/dst.c @@ -930,7 +930,6 @@ static int dst_fw_ver(struct dst_state * dprintk(verbose, DST_INFO, 1, "Unsupported Command"); return -1; } - memset(&state->fw_version, '\0', 8); memcpy(&state->fw_version, &state->rxbuffer, 8); dprintk(verbose, DST_ERROR, 1, "Firmware Ver = %x.%x Build = %02x, on %x:%x, %x-%x-20%02x", state->fw_version[0] >> 4, state->fw_version[0] & 0x0f, @@ -1053,7 +1052,6 @@ static int dst_get_tuner_info(struct dst goto force; } } - memset(&state->board_info, '\0', 8); memcpy(&state->board_info, &state->rxbuffer, 8); if (state->type_flags & DST_TYPE_HAS_MULTI_FE) { dprintk(verbose, DST_ERROR, 1, "DST type has TS=188");