Received: by 10.223.185.116 with SMTP id b49csp3005853wrg; Sun, 25 Feb 2018 11:23:27 -0800 (PST) X-Google-Smtp-Source: AH8x225kWGDi3p+mHgnIMimook7YLeeexKitqrvpS+02b47HetUy+1HBuGW80QAPtCqDVCXdZLkS X-Received: by 2002:a17:902:6c06:: with SMTP id q6-v6mr8393324plk.142.1519586607721; Sun, 25 Feb 2018 11:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519586607; cv=none; d=google.com; s=arc-20160816; b=keNcDPYP9R0IvZRHDeGzgYi+R+nY+jjbGu0axaJMVvqXknPQT9n1mYqiPdiTejQzEV FOv5DBEiI6g71BeZTkZqaOJtntQX+bCtMJaTHj6sFeCRAx4HOLqbJQLbJm/3LQI7sx1J fJ8fsQ5zcYFF1pWbXSn2T/9C4F5FWVJsEyx9qy3DzYZ217v0sO1gxb2SytaoxKpuKkjs MQOMYmetZZLQqdoIx95KunuiKcn96DB5CYq8VOXRBKMIAkFXTZhDJNeQIfQo9KX6ZjLc oEgX+3fN7Xrb951jEKycoEUYX3qq/W50SRKFwwCxyajy5Od/qOQRwzV6x5WLMFbr2+NK aQDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=u6JIjrMI26WCaSg7s7niFFpapMYVYrugsny8zTGjH5E=; b=hHgBfEXyl1uv8Rg4DGiPSxEvqxhCPoWzHLk9EBy0eTbVv2/15A0T5V9hub6XHEBGep yXlebN0nLsygK2pmzVeiPgowMpP1uofxo8eyxwcs76F0iYRDKbt74IBe13arT/GhGESx STA6j/66kdZaZQq2EVkVshs4TtZt3hJw/ZJ1kfbGQMFgI+r0B4mUh8j7DoC984H8dmUS tZ0m+CYahZugazoSZw+y0YR8wfQfLBNsZ0yP3Ii4qgFHvbqxsJlLcFR8XTySJBodR8nM /3zFvIpmSTo4KP+iWjp6Qd5q3llzqD2k0VB8/cPbq1C+1Ia/VEceCP5QjXUuuWpvEeFX 5WDA== 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 90-v6si5457988pld.541.2018.02.25.11.23.12; Sun, 25 Feb 2018 11:23:27 -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 S1751883AbeBYTN1 (ORCPT + 99 others); Sun, 25 Feb 2018 14:13:27 -0500 Received: from gate.crashing.org ([63.228.1.57]:47414 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751762AbeBYTN0 (ORCPT ); Sun, 25 Feb 2018 14:13:26 -0500 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w1PIrhXb020507; Sun, 25 Feb 2018 12:53:44 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id w1PIrdTO020503; Sun, 25 Feb 2018 12:53:39 -0600 Date: Sun, 25 Feb 2018 12:53:38 -0600 From: Segher Boessenkool To: Mathieu Malaterre Cc: Michael Ellerman , linux-kernel@vger.kernel.org, Paul Mackerras , Jiri Slaby , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 01/21] powerpc: Remove warning on array size when empty Message-ID: <20180225185337.GM21977@gate.crashing.org> References: <20180225172236.29650-1-malat@debian.org> <20180225172236.29650-2-malat@debian.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180225172236.29650-2-malat@debian.org> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Sun, Feb 25, 2018 at 06:22:16PM +0100, Mathieu Malaterre wrote: > When neither CONFIG_ALTIVEC, nor CONFIG_VSX or CONFIG_PPC64 is defined, the > array feature_properties is defined as an empty array, which in turn > triggers the following warning (treated as error on W=1): > - for (i = 0; i < ARRAY_SIZE(feature_properties); ++i, ++fp) { > + for (; fp != feature_properties + ARRAY_SIZE(feature_properties); ++fp) { You could just write != instead of < ? Seems more readable. Maybe something can be done to ARRAY_SIZE to make this not warn. Segher