Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4982233imm; Fri, 18 May 2018 14:13:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqYvYKyFYGke3w4B+TnGWI9crFlvbwuFzVJyTVaQvc3bMnQp2MWCYxFn5bo+m/SDF0JUeNt X-Received: by 2002:a17:902:4081:: with SMTP id c1-v6mr11099583pld.60.1526678020898; Fri, 18 May 2018 14:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526678020; cv=none; d=google.com; s=arc-20160816; b=e5A6D9QdPVdtJPf9yJ8eIZa+C9aUfnL4enElqwkZBms3C5pGFHwlfo1Zrjk86M0RFa ffW+mHWjW4fBaSiGa0deJrF3duM6XgGh19OeumiWUGsaK/7Q53MGeeBUGq/OMlhAfrKm 9hQ573tmt2fH2dOdhju+2AYpa9t3fhvNOptbh5UdQui0qgLZqOiL6QCZiZUfIW1wL3Hr a4pF1+KsB6nha21jETvm7fCJHxTY/Fgu9gxngHQWn7fwH8vpDNfc4MG0bjTKDln4QZ57 fQarhQrkRmu2QTCLvp3wOJxdwlrEIS7+rE2a1P/ZNF+kWhNRCgTOktsJd0BZHIF2mn80 CqcA== 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=tVkgGL4GKO4AQHiP88AuJC6wOMZ2WKsdAJ4o99k/lUY=; b=UsWQVvf3a66+PZSRNI0eoNJ+P14oPqZS3GFxrPwI1oN0bdpTX8OMXWbTYGw+jQ6DeA z/ruEN07wNVMZl+axMm6y2q35MvMc/tBidIlj9BFXG7K/awuqwHAehWGb1WkIA40+8fa JrCkt0KXKfd8MxZZhjcQEB9+a7679zPkeBz3awhldS3QgkxkgBwIMLKwY2eN0Q+vk9CN fQKmOrNqDLIXu7zgAe0XxAjLkM3+Fq1r5nwbzn2BHpfCVfz/Z8Two0lrvcCniX1Hvii/ Fb0/3A313viih8AploxOyqvH/O8oNo6PAUDxJhnseTZqjS8V5ajKfEyZwyNnEpOgZVwe J+vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=plqESfYD; 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 s10-v6si6553965pgs.189.2018.05.18.14.13.26; Fri, 18 May 2018 14:13:40 -0700 (PDT) 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=plqESfYD; 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 S1752210AbeERVMN (ORCPT + 99 others); Fri, 18 May 2018 17:12:13 -0400 Received: from mail-qt0-f170.google.com ([209.85.216.170]:39580 "EHLO mail-qt0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751429AbeERVML (ORCPT ); Fri, 18 May 2018 17:12:11 -0400 Received: by mail-qt0-f170.google.com with SMTP id f1-v6so12092688qtj.6; Fri, 18 May 2018 14:12:11 -0700 (PDT) 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=tVkgGL4GKO4AQHiP88AuJC6wOMZ2WKsdAJ4o99k/lUY=; b=plqESfYDRwSpyHUUlkiAZuD48uzhV/wpcbjMpwExDHq56BI5NM3vnLFhrljthUz4jY EUGtfj68J9scqpk7l1a3Os+5Q37VFuBLKUymk7a4RjHBvO5Ve/xGob+WJ5ncYSOLuuPm IvwHF4fQPqNXjtLMx2T3Z7xXpBHD1oxHS2898xQGspGDuF+2btYEBq7fZnRu152lOufm RwE+1TXsgNyaq6tHQw8pyjgtT4Rz3dhfLsZFqxI/DS1VHd5ZcW/p2880coVKT1fyF36y xKDfSb3nYoCI6pA43HeY6t0K+MuVdLaC/CSFUww7vmeC9MZBg7EGwkFr9fJwIE3Q8myj B2Ng== 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=tVkgGL4GKO4AQHiP88AuJC6wOMZ2WKsdAJ4o99k/lUY=; b=MmDlzGS7eYIqJkbWL8199mbsEMSA5g4Tp8KLfb5V/FNK95RgwyMgltgDzBI2MXQp2O b0EfR1mjfqPOnaagTF6dV5wk9e8x5iPT7YDwqL3uOeCQn3Ywso0ZQ9xJm/Wj8efHhqr9 eKteu7G/j/NipwE1MlBOatVpS1TV55zeVg2yq6g5utfJsuP9AwIJwDpfxfmefbbmSwEO C0RS4AIYDx03Dnn2OC+FVn9oL3dtHcYpKvG9tYDkBlsDs24q3iYWiuqV8e6gmunanFiU DBl3PyxtC7uFeQw7/VpaFG+sAR7m62Ei+m/oPnBwygK7rui74JIYVYe+RAxlLnsSBV4M ZUtA== X-Gm-Message-State: ALKqPwcmv7n2oF9Fhny3uV3glWwkuiQ8+abNPlJeiHy+xCMon3x4/q5I YHt6mnR9Ek9F0FoWqX5x862lcVRlZ+VOtFuqzbw= X-Received: by 2002:a0c:b2c2:: with SMTP id d2-v6mr10501322qvf.16.1526677930878; Fri, 18 May 2018 14:12:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.152.150 with HTTP; Fri, 18 May 2018 14:12:10 -0700 (PDT) In-Reply-To: References: <20180518175304.20414-1-labbott@redhat.com> From: Andy Shevchenko Date: Sat, 19 May 2018 00:12:10 +0300 Message-ID: Subject: Re: [PATCHv8] gpio: Remove VLA from gpiolib To: Geert Uytterhoeven Cc: Laura Abbott , Linus Walleij , Kees Cook , Lukas Wunner , Rasmus Villemoes , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , kernel-hardening@lists.openwall.com, Phil Reid 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 Sat, May 19, 2018 at 12:05 AM, Geert Uytterhoeven wrote: > On Fri, May 18, 2018 at 10:07 PM, Andy Shevchenko > wrote: >> On Fri, May 18, 2018 at 8:53 PM, Laura Abbott wrote: >>> + bits = mask + BITS_TO_LONGS(chip->ngpio); >>> + memset(mask, 0, BITS_TO_LONGS(chip->ngpio) * sizeof(*mask)); >> >> Wouldn't be better >> >> bitmap_zero(mask, chip->ngpio); >> >> ? > > chip->ngpio is never const, so bitmap_zero() would always fall back to > plain memset(). Yes. But it also much more readable and understandable here. -- With Best Regards, Andy Shevchenko