From patchwork Tue Jul 11 14:27:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitkumar Karwar X-Patchwork-Id: 9834895 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 08CFB602A0 for ; Tue, 11 Jul 2017 14:38:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED2E72847D for ; Tue, 11 Jul 2017 14:38:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0B2F284D1; Tue, 11 Jul 2017 14:38:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C3222847D for ; Tue, 11 Jul 2017 14:38:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933146AbdGKOiK (ORCPT ); Tue, 11 Jul 2017 10:38:10 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36348 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932977AbdGKOiJ (ORCPT ); Tue, 11 Jul 2017 10:38:09 -0400 Received: by mail-pg0-f67.google.com with SMTP id y129so157116pgy.3 for ; Tue, 11 Jul 2017 07:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=POkTtIlCIOpj8kb271A5PPjlhZlSz3+whEY5QND50rY=; b=ZEjrG9PcwN38NG0rdq1AYsq40Z7r5ucR1RHMVL2iv0lfjcOsYxjEM3bxKdSOFNu6tu 5hK4PEidO8QTsSEOKIQkQvuKGsrmDVoASU0bebu2zD1J24N+o8kIGnRpyuE1/JzHsfX1 qYzVyS1gl8qpZHT4xBFBuGxeCx/vX13RYqhMX+KDCfaU2FX9YnUmphcoJS9UczV6evVn 8+Fe2M6MjLUFis8hiXFzKFqnnd4+3gT2CBC+/OStFE3DYkgxnREdYOGFwhN5kFqMiWes 0hmXbVk6LbSS3c/TGgkCWsp2iRgEAXGL8RjvQRjnYX8EGdUhEXedMQEpdhp+4+BIHpab 79fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=POkTtIlCIOpj8kb271A5PPjlhZlSz3+whEY5QND50rY=; b=bcJAnPqOkgKAAPYAf44UJTYx7oSEF2dVBo3gcBibg09bDV6geJSB8JG3Q1X/uhpfLQ qgeVe58F8opT5K9eiKnCRMSY7HUJLXDs2yaqpceeSeRIV5id2fYThNlKjE/+n7I0CyXX SvmdzeWRFXbNiRWBlDO+OlExYjPJtEySZ6XZDNFDXzWGhY9kKKfrzi4R30mpQ0MDghVV Ure3WPTumws9/V67QTkZxzjvjIH5pIFhhemrq3Zlc3k3tYajpqeOTiQLktJg/k+WIEJ/ CpiLbHNNK/qhbaDqR6Nk4d8bB0mh03Owu49S+sp6K1fXWnWpH5HP7LdxA1P9i5+SgjF8 Vy+A== X-Gm-Message-State: AIVw110tkUnE2zIoi4B8ITLU7qvSFWbSKzbRH1QLDUfkDuHp79b7mrJ2 7jWISJZtx8UrPQ== X-Received: by 10.98.57.4 with SMTP id g4mr50290562pfa.155.1499783470828; Tue, 11 Jul 2017 07:31:10 -0700 (PDT) Received: from cpu185.redpinesignals.com ([203.196.161.90]) by smtp.gmail.com with ESMTPSA id x124sm228941pgb.20.2017.07.11.07.31.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Jul 2017 07:31:10 -0700 (PDT) From: Amitkumar Karwar To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Prameela Rani Garnepudi Subject: [PATCH 3/3] rsi: fix static checker warning Date: Tue, 11 Jul 2017 19:57:53 +0530 Message-Id: <1499783273-15428-3-git-send-email-amitkarwar@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499783273-15428-1-git-send-email-amitkarwar@gmail.com> References: <1499783273-15428-1-git-send-email-amitkarwar@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Amitkumar Karwar u32 pointer is changed to u16 and filled the value. Problem is solved by using local temporary variable. Below static checker warning was reported. drivers/net/wireless/rsi/rsi_91x_usb.c:400 rsi_usb_master_reg_read() warn: passing casted pointer 'value' to 'rsi_usb_reg_read()' 32 vs 16. Fixes: b97e9b94ad75c ("rsi: Add new host interface operations") Signed-off-by: Amitkumar Karwar --- drivers/net/wireless/rsi/rsi_91x_usb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index 3d33ce9..9097f7e 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -404,8 +404,15 @@ static int rsi_usb_master_reg_read(struct rsi_hw *adapter, u32 reg, { struct usb_device *usbdev = ((struct rsi_91x_usbdev *)adapter->rsi_dev)->usbdev; + u16 temp; + int ret; - return rsi_usb_reg_read(usbdev, reg, (u16 *)value, len); + ret = rsi_usb_reg_read(usbdev, reg, &temp, len); + if (ret < 0) + return ret; + *value = temp; + + return 0; } static int rsi_usb_master_reg_write(struct rsi_hw *adapter,