From patchwork Mon May 28 07:47:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10430003 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 83600602CC for ; Mon, 28 May 2018 07:48:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68D2D28451 for ; Mon, 28 May 2018 07:48:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D6342867C; Mon, 28 May 2018 07:48:36 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable 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 2148D28451 for ; Mon, 28 May 2018 07:48:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753974AbeE1HsY (ORCPT ); Mon, 28 May 2018 03:48:24 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:44928 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753668AbeE1HsX (ORCPT ); Mon, 28 May 2018 03:48:23 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4S7kIHt127200; Mon, 28 May 2018 07:48:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=ha5GBbCDYlpE2jkvhy/lifI8wRhhb6TM94wTs1IM8YA=; b=BcBQq4iGEqvaExrTzLjc90e9HJb4wnhW2yOs3JC5AHvJ9F/ruxvH5lBYjCxJWbrma+/P jxNReoMT+JvASgspNRJ1bfWNuJp0oesYuJiiqDY9p0Pp204i85NMEN1iud+pdyF3q/xM /44Oz7xW4BYtHjxu5xMlJGS2nlTnBs+Jzs/f2K2FVlpRG0PktutMJOT8ekLyo8GilTPx vfcouliwuJy1lB8zGVJ2Y/0Vn93PJyD2wVOBv3ceWpgPGn6a1aX9/t5ZDw0V4yEHqKIQ UNj6QhXajUtigKMnRRbDY2JvOc9L99gSmPK1Bscr8vplDkQPAg2DCMIIpap0E9EM3fOm 6Q== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2j7084vbw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 May 2018 07:48:08 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4S7m7MT004634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 May 2018 07:48:07 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4S7m6uI008800; Mon, 28 May 2018 07:48:06 GMT Received: from kili.mountain (/41.202.241.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 28 May 2018 00:48:06 -0700 Date: Mon, 28 May 2018 10:47:56 +0300 From: Dan Carpenter To: Alex Williamson Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] vfio/pci: remove a bogus cast in vfio_msi_set_block() Message-ID: <20180528074756.bgl5fxvn7foe5uhn@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8906 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=870 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805280096 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This cast is confusing... The "start" variable is an unsigned int. We absolutely do not want to cast it to a negative int so why is the cast there? It turns out, when you look at the context, it's a no-op and we can just remove it. Signed-off-by: Dan Carpenter diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c index 1c46045b0e7f..2724fed62129 100644 --- a/drivers/vfio/pci/vfio_pci_intrs.c +++ b/drivers/vfio/pci/vfio_pci_intrs.c @@ -368,7 +368,7 @@ static int vfio_msi_set_block(struct vfio_pci_device *vdev, unsigned start, } if (ret) { - for (--j; j >= (int)start; j--) + for (--j; j >= start; j--) vfio_msi_set_vector_signal(vdev, j, -1, msix); }