Received: by 10.223.185.116 with SMTP id b49csp5158912wrg; Tue, 27 Feb 2018 08:40:44 -0800 (PST) X-Google-Smtp-Source: AH8x226AmHrqdwHcFDJA9U7H6IE71jc4m1PAteory/2j3990wnxuyf//dCwtqPTXZsU0Zr92g4LB X-Received: by 10.99.151.26 with SMTP id n26mr11872460pge.370.1519749644270; Tue, 27 Feb 2018 08:40:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519749644; cv=none; d=google.com; s=arc-20160816; b=pUUX1n+1PW1sUTwxptXPvDBqRFgrh1ON3QVGJH8xkWfxh9UhLK3qO0N+FOs2oVZ8O8 WbiaLliDYjyP+6indZhdhLbeq2TVqrbmEVhM9ZN0Jd9wYuEqGzJ9m2oSK+lwrior2OQe SntGXp8yWfBJxphuU98leHTtpGcUxd+TW6N8/4sCh1dnj6ozJWnQEBhLPHHTv28SDqvp 4ylzfjmw7Or3LwYHwztsIIjDEX27L7o0T/kaIv+M3XxZaAvcWWY1OCu7PuROTcCAhWlI Ae8IZ1clOe5mOE4G2eHfKujew1EnpfwUfunX3YrEkbgbCFo+CPIKwYgkmWc5kvhHTmNI t1rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=tfZoj5oNCZ9N6izTepLZFP0I8SOYyXaPkPkf05o+4sI=; b=MTvid/xH3rKlYZGlUp/DZ0fC0/Y+4CTPHK7BoVeqRJ761N/2n1okiCPxzgGjQNXLma rQHxWWQXJLJD/tkgkAWomj6+8dUCoGoJak0jgxSBtUt/r5Of5pZWaaN/49h8PhWbTxjn TrYoA7Ittd/m3njBNywVCo7e7+sRPU1NpIyIMmZJgt9kisymRAd+3BRQvzwlmSEIrY2/ Rv+qaXwUTey/SS+HuFabHrqUyzr+G4Uo+oA+uOCeK5nk9ktHGcM+xxtEcBr1PNTS+SAp 7Xa2HUxZaB01TrM0a6mc70vP+WIofJohJDV9Wy7qRDpZnZrQ48MjNlszOPOj4So3WUgh 8lEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QsQBWAvM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5-v6si9133023plt.235.2018.02.27.08.40.29; Tue, 27 Feb 2018 08:40:44 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QsQBWAvM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754113AbeB0PwJ (ORCPT + 99 others); Tue, 27 Feb 2018 10:52:09 -0500 Received: from mail-qt0-f196.google.com ([209.85.216.196]:45402 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753304AbeB0PwH (ORCPT ); Tue, 27 Feb 2018 10:52:07 -0500 Received: by mail-qt0-f196.google.com with SMTP id v90so23708790qte.12 for ; Tue, 27 Feb 2018 07:52:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tfZoj5oNCZ9N6izTepLZFP0I8SOYyXaPkPkf05o+4sI=; b=QsQBWAvMuq3iLcijC4faa0HpYmV+CZ4o8Zga14COk4jwCl5SnHJ8dfHxQR5NHA0iKS tzh9d4GfqZu+EusoovqCoZhL4lWd329iDQW4cI12EWmarttfbjWMCjdKmO3d0ADL8mmi 7kW2hfu7AOoOy2hKE4La9DZ/z6o6qv1iWgYS20phpLV0GNOQrz4Mv6BzOOdm13FywZeK GX2clw+tbhJ2oZVmQAv7ck/fGz5Jn6LVltb4vSFcrGZaLPJLPa0NNoKsQ3V8oLCVAqZe zHI2ba5gmkvwG5WvOUW65/EaMqeWFt/DXgjClEBdoNBLkeT1HUNRnzGLT/ei87HH6g83 TfNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tfZoj5oNCZ9N6izTepLZFP0I8SOYyXaPkPkf05o+4sI=; b=HJoGaELO4WIIuO/50O4tQcepAR7iH5Sg2jqMAOkOcv6hNsZqyhHTb3QLt+JePi3n3H A4kSRIDUIsxicoYp1J2r0EQlSpJWv9k3XkkiuanP7pGJt88UWZV+lQJXqF9HSt0ONSTp RnN6efapW9ZDWLTfTNyqF0P826tuIa/fhdVcU3hV6nOqsatCnOWFwuH85b9zHP/UXjU+ C2m4i/ELJLSFfXHv6FK9wimCIZeWedjXbev2XTdhApzfy+3ySlwDnuAxZu831kNrTs/X bBetG9BiorjqUgv0R3qUS4DipFNb6OZ6skzVwQYEyt/204fj12uvRpTJybOKJ9/0HUsn 565Q== X-Gm-Message-State: APf1xPDhEXkWacUEFiuoOm9guTP0A9pHohBVMK420dHXtql6ZVnok+lm plDVU2CRWInstAwq/PokOaKF5D6D5CbJXwHbJ1w= X-Received: by 10.237.48.229 with SMTP id 92mr13115746qtf.39.1519746727228; Tue, 27 Feb 2018 07:52:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.195.80 with HTTP; Tue, 27 Feb 2018 07:52:06 -0800 (PST) In-Reply-To: References: <20180225172236.29650-1-malat@debian.org> <20180225172236.29650-2-malat@debian.org> <603d5335-6220-73f2-d902-b92bc74bc79e@c-s.fr> From: Andy Shevchenko Date: Tue, 27 Feb 2018 17:52:06 +0200 Message-ID: Subject: Re: [PATCH 01/21] powerpc: Remove warning on array size when empty To: Mathieu Malaterre Cc: Christophe LEROY , Linux Kernel Mailing List , Paul Mackerras , Jiri Slaby , "open list:LINUX FOR POWERPC PA SEMI PWRFICIENT" Content-Type: text/plain; charset="UTF-8" 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 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. -- With Best Regards, Andy Shevchenko