From patchwork Wed Nov 11 01:47:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 11896095 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 36ECD697 for ; Wed, 11 Nov 2020 01:47:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 055A3216C4 for ; Wed, 11 Nov 2020 01:47:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="XG1NLhaz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731984AbgKKBra (ORCPT ); Tue, 10 Nov 2020 20:47:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731610AbgKKBra (ORCPT ); Tue, 10 Nov 2020 20:47:30 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3991FC0613D1 for ; Tue, 10 Nov 2020 17:47:30 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id j2so736601ybb.12 for ; Tue, 10 Nov 2020 17:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=FxgG6C8MNarNIrksAc2vZbdhW8ip0bCS/z9vVgyXDNc=; b=XG1NLhaztaGy9uEIyJqVmQKwvkssXXvS2Zw2USFL0RJT2tfUR1g2p5CuJrbwHdzWHB ejdaqHnxoveZbJSjTc8f5NxlXlOvbTXWKCxqp2VhTXu+nMfdtCo3uw1bKobNjHPpPqIZ ewpqi/dESTPK86rhP2kLhYtjve+Sr/cwGhpRX/5yuZ7EVqKUXOmAyIug5bpICNnXY4cm pgejCoywbt5Qx9j3KMLaP+VPN69gnia0q6Aj9Xxpykg3wY78IW5kuhPtmOufP/Y4enUw HFI7h+m0rGp1cEq6B8EO9xp9Hdtnji6+q34+/3mnwSo1lNBawPPHhqaeetGXVVHEjtD4 TJxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=FxgG6C8MNarNIrksAc2vZbdhW8ip0bCS/z9vVgyXDNc=; b=Mekbx+KiLwPvxWMZQWWsWHCSTo5GzR7wOqEma5QeXTacsmdbZpdDSy25q7Rp46hdNH TK6O8WljkugU9DipMyQnTY/d1G9tipetLrRDuLEIritjuMl0aKwpa+L4kWjGH78owBuo woqUc0QyHGxlwF8qXLtopu0FkuvqIEYC23kOTofjipPCEXSBWksl/ILYSuCnmZwWupnt IlaLOcRGn+3EQ4gKY/KmDA2Zh3NuG39wr5APGMdVi1jWuxqizpG9eZdhtqV9IBCOy+RJ Qm6/89NuV97u0NFUgN5Fprxr7oUtY9e+P5Sr/37IL/UCE7GPL3Csys6/0gr3uezLvNtJ wdUQ== X-Gm-Message-State: AOAM531LCoL1S453ZE8eHsiy92Y22rFTaTz0cefEbVXgMDmFoYNFXQeS fFi6F/1bqe8xPbp7hyU9byAzhQpiV63ANoXi3Jk= X-Google-Smtp-Source: ABdhPJxO9Fs0lN744pI3vERiDRD0xhvwSXC3poyrmXrPztNJ9LEnOYhMgqZheafU2uzfqtDyv71Wuvop9Lp6zl6YHlI= Sender: "ndesaulniers via sendgmr" X-Received: from ndesaulniers1.mtv.corp.google.com ([2620:15c:211:202:f693:9fff:fef4:4d25]) (user=ndesaulniers job=sendgmr) by 2002:a5b:886:: with SMTP id e6mr12574836ybq.473.1605059249452; Tue, 10 Nov 2020 17:47:29 -0800 (PST) Date: Tue, 10 Nov 2020 17:47:14 -0800 Message-Id: <20201111014716.260633-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog Subject: [PATCH] usb: fix a few cases of -Wfallthrough From: Nick Desaulniers To: Greg Kroah-Hartman , "Gustavo A . R . Silva" Cc: Nick Desaulniers , Alan Stern , Mathias Nyman , Nathan Chancellor , Johan Hovold , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The "fallthrough" pseudo-keyword was added as a portable way to denote intentional fallthrough. Clang will still warn on cases where there is a fallthrough to an immediate break. Add explicit breaks for those cases. Signed-off-by: Nick Desaulniers Reviewed-by: Nathan Chancellor --- drivers/usb/core/config.c | 1 + drivers/usb/host/ehci-hcd.c | 2 +- drivers/usb/host/ohci-hcd.c | 2 +- drivers/usb/host/ohci-hub.c | 1 + drivers/usb/host/xhci-ring.c | 2 ++ 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 562a730befda..b199eb65f378 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -1076,6 +1076,7 @@ int usb_get_bos_descriptor(struct usb_device *dev) case USB_PTM_CAP_TYPE: dev->bos->ptm_cap = (struct usb_ptm_cap_descriptor *)buffer; + break; default: break; } diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 3575b7201881..e358ae17d51e 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -867,7 +867,7 @@ static int ehci_urb_enqueue ( */ if (urb->transfer_buffer_length > (16 * 1024)) return -EMSGSIZE; - /* FALLTHROUGH */ + fallthrough; /* case PIPE_BULK: */ default: if (!qh_urb_transaction (ehci, urb, &qtd_list, mem_flags)) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 73e13e7c2b46..1f5e69314a17 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -171,7 +171,7 @@ static int ohci_urb_enqueue ( /* 1 TD for setup, 1 for ACK, plus ... */ size = 2; - /* FALLTHROUGH */ + fallthrough; // case PIPE_INTERRUPT: // case PIPE_BULK: default: diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 44504c1751e0..f474f2f9c1e4 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c @@ -692,6 +692,7 @@ int ohci_hub_control( case C_HUB_OVER_CURRENT: ohci_writel (ohci, RH_HS_OCIC, &ohci->regs->roothub.status); + break; case C_HUB_LOCAL_POWER: break; default: diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 167dae117f73..eac43a7b7f23 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2418,6 +2418,7 @@ static int handle_tx_event(struct xhci_hcd *xhci, xhci_warn_ratelimited(xhci, "WARN Successful completion on short TX for slot %u ep %u: needs XHCI_TRUST_TX_LENGTH quirk?\n", slot_id, ep_index); + break; case COMP_SHORT_PACKET: break; /* Completion codes for endpoint stopped state */ @@ -2962,6 +2963,7 @@ static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring, return -EINVAL; case EP_STATE_HALTED: xhci_dbg(xhci, "WARN halted endpoint, queueing URB anyway.\n"); + break; case EP_STATE_STOPPED: case EP_STATE_RUNNING: break;