Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp571666imm; Mon, 21 May 2018 10:31:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoIL0+6n613uRQRnqTulUfYMyuoMjYHNYqTUGyhy2AvAFIFay+WGkb7P1CSIkV+/XhMoKrA X-Received: by 2002:a63:ba17:: with SMTP id k23-v6mr8382695pgf.47.1526923900652; Mon, 21 May 2018 10:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526923900; cv=none; d=google.com; s=arc-20160816; b=njF8WX2wpeaFh/Svvl2KKEALoRmnTUYk1nDsZ2I+pCy83uwF+ZpdfYE+NKPstvPW3n jlxV7kzlZpSI1BFhwzwPjsUSx/VzjMDo1zEajaueu4mRYhXBw5SEHMse7CPER+PWx5ql jm32ajHqCDlyleXfozzi7pc8V+5JwV6ZEEyRKqYN0ShUY+xap9v3wPl4oavY9vh6QGO1 i+47eS/GiyAXHH0Ki33k9SGijka7eWjgW33thJ6RxFZeb4quShBzN3yMplYGP9OxgvV2 E55FaHtPUUE9t50Hu7sz54u7X7F1d6w1fWSampFrIRFexZyBVfMvk4H92YL0m72FkoEI DXkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=48p5JhSQkM9pwF8mLz7Y1798mdaraSuJ0N8JS3URxxk=; b=tT+xWL7e8Xqwv3OB0X9C04ws21Fqu5X2tcaw7M8Z3sBlgq261QYFpYqBIwDCwFO2gg OA/7/ITsJvJLo0oQxezj0T+HDCh9jX26ZqjJDP03Afr2Ev7FnrdZvdyat8NSHKqdYT7S IXIJD9U/uDmY9bXm2sHXO3I6A4otHQjZmSKB8TvD9Atog9cdLuUS8pXRvVc8y1cXyUcB i86Wi5vLCWDOQbdiVwCLuXajlz1iit+h/uNsWrFVwGpjdtLJrT7URZLTJl9K68zOTgpn pSyhDc7RWICF4sptQ4wHpcdHmb/MX1a4NhgdR2KAAgrhWZdLC7+KoH7lvRIMLffmoAFM LI/w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 128-v6si4146443pgj.289.2018.05.21.10.31.25; Mon, 21 May 2018 10:31: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753389AbeEURbQ (ORCPT + 99 others); Mon, 21 May 2018 13:31:16 -0400 Received: from mail-ot0-f180.google.com ([74.125.82.180]:35903 "EHLO mail-ot0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753261AbeEURa6 (ORCPT ); Mon, 21 May 2018 13:30:58 -0400 Received: by mail-ot0-f180.google.com with SMTP id m11-v6so17748847otf.3 for ; Mon, 21 May 2018 10:30:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=48p5JhSQkM9pwF8mLz7Y1798mdaraSuJ0N8JS3URxxk=; b=oc9UiJOj54Fz3iXqxylduCdkHeqXuyLYJo0svZJT0UfFBPOzKue7SbrKNHoZ6d0dS1 Kfrp4FLF0RPJli5alezfWzsa9G9y3V+I0786gW6i9BNRCPkLHfaObjJL7o9ufzqfQ042 Y2pMEZQu13OeEVVU6B/NC/+lsahT7CiESvSeDd/KAEG5a1gai9BYRE2lZe1mBp7jYoha 2Ooi+Ie2Avypd8H6stw1vaMbMNcYg3U2dUgAwK7s1C8AmiJ0y06LC4PtXnuFE2Hlti97 XZltGH0T1CK4EEYGQ5ZMo9bBnqYBMjg92eXwcUCwInweQhEQ/Zb3Dcsgcu77vsLp1mDY EyYw== X-Gm-Message-State: ALKqPwfzljd0gqIh0qAfdu5kfiE1dL+pjAzYfXN3vVvISdDFwAMZmCF6 I1gtX1NwuoDJ0yVKi3Zz9YaGQA== X-Received: by 2002:a9d:6245:: with SMTP id i5-v6mr12831951otk.239.1526923858199; Mon, 21 May 2018 10:30:58 -0700 (PDT) Received: from ?IPv6:2601:602:9802:a8dc::d2dd? ([2601:602:9802:a8dc::d2dd]) by smtp.gmail.com with ESMTPSA id n14-v6sm8059588otf.8.2018.05.21.10.30.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 10:30:57 -0700 (PDT) Subject: Re: [PATCHv8] gpio: Remove VLA from gpiolib To: Andy Shevchenko , Geert Uytterhoeven Cc: Linus Walleij , Kees Cook , Lukas Wunner , Rasmus Villemoes , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , kernel-hardening@lists.openwall.com, Phil Reid References: <20180518175304.20414-1-labbott@redhat.com> From: Laura Abbott Message-ID: Date: Mon, 21 May 2018 10:30:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/18/2018 02:12 PM, Andy Shevchenko wrote: > 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. > I wasn't aware of that API. I'll switch to that.