From patchwork Wed May 23 02:27:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Elmously X-Patchwork-Id: 918699 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40rGgF4kZFz9s37; Wed, 23 May 2018 12:29:29 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fLJWl-00031h-2j; Wed, 23 May 2018 02:29:23 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fLJWh-0002za-JL for kernel-team@lists.ubuntu.com; Wed, 23 May 2018 02:29:19 +0000 Received: from mail-io0-f197.google.com ([209.85.223.197]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fLJWh-0007r8-8u for kernel-team@lists.ubuntu.com; Wed, 23 May 2018 02:29:19 +0000 Received: by mail-io0-f197.google.com with SMTP id u23-v6so16763121ioc.13 for ; Tue, 22 May 2018 19:29:19 -0700 (PDT) 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=ZpzIqxvYffIIv6ueDGcpGdBaSjfcQbREnRu8AzV32MQ=; b=DPCf7b4zH6AgJl4VDcQSVZFigfRZd0zpVl//C12PW3cLTERLXz6AEJXNEZ746Dud2W th6ofUI1PlKttqAoYZmRCjQMs1nxdaGsU/J3rWzFhhGc7/vlS7YPElJdt4gho67uX5Cy 2WFR73wUbYks+7yazY0+SZFQEqR79SXDWm5bSTfxDE9fqxfGbx/nztbYjSjKMW355vvS GIqd6S4s0Bvp5tTWg3A5W/vn577Kaa920/KMuV1ohFN/qXI7Sh49K64EXc3v3YeCK+7o GCAoMQGmwYtGe2T7IBQ1alsm0IAatXMC2VJMrCbMOfJk16VHwtuciqScfMedrhXo5Bz5 1l8A== X-Gm-Message-State: ALKqPwdr/xHw2OOQb4X4Ghwjegk8JuruaaOE431EzW8qb2yQh8jZl14s dTJ8SUoWu560+GQbpibdpcAy+RnlhY4GRqMt7Eo3r5jvnIlL+ZnzAEsHqLpMp+qvRzHEOamrP0D /yYlHejmgfCdq9Oy+iG4PdAgMrVGXQgdaqvEYcdxAeQ== X-Received: by 2002:a6b:ac42:: with SMTP id v63-v6mr777497ioe.261.1527042557661; Tue, 22 May 2018 19:29:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqgcc7neJVizeLTL4UtaUG8MdbPbO6L39agjnm+HBcwM6ysuGbSazGV3UpwRRVERJZbeYuK5g== X-Received: by 2002:a6b:ac42:: with SMTP id v63-v6mr777493ioe.261.1527042557516; Tue, 22 May 2018 19:29:17 -0700 (PDT) Received: from kbuntu.fuzzbuzz.org (198-84-180-15.cpe.teksavvy.com. [198.84.180.15]) by smtp.gmail.com with ESMTPSA id m16-v6sm9428605iob.69.2018.05.22.19.29.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 19:29:16 -0700 (PDT) From: Khalid Elmously To: kernel-team@lists.ubuntu.com Subject: [CVE-2017-18232][A][PATCH 02/11] scsi: libsas: remove the numbering for each event enum Date: Tue, 22 May 2018 22:27:50 -0400 Message-Id: <20180523022759.22556-3-khalid.elmously@canonical.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180523022759.22556-1-khalid.elmously@canonical.com> References: <20180523022759.22556-1-khalid.elmously@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Jason Yan CVE-2017-18232 Numbering for each event enum makes no sense. Remove the numbering so that we don't have to calculate the number by hand every time. Signed-off-by: Jason Yan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen (cherry-picked from 0d78f969b10f27e0be34210d482a01e1ee92994c ) Signed-off-by: Khalid Elmously --- include/scsi/libsas.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index e5365979cb08..ccf3b48a38f4 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -62,31 +62,31 @@ enum sas_phy_type { */ enum port_event { PORTE_BYTES_DMAED = 0U, - PORTE_BROADCAST_RCVD = 1, - PORTE_LINK_RESET_ERR = 2, - PORTE_TIMER_EVENT = 3, - PORTE_HARD_RESET = 4, - PORT_NUM_EVENTS = 5, + PORTE_BROADCAST_RCVD, + PORTE_LINK_RESET_ERR, + PORTE_TIMER_EVENT, + PORTE_HARD_RESET, + PORT_NUM_EVENTS, }; enum phy_event { PHYE_LOSS_OF_SIGNAL = 0U, - PHYE_OOB_DONE = 1, - PHYE_OOB_ERROR = 2, - PHYE_SPINUP_HOLD = 3, /* hot plug SATA, no COMWAKE sent */ - PHYE_RESUME_TIMEOUT = 4, - PHY_NUM_EVENTS = 5, + PHYE_OOB_DONE, + PHYE_OOB_ERROR, + PHYE_SPINUP_HOLD, /* hot plug SATA, no COMWAKE sent */ + PHYE_RESUME_TIMEOUT, + PHY_NUM_EVENTS, }; enum discover_event { DISCE_DISCOVER_DOMAIN = 0U, - DISCE_REVALIDATE_DOMAIN = 1, - DISCE_PORT_GONE = 2, - DISCE_PROBE = 3, - DISCE_SUSPEND = 4, - DISCE_RESUME = 5, - DISCE_DESTRUCT = 6, - DISC_NUM_EVENTS = 7, + DISCE_REVALIDATE_DOMAIN, + DISCE_PORT_GONE, + DISCE_PROBE, + DISCE_SUSPEND, + DISCE_RESUME, + DISCE_DESTRUCT, + DISC_NUM_EVENTS, }; /* ---------- Expander Devices ---------- */