From patchwork Mon Jun 22 02:48:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaishali Thakkar X-Patchwork-Id: 6653001 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 0F57BC05AC for ; Mon, 22 Jun 2015 02:48:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D2FE20660 for ; Mon, 22 Jun 2015 02:48:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 925F22065E for ; Mon, 22 Jun 2015 02:48:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752947AbbFVCsP (ORCPT ); Sun, 21 Jun 2015 22:48:15 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35545 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751922AbbFVCsO (ORCPT ); Sun, 21 Jun 2015 22:48:14 -0400 Received: by pacyo7 with SMTP id yo7so20630650pac.2; Sun, 21 Jun 2015 19:48:14 -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=8nvYRrHGCwTf6zTgsloTjY89Kb3C/iVMhkPb6yBilsY=; b=tDAetI2E3DuITAX70uzpmD7gptfVtSVpILcTnZhcUZnDByDzpgqogj1bcOFDpIUcqa e+J/5glRINRwJHhxo9L+4tDzktrlboOWKThCtDCIdmkXp3l9k26CcJl/OK/5juj5izuF sOckHRDJs9f9lzwXt/tAChaT1KLMbXaTccIBxW/u/EGTEqBVTtXxn3+R95r+poST7OaP WfuIv98/NfC+egu8HyP4X6dU8UQ18+KoGpww+HKmEaKKAcBVBEFu0G1g9dBtPXrChluU J1jg/epolZUb3yEwR6sazEm2jVKvvzCyYP4CqLJDcfthhQcXzNeB47iYRsnL9oPxKK3t AekQ== X-Received: by 10.66.65.162 with SMTP id y2mr54391631pas.101.1434941294026; Sun, 21 Jun 2015 19:48:14 -0700 (PDT) Received: from vaishali-Ideapad-Z570 ([43.249.235.69]) by mx.google.com with ESMTPSA id ho2sm17936476pbb.14.2015.06.21.19.48.12 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 21 Jun 2015 19:48:12 -0700 (PDT) Date: Mon, 22 Jun 2015 08:18:06 +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] [SCSI] fnic: Replace memset with eth_broadcast_addr Message-ID: <20150622024806.GA4736@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_zero_addr to assign the zero 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 --- 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);