From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751103AbWIHN20 (ORCPT ); Fri, 8 Sep 2006 09:28:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751104AbWIHN2Z (ORCPT ); Fri, 8 Sep 2006 09:28:25 -0400 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:41858 "EHLO ebiederm.dsl.xmission.com") by vger.kernel.org with ESMTP id S1751103AbWIHN2Z (ORCPT ); Fri, 8 Sep 2006 09:28:25 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Jan Engelhardt Cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] proc: Make the generation of the self symlink table driven. References: <20060907101512.3e3a9604.akpm@osdl.org> Date: Fri, 08 Sep 2006 07:27:22 -0600 In-Reply-To: (Jan Engelhardt's message of "Fri, 8 Sep 2006 15:08:48 +0200 (MEST)") Message-ID: User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Jan Engelhardt writes: >>>>> + for (; nr < (ARRAY_SIZE(proc_base_stuff) - 1); filp->f_pos++, nr++) { >>>> >>> Also works without the () around ARRAY_SIZE(..)-1 >> >>Sure. But I don't really trust C precedence (because it is wrong) > > Wrong? In mathematics, "a < (b - 1)" also is equivalent to "a < b - 1". In mathematics < is not an operation that yields a result in the domain of integers. So "(a < b) - 1" is impossible. Regardless this isn't a case where the C precedence is wrong. "a < b | 1" is an example of C getting the precedence wrong. Having to remember where C is wrong and in what circumstances is harder than just putting in parenthesis. Eric