From patchwork Mon Jun 22 02:57:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 6653021 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 92472C05AC for ; Mon, 22 Jun 2015 02:57:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF0B220546 for ; Mon, 22 Jun 2015 02:57:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F79120544 for ; Mon, 22 Jun 2015 02:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753248AbbFVC5N (ORCPT ); Sun, 21 Jun 2015 22:57:13 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:35334 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbbFVC5L (ORCPT ); Sun, 21 Jun 2015 22:57:11 -0400 Received: by pdbci14 with SMTP id ci14so70220111pdb.2; Sun, 21 Jun 2015 19:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=fC3NodG05CHY7XsfkXU/HbfvYQla1AAe7wNyBnLiVk8=; b=wyHpMsMH+3btiFgI0/jl1raUZwoa/GQRv3ABem5/5M5Vkkc2K38ofRG42Q7oQZAkzH 3/s8Oh6B9PXyl370IzRplArcvUv5gWdhsbUEkUbcUCKNPcHzAEJMiMkd/JoaVdcZCcZe JBg5hGj4DTYSOE2nOJDCQNgVE8RL5KDqgK8ieDYw7NR8PZDCxfWsmb/XUP4P9lNnG73R OHUkkluiTAXnaUxNK/xhYW4ZMF3Iy3/Ws7t5TX996FPbGYEOInV2z2Bovh120d6lh5mY VPfqWFXjSx4UuF4+m4LUialpj1L0CAp23Qk4eKfvK7TECPZI7xHwLQcsPg0Yc+/EnEoq j8Cw== X-Received: by 10.70.118.5 with SMTP id ki5mr55192552pdb.6.1434941831248; Sun, 21 Jun 2015 19:57:11 -0700 (PDT) Received: from vaishali-Ideapad-Z570 ([43.249.235.69]) by mx.google.com with ESMTPSA id bf5sm3101814pad.43.2015.06.21.19.57.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Jun 2015 19:57:10 -0700 (PDT) Date: Mon, 22 Jun 2015 08:27:04 +0530 From: Vaishali Thakkar To: Hiral Patel Cc: Suma Ramars , Brian Uchino , "James E.J. Bottomley" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] [SCSI] fnic: Replace memset with eth_broadcast_addr Message-ID: <20150622025704.GA4784@vaishali-Ideapad-Z570> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use eth_broadcast_addr to assign the broadcast address to the given address array instead of memset when second argument is a broadcast address 0xff. The Coccinelle semantic patch that makes this change is as follows: // @eth_broadcast_addr@ identifier e; @@ -memset(e,\(0xff\|0xFF\|255\),ETH_ALEN); +eth_broadcast_addr(e); // Signed-off-by: Vaishali Thakkar --- Change since v1: - Fix mistake in commit log --- drivers/scsi/fnic/fnic_scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c index 155b286..650d448 100644 --- a/drivers/scsi/fnic/fnic_scsi.c +++ b/drivers/scsi/fnic/fnic_scsi.c @@ -276,7 +276,7 @@ int fnic_flogi_reg_handler(struct fnic *fnic, u32 fc_id) } if (fnic->ctlr.map_dest) { - memset(gw_mac, 0xff, ETH_ALEN); + eth_broadcast_addr(gw_mac); format = FCPIO_FLOGI_REG_DEF_DEST; } else { memcpy(gw_mac, fnic->ctlr.dest_addr, ETH_ALEN);