Received: by 10.223.185.116 with SMTP id b49csp1030808wrg; Fri, 23 Feb 2018 10:38:49 -0800 (PST) X-Google-Smtp-Source: AH8x226+WQY5z7Oe5zUMK5ZSaWVIgzoiHrxt2f/f28j2gad+vtOVrvQFJXn9YuBeL4sd7Giic41P X-Received: by 10.99.140.29 with SMTP id m29mr2196688pgd.320.1519411129044; Fri, 23 Feb 2018 10:38:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519411129; cv=none; d=google.com; s=arc-20160816; b=ZVYpz5eaZj1GVFb+efSBlQRcmeYstXcf17AGIA67OxKIMARqNjlGX9DuMCgI3XnKd5 Gn7+8O/oUphIX2hp9F9yxxwXjusHAvEyVWiZhy0Mc87/yzDdWckA5kk10CHIugmTywUM Rfbxuc0t8BVKYMEKOmMi2I0OdKoGbK+z2wBCytEbnsiRDVCWwZD96PyGKpMouvqkcyuW DdXbzDaS2BfHIqRd/ACtXZo1odxaN1iRHKcaiFKqT64kYeRdnCsIcAKsrtUI0m3HQWF8 YI63EUQX52f7RcRt1D2JUvMgRTgCwnGcSMtd5DW3HBpPbeDhj50Gd7SBco6487Ndxdvt 4czQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=HeZWXSOs9YJFkVNYsvecfHAefuczU7GvsO9VTeomRdM=; b=S3O4fQwA92MS+Y1wKuiWsiNk7LlxYOGWEQHqJI9FGfekHGyCh742kekTChfeO77LuA 1tVsmXW3BF8pJ1jFydZO4Za18zE268al/zQW+9js12Wdep3tQ5H0IeyTlmRee73wij3V eAXtLZvgzCv5HnQ1LxFHVPA7WxVvLy7aXmoLTs0eZafFu4aDfo9kd3K97cG3dFrLzH6U YYNCn9DaLdP7HJkkGKR1yYNotbaDtkfwcRNG8fy9zBRxhUh+tlvJQi8wZqynD+6WQ6uZ yAPAebgwTj3+K3QF02Em/WHdOK9v4J0ElEmW5eK88gp6uhYLyUSIVqtgPSG1FZG7F9wP +GQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y40-v6si2121501pla.769.2018.02.23.10.38.31; Fri, 23 Feb 2018 10:38:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754219AbeBWShX (ORCPT + 99 others); Fri, 23 Feb 2018 13:37:23 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38660 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754194AbeBWShT (ORCPT ); Fri, 23 Feb 2018 13:37:19 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 05419BBF; Fri, 23 Feb 2018 18:37:18 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Felipe Balbi Subject: [PATCH 4.4 100/193] usb: musb/ux500: remove duplicate check for dma_is_compatible Date: Fri, 23 Feb 2018 19:25:33 +0100 Message-Id: <20180223170341.680390410@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 62a6abdd427b5fc4d8aad5dac874904e96273e6d upstream. When dma_addr_t is 64-bit, we get a warning about an invalid cast in the call to ux500_dma_is_compatible() from ux500_dma_channel_program(): drivers/usb/musb/ux500_dma.c: In function 'ux500_dma_channel_program': drivers/usb/musb/ux500_dma.c:210:51: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] if (!ux500_dma_is_compatible(channel, packet_sz, (void *)dma_addr, len)) The problem is that ux500_dma_is_compatible() is called from the main musb driver on the virtual address, but here we pass in a DMA address, so the types are fundamentally different but it works because the function only checks the alignment of the buffer and that is the same. We could work around this by adding another cast, but I have checked that the buffer we get passed here is already checked before it gets mapped, so the second check seems completely unnecessary and removing it must be the cleanest solution. Signed-off-by: Arnd Bergmann Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/ux500_dma.c | 3 --- 1 file changed, 3 deletions(-) --- a/drivers/usb/musb/ux500_dma.c +++ b/drivers/usb/musb/ux500_dma.c @@ -207,9 +207,6 @@ static int ux500_dma_channel_program(str BUG_ON(channel->status == MUSB_DMA_STATUS_UNKNOWN || channel->status == MUSB_DMA_STATUS_BUSY); - if (!ux500_dma_is_compatible(channel, packet_sz, (void *)dma_addr, len)) - return false; - channel->status = MUSB_DMA_STATUS_BUSY; channel->actual_len = 0; ret = ux500_configure_channel(channel, packet_sz, mode, dma_addr, len);