Received: by 10.223.185.116 with SMTP id b49csp5403850wrg; Tue, 27 Feb 2018 12:44:13 -0800 (PST) X-Google-Smtp-Source: AH8x227u1N+my2NQLr+LrqDvnT5a2an/OvgH4AbFpl04DFrII9/QjDldmqmt5CG4nTiezwEfPjtq X-Received: by 10.99.3.8 with SMTP id 8mr12203646pgd.5.1519764253387; Tue, 27 Feb 2018 12:44:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519764253; cv=none; d=google.com; s=arc-20160816; b=Zf5Nb30F3X6bJ/JFb7AuuJtt6/XaDCooUd1e0aJUY1zsqlAbwhQMtCNolsicCKURMT unJ97ixuvVyiedYOK2GlJ18nnQNxVLXSQsvvDM49RvjSNMpiTGKzapY1GrnmLyUwdX6a nuemUDBujz6X9XFddUsewU5+ajSV+jEkof3cVbWyjOaiUIV6fGZpHNCqLO5K6RG+0tl6 dDxIhdV12icnjjjj5OcjDld6U0BentVDnD4R0z5SzXPtdYMQg4CD6Mul62qrqwBodwAa D0Qt2v5wi4jgCoYqZlaE5Wm2kiFL2Q3p07FJtpsp5SGFgKet76i9yv+bhP252st5Q+aI xJFg== 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=nrV7rt8w4hCFS9Oxp4Pdl6eUX2YL6k33mFmPqVo9PU8=; b=u1Ihx/swX57/MW8MvJZbW97wx8lv9kRsTV1J2PzTbvkujqRs5te5ZvhyeJOe7WSVwP zlAgVQ3EHFst6stML0f2Jj9PnCl2t3ljMtzdcEJuTZnGKiSgz1cH9O/vADjYfyyg9Yh2 FWiFO1UZSmzVR1h5iqe1/yqmLBu++fytNvRExrpTEOdQN26bsNenr/tzk59ESrNOJQFg 1s6RveNqLPMcZsSxiwTdk/fhSHMUJlFE1hNS5Wgzj0ANjYKx7un9b/oR3TLlbVRh0SkV PVQFa4uBw7ZQUmp0Q3Xq5KySy7UmVu5aRIE4UBg+Fwd327SEl7b1orN8ISDN39+znU2P ao9Q== 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 h67si12787pgc.324.2018.02.27.12.43.57; Tue, 27 Feb 2018 12:44:13 -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 S1751848AbeB0UnQ (ORCPT + 99 others); Tue, 27 Feb 2018 15:43:16 -0500 Received: from gate.crashing.org ([63.228.1.57]:59974 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751777AbeB0UnO (ORCPT ); Tue, 27 Feb 2018 15:43:14 -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 w1RKgiE6016386; Tue, 27 Feb 2018 14:42:44 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id w1RKghDp016381; Tue, 27 Feb 2018 14:42:43 -0600 Date: Tue, 27 Feb 2018 14:42:43 -0600 From: Segher Boessenkool To: Andy Shevchenko Cc: Mathieu Malaterre , "open list:LINUX FOR POWERPC PA SEMI PWRFICIENT" , Paul Mackerras , Linux Kernel Mailing List , Jiri Slaby Subject: Re: [PATCH 01/21] powerpc: Remove warning on array size when empty Message-ID: <20180227204243.GW21977@gate.crashing.org> References: <20180225172236.29650-1-malat@debian.org> <20180225172236.29650-2-malat@debian.org> <603d5335-6220-73f2-d902-b92bc74bc79e@c-s.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Tue, Feb 27, 2018 at 05:52:06PM +0200, Andy Shevchenko wrote: > On Tue, Feb 27, 2018 at 9:44 AM, Mathieu Malaterre wrote: > > On Tue, Feb 27, 2018 at 8:33 AM, Christophe LEROY > > wrote: > > >>>>> Much simpler is just add > >>>>> > >>>>> if (ARRAY_SIZE() == 0) > >>>>> return; > > >> Or add in front: > >> if (!ARRAY_SIZE(feature_properties)) > >> return; > > > > (not tested) I believe the compiler still go over the for() loop and > > will complain about the original unsigned comparison. > > Did you run tests? Did you look into object file? > > In kernel we much rely on the compiling away the code which is > deterministically not in use. > Here I'm pretty sure it will compile away entire function. It does, but it also still warns (this warning is done very early in the compiler pipeline). Segher