Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp332825pxk; Sun, 30 Aug 2020 05:13:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCqoaNpMdJXlEW1FmKjCqQ9H4qv+vJ7+v2gckCVdIrVVTeWS4gYlMxUMJ+iBHaUNZYT2s/ X-Received: by 2002:a50:ab59:: with SMTP id t25mr3762066edc.364.1598789625955; Sun, 30 Aug 2020 05:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598789625; cv=none; d=google.com; s=arc-20160816; b=zVIlwemz1WFc2TsCnBUS0kDYLiR0DyPer3V0UytHkOrcRbGToJhFQxB1jWQINPZZy9 Cp0pmb+2DVWck+mZKkrpETO6JHxZE3JYZd6Sh3MZ7EqpJR0ToBN8Iz0ayczjYm4mUZqb +/a8Hr8JzTWIVYeM27NybDfhK9KzXyxthTTe5h2FTrx3VRWAjI5wV08cU3EFhaOxEFUf qa0nL3USu5muzZfPwOOtBjaLtZ8dY6XT0B9LAwx0/cWUthQcFi62CNSJBV2JLs4VNG6K /L1b5YPZrgZPZOU4eqrqPl+uyhqGEAbadMsmGxVYIUs22zJBznWx0m5Z+TB7lMveBieh v3TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qshWuo/PMDUT2LJmbVBMnw6b8Zf9zlNuTmEls1ekJ0U=; b=DYOp+Ry6KXm2F5OaH0WEZXwLS3pibaVjCmGegtkEwKGPjrBLw7FwG4ueGCGzRpjsID OisI0bcXaMbyAIPQzQK3ZiHWcKRJBWKDfiviy3+GTHwLk9vhMatUQxKwNc0EAnvdDZ7M J/CUlepTaGz6Piz9U+diY0VPVrxL77rOj+S02q1CfnjlcBXfhm1VFaG5Qt42VGsZOh9p ZUqfnvVOhoYVDrokEVlkEp++7J7VqIn5lyAiwBsVcGszhOA5W59dGuliSfIDzUtXcGnW PGMtUAU8LtIe7zAcNmbKCN4p0eilrc5oJQBm2Z86lk0i0zm2qexrof7CUvsH6MhRH0j2 QV+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UsFqJfCX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si3257217edn.575.2020.08.30.05.13.11; Sun, 30 Aug 2020 05:13:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UsFqJfCX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728686AbgH3MMD (ORCPT + 99 others); Sun, 30 Aug 2020 08:12:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgH3MMB (ORCPT ); Sun, 30 Aug 2020 08:12:01 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77905C061573; Sun, 30 Aug 2020 05:12:00 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id q13so1413346ejo.9; Sun, 30 Aug 2020 05:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qshWuo/PMDUT2LJmbVBMnw6b8Zf9zlNuTmEls1ekJ0U=; b=UsFqJfCX0P9KcqTkG3XSmY1iuH1x9+PnaSu9U6Nvjs7U+EWRLwOvUb5HJ9uHPkx2uc mN5Pt5hsv1IXTgEzHKqU7hXwsatu87CTl/FxsIfWfmRxjxe4KatgxXytg4OC/G36GbUu GGSMDgk8/+OHRuAatveS9SjHVLWS1LAa7xwUo0MQN5t6Hc7rmAxtewtb8DkAawb8ek+x 2T/AvMyCvQ+NF79DFOBVCEkx+JEjTE7DXPZAGR8JS8zHjnUWptodtPW8I9TJIUg050io vpbUKkHBs6vTuRA7AxST1ivHK0GscrNxLNNBozlZ+LtOTn1ghlLYLqKerzDBHadHxFyY T4iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qshWuo/PMDUT2LJmbVBMnw6b8Zf9zlNuTmEls1ekJ0U=; b=HaUH4rIDvJe0UBa9manaOgF+eW9KY/FQZJkGK/Y8WmnBmvs8YmQ99abplwm3jgtCP3 jbcDAxBZEU8RhuAYaIfqJQkWMCILf7WwwAAV+E+p2ni4h8HRuHFZLeCPCYnPyoFu4/u8 tEv0B3MxyO3yF41aqAGgbTK6P/V+G9vk5S9qKIWfbKcEo5kthQhyMGBng14Iy2IsKMfo Ms+n81mPuTe6W5vLpbEPEc/HTDQUoVlKw9gjj9tLGMFIiJASx+IYlJHWgLTHBp5iSfv0 Glk33H5IJYjfGysV9RXXsjwvJ8rzQNM5tvXkqjWLyLBioZSg9qupBIJIBCteK7TgLxPn nk7g== X-Gm-Message-State: AOAM532KTmxvbk1xebYv7ZVGSVUsDLX7hux5R/G/xuCCbke0o2q7I7Bd BUqN9M5SJKqeRFcp3O25Xf1IncgR5bo= X-Received: by 2002:a17:906:d182:: with SMTP id c2mr7289675ejz.378.1598789517357; Sun, 30 Aug 2020 05:11:57 -0700 (PDT) Received: from ltop.local ([2a02:a03f:a7fb:e200:64d5:3b87:7078:3025]) by smtp.gmail.com with ESMTPSA id bn14sm5115767ejb.115.2020.08.30.05.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Aug 2020 05:11:56 -0700 (PDT) Date: Sun, 30 Aug 2020 14:11:54 +0200 From: Luc Van Oostenryck To: Linus Torvalds Cc: Herbert Xu , Guenter Roeck , linuxppc-dev , dma , Linux Kernel Mailing List Subject: Re: [PATCH] fsldma: fsl_ioread64*() do not need lower_32_bits() Message-ID: <20200830121154.zo54k5ywpdk2rw4m@ltop.local> References: <20200829105116.GA246533@roeck-us.net> <20200829124538.7475-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 29, 2020 at 10:29:55AM -0700, Linus Torvalds wrote: > On Sat, Aug 29, 2020 at 5:46 AM Luc Van Oostenryck > wrote: > > > > But the pointer is already 32-bit, so simply cast the pointer to u32. > > Yeah, that code was completely pointless. If the pointer had actually > been 64-bit, the old code would have warned too. > > The odd thing is that the fsl_iowrite64() functions make sense. It's > only the fsl_ioread64() functions that seem to be written by somebody > who is really confused. > > That said, this patch only humors the confusion. The cast to 'u32' is > completely pointless. In fact, it seems to be actively wrong, because > it means that the later "fsl_addr + 1" is done entirely incorrectly - > it now literally adds "1" to an integer value, while the iowrite() > functions will add one to a "u32 __iomem *" pointer (so will do > pointer arithmetic, and add 4). > My bad. I had noticed the '+ 1' and so automatically assumed 'OK, pointer arithmetic now' without noticing that the cast was done only after the addition. Grrr. FWIW, the version you committed looks much better to me. -- Luc