From patchwork Tue Nov 12 21:26:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1193869 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VK/JBk1X"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 47CLS12td8z9s7T for ; Wed, 13 Nov 2019 08:27:29 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 14ECFC21F1A; Tue, 12 Nov 2019 21:27:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 145A1C21F2A; Tue, 12 Nov 2019 21:27:06 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 924BDC21EE4; Tue, 12 Nov 2019 21:26:59 +0000 (UTC) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by lists.denx.de (Postfix) with ESMTPS id 3860AC21ECF for ; Tue, 12 Nov 2019 21:26:57 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id p4so20157664wrm.8 for ; Tue, 12 Nov 2019 13:26:57 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=IBM8z/Mz7ax4HnsRUrSvd1LWw283HuOLFD1WruVWokQ=; b=VK/JBk1XrBql/LBl9XytqzxjgeoaulRYnvKLfmW/Pdc15FlmyxFFtqxSk31SYltUzN Hq1ezgGUIWocqr2HMc7Y8a98wZkR7HTTskMGHKf1nmnqCJD84nuYY++NQmYsKTajFWWx WH95Yzve2Ym1QNOK9zdWf0cS+5LgXxkCVbqEvXrjmN8vw8R/8vFiyMwiAcktCguqKgSV WS87dXmDrW39tbjnH/YGb9A1xXhortjpWGX/GjuRpV83ltblnULsKlTBlIUZ3MwYR+69 lPb6SCkA9O4z3JRXaLun7RJGjwZRNHUJ8ceFBTCix0cEJospIjhmzfq7SJEtDC/wnnd5 +woA== 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:mime-version:content-transfer-encoding; bh=IBM8z/Mz7ax4HnsRUrSvd1LWw283HuOLFD1WruVWokQ=; b=R7JIOyop/enOaQnuZ5rogfe78KJkcNn3wiYdHaYTXJ0IgWvuEmn1Txx13MoIE+Zx0N HAfeyd6lV38dqPoud1yJhw6HVr4EJDmE/pP5uB9gwNjrozgAf5R4LLI43IPtcOX5+kjo OZ3CZp61kh3ifjQBAimtZZ/X1b8VjIESHFYMTgu1TcDG4ZmcN+vTlaBPGmcGKzNK3BPK gKGEBiyOggnFyEbIKhCcIUQYQP2QEkDGkOuWfowL0f+eQNlPYZgjoKa5O85wkpX3Rw5y 9cGFEoayy3x7yupopRjOq5oFA6zQRZyQR+q5rgnDOXtUb/BPfhj0JXXzDA0WSnGhIz9w zzYw== X-Gm-Message-State: APjAAAXlkYByiNw03FvASUJCh1zXYkyd9OYWv3ETx87xObTG8U33KJ0Q esA09ldWTISvL3nJpQBOsFc= X-Google-Smtp-Source: APXvYqyEsfrI1caq2vHnjl8b6Dru9h2Oe/LzFylA3Y/hxscY1ne+ZvNjq0H8B16JiGBtHhQXQa871g== X-Received: by 2002:a05:6000:10c5:: with SMTP id b5mr11164543wrx.121.1573594016831; Tue, 12 Nov 2019 13:26:56 -0800 (PST) Received: from ubuntu.home ([2a02:8071:6a3:700:695e:d262:a293:b57]) by smtp.gmail.com with ESMTPSA id 205sm6588676wmb.3.2019.11.12.13.26.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 13:26:56 -0800 (PST) From: Simon Goldschmidt To: Marek Vasut Date: Tue, 12 Nov 2019 22:26:43 +0100 Message-Id: <20191112212643.915-2-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112212643.915-1-simon.k.r.goldschmidt@gmail.com> References: <20191112212643.915-1-simon.k.r.goldschmidt@gmail.com> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 2/2] usb: dwc2: fix possible alignment issues X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Since upgrading to gcc9, warnings are issued: "taking address of packed member of ‘...’ may result in an unaligned pointer value" Fix this by converting dwc2_fifo_read to use unaligned access since packed structures may be on an unaligned address, depending on USB hardware. Signed-off-by: Simon Goldschmidt --- drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c index 7eb632d3b1..dba221dad0 100644 --- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c @@ -731,7 +731,7 @@ static int write_fifo_ep0(struct dwc2_ep *ep, struct dwc2_request *req) return 0; } -static int dwc2_fifo_read(struct dwc2_ep *ep, u32 *cp, int max) +static int dwc2_fifo_read(struct dwc2_ep *ep, void *cp, int max) { invalidate_dcache_range((unsigned long)cp, (unsigned long)cp + ROUND(max, CONFIG_SYS_CACHELINE_SIZE)); @@ -1285,7 +1285,7 @@ static void dwc2_ep0_setup(struct dwc2_udc *dev) nuke(ep, -EPROTO); /* read control req from fifo (8 bytes) */ - dwc2_fifo_read(ep, (u32 *)usb_ctrl, 8); + dwc2_fifo_read(ep, usb_ctrl, 8); debug_cond(DEBUG_SETUP != 0, "%s: bRequestType = 0x%x(%s), bRequest = 0x%x"