From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750995AbbKFFOe (ORCPT ); Fri, 6 Nov 2015 00:14:34 -0500 Received: from shards.monkeyblade.net ([149.20.54.216]:42911 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750734AbbKFFOd (ORCPT ); Fri, 6 Nov 2015 00:14:33 -0500 Date: Fri, 06 Nov 2015 00:14:29 -0500 (EST) Message-Id: <20151106.001429.2110589196408149028.davem@davemloft.net> To: torvalds@linux-foundation.org Cc: akpm@linux-foundation.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [GIT] Sparc From: David Miller In-Reply-To: References: <20151105.163959.1438115257720770769.davem@davemloft.net> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 05 Nov 2015 21:14:32 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Torvalds Date: Thu, 5 Nov 2015 16:43:52 -0800 > On Thu, Nov 5, 2015 at 1:39 PM, David Miller wrote: >> >> 5) Fix iommu-common code so it doesn't emit rediculous warnings >> on some architectures, particularly ARM. > > Heh. So looking at that patch, I can't but help to react that this: > > #define IOMMU_ERROR_CODE (~(unsigned long) 0) > > is still pretty ridiculous. Maybe just (-1ul), or for those people > who don't understand C unsigned long arithmetic and think that a > negative unsigned long looks odd, (~0ul)? Yeah I struggled with this, believe it or not. The expression causing the problem was (~(dma_addr_t) 0) (AKA DMA_ERROR_CODE) being used as the return value. So I just replicated that expression. A neuron did fire saying "hey pinhead, why not just use ~0UL" but I did not listen to the little voice in my head this time. From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Date: Fri, 06 Nov 2015 05:14:29 +0000 Subject: Re: [GIT] Sparc Message-Id: <20151106.001429.2110589196408149028.davem@davemloft.net> List-Id: References: <20151105.163959.1438115257720770769.davem@davemloft.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: torvalds@linux-foundation.org Cc: akpm@linux-foundation.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org From: Linus Torvalds Date: Thu, 5 Nov 2015 16:43:52 -0800 > On Thu, Nov 5, 2015 at 1:39 PM, David Miller wrote: >> >> 5) Fix iommu-common code so it doesn't emit rediculous warnings >> on some architectures, particularly ARM. > > Heh. So looking at that patch, I can't but help to react that this: > > #define IOMMU_ERROR_CODE (~(unsigned long) 0) > > is still pretty ridiculous. Maybe just (-1ul), or for those people > who don't understand C unsigned long arithmetic and think that a > negative unsigned long looks odd, (~0ul)? Yeah I struggled with this, believe it or not. The expression causing the problem was (~(dma_addr_t) 0) (AKA DMA_ERROR_CODE) being used as the return value. So I just replicated that expression. A neuron did fire saying "hey pinhead, why not just use ~0UL" but I did not listen to the little voice in my head this time.