From patchwork Mon Aug 17 14:36:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 7025321 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 387FEC05AC for ; Mon, 17 Aug 2015 14:37:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 604AB205E7 for ; Mon, 17 Aug 2015 14:37:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68691205F0 for ; Mon, 17 Aug 2015 14:37:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755644AbbHQOhK (ORCPT ); Mon, 17 Aug 2015 10:37:10 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:28021 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755358AbbHQOhJ (ORCPT ); Mon, 17 Aug 2015 10:37:09 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t7HEau7m000818 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 17 Aug 2015 14:36:58 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t7HEashW013921 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 17 Aug 2015 14:36:54 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t7HEas36001664; Mon, 17 Aug 2015 14:36:54 GMT Received: from mwanda (/154.0.139.178) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 Aug 2015 07:36:53 -0700 Date: Mon, 17 Aug 2015 17:36:47 +0300 From: Dan Carpenter To: QLogic-Storage-Upstream@qlogic.com, Vikas Chaudhary Cc: "James E.J. Bottomley" , linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] qla4xxx: remove some bogus casts Message-ID: <20150817143647.GA23820@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 These casts are wrong and unnecessary. They annoy static checkers because they imply we are planning to write sizeof(long) bytes to a sizeof(u32) buffer which would corrupt memory. Signed-off-by: Dan Carpenter Reviewed-by: Bart Van Assche --- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c index 4180d6d..d97ea5d 100644 --- a/drivers/scsi/qla4xxx/ql4_init.c +++ b/drivers/scsi/qla4xxx/ql4_init.c @@ -101,19 +101,13 @@ int qla4xxx_init_rings(struct scsi_qla_host *ha) ha->response_ptr = &ha->response_ring[ha->response_out]; if (is_qla8022(ha)) { - writel(0, - (unsigned long __iomem *)&ha->qla4_82xx_reg->req_q_out); - writel(0, - (unsigned long __iomem *)&ha->qla4_82xx_reg->rsp_q_in); - writel(0, - (unsigned long __iomem *)&ha->qla4_82xx_reg->rsp_q_out); + writel(0, &ha->qla4_82xx_reg->req_q_out); + writel(0, &ha->qla4_82xx_reg->rsp_q_in); + writel(0, &ha->qla4_82xx_reg->rsp_q_out); } else if (is_qla8032(ha) || is_qla8042(ha)) { - writel(0, - (unsigned long __iomem *)&ha->qla4_83xx_reg->req_q_in); - writel(0, - (unsigned long __iomem *)&ha->qla4_83xx_reg->rsp_q_in); - writel(0, - (unsigned long __iomem *)&ha->qla4_83xx_reg->rsp_q_out); + writel(0, &ha->qla4_83xx_reg->req_q_in); + writel(0, &ha->qla4_83xx_reg->rsp_q_in); + writel(0, &ha->qla4_83xx_reg->rsp_q_out); } else { /* * Initialize DMA Shadow registers. The firmware is really