Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754097AbbFVC5U (ORCPT ); Sun, 21 Jun 2015 22:57:20 -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 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-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1136 Lines: 42 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); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/