Received: by 10.213.65.68 with SMTP id h4csp914283imn; Sun, 18 Mar 2018 07:10:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELsZ4ABHlBPtmLdyMOKYGdUdcJULW5h0622KQrcOR75+JPeq20QGAxaMRhHjza0MN7UP3Jrq X-Received: by 10.99.114.77 with SMTP id c13mr6587220pgn.286.1521382241731; Sun, 18 Mar 2018 07:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521382241; cv=none; d=google.com; s=arc-20160816; b=pQqbVcU/Y1Vk+8fVLijS6cQGvymdLWLnEdu9rlJ8jMoEOCz/uG09IC2302KlzS4Tco Mr7og//0lR8Te+qQhZ8Pt3g7SnfY4oqxb5JojFlsLlX5wSh4vgeaToTyqHD5y1mi95qU vRz/XJNKsv61k1W4FRStZoxu39qoVrXBQ21ZfpZ5hEj6A9eiyTzJwIDoJ9upWjsFSmGr 3dVkmKxWS1otfU82O6MPQ9yPxenASzs4JHG0JLgGl65lfvD/bz2Nw6Befn5QWC3QQz1i R0bm71TsZPeIyeemvxweQ02/1PlbjzUrkxQL4EtNKSQB1ONgQlss64G3ZR7QhW4RQHml 6A1g== 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=UAcAt7U3r9IlOFi9ehLlv1CYiYxT59PoEfu+SP242MQ=; b=Lr1OX/aGewS5AkWSSfSZlGWHIMv9pkracOAXEySQN3mXxFris1AL5zs9enbik+yzVR tUPOIF1pkoBP/KjTb9f8iosu6LjZ08YRn2SD6fSL+jf3w6NckV9PsAcM0+SLpXcJeGW0 m/jQv4/ciPqRLjGzKfw69zkX/PN85IGs0Y7jjKaZlqiTrnc72tNy5RPasLtySAQGRaYX Qv4r2Y+ufyTfvqLrkdjaMXx2VwdnWernIXjgAvOAtzOk+2RUKknBK83jw1qpg3Q9R/vk 1AkMiRe0qAwCU43ColfA9MCvMjNVT8teQZl6EqZ6Gw+HPXiYNm0PJfI07EbNkGWoGiao inbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nf198fZl; 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 f64-v6si10597845plf.624.2018.03.18.07.10.16; Sun, 18 Mar 2018 07:10:41 -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=nf198fZl; 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 S1754182AbeCROIZ (ORCPT + 99 others); Sun, 18 Mar 2018 10:08:25 -0400 Received: from mail-ua0-f177.google.com ([209.85.217.177]:36595 "EHLO mail-ua0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754061AbeCROIW (ORCPT ); Sun, 18 Mar 2018 10:08:22 -0400 Received: by mail-ua0-f177.google.com with SMTP id v9so7189654uaj.3; Sun, 18 Mar 2018 07:08:22 -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=UAcAt7U3r9IlOFi9ehLlv1CYiYxT59PoEfu+SP242MQ=; b=nf198fZlNhMqqUerFQPARSNPjpeyy+C66NbcAS4ki1tUXdVL8hv/9jA+0gJLjgwBI2 UxQxxVoro9RGiDBipAALqEGxJTqiV06zMdP6IowfrYgG/cDPqhnnm7FrPJA4164tjDXR cZbmGteqDBgxLaQJgkds/50xi9Lqhh967sf5fiFmUVt31FX+X4xcMMe7ME2h5CPIEbGt 3vLMCyEGb3FvDUqZKk4SLAivOSHC+VTNwswFVz11Ph3HoYRM7UVXxINB4nLVtTeV1rTw 67gqfOvsbVpD3zNeN9IxlNCQiiEB9Hu9z1QHqFKhIJS1hj56AH0BOn9zVOc78MUxo+vZ QJcA== 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=UAcAt7U3r9IlOFi9ehLlv1CYiYxT59PoEfu+SP242MQ=; b=CuBOiRGzTfeSzN7ayw19aC/BBxrBCObpBu3PS+PRmDV688DJ0pzBmJxO5twAeCLUIt 5Ik9559NUT3i6fgbGurcZbb+tOrmngVH6Ae1Npmzcr3/8xPMMoevpN3XV1DzN3q7bR3I c4r9/dRuXIl2fDfInn/Fw6M9GLGVIzDYjLn0iTECZI2sOFsV+CbKI9hNCTF0rIrr9Xs8 /r9/tdL21sqFVtFVyDeN+miKdnpDSONOQC0fRY6izPw961DwTG0XfqHfi5A1LOiQsorj jMxTzJmttNT2Ni0LZp6MiuRdsRHTaWrcqRcDhdux/WBMlg9SxtND8rlcQ6t1OhxtdfKL G3MA== X-Gm-Message-State: AElRT7E1RihltARxd45W4Zli1qU3KVgKHaAjoOFHdffrxWuMYy6/vwYM vxJ85Xlb1RRV8KootlYhCk+OIyKqFaM8cYc/KoK91gH1 X-Received: by 10.176.68.35 with SMTP id m32mr1131852uam.95.1521382101540; Sun, 18 Mar 2018 07:08:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.170.7 with HTTP; Sun, 18 Mar 2018 07:08:01 -0700 (PDT) In-Reply-To: References: <1520970647-19587-1-git-send-email-s.mesoraca16@gmail.com> <87fu5321du.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me> <9843d23677af411aa75a5fb24df3c97b@AcuMS.aculab.com> From: Salvatore Mesoraca Date: Sun, 18 Mar 2018 15:08:01 +0100 Message-ID: Subject: Re: [PATCH] net: dsa: drop some VLAs in switch.c To: David Laight Cc: Vivien Didelot , "linux-kernel@vger.kernel.org" , Kernel Hardening , "netdev@vger.kernel.org" , "David S. Miller" , Andrew Lunn , Florian Fainelli , Kees Cook 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 2018-03-14 13:48 GMT+01:00 Salvatore Mesoraca : > 2018-03-14 12:24 GMT+01:00 David Laight : >> Isn't using DECLARE_BITMAP() completely OTT when the maximum size is less >> than the number of bits in a word? > > It allocates ceiling(size/8) "unsigned long"s, so yes. Actually I meant ceiling(size/8/sizeof(unsigned long)) I'm sorry for the typo. Salvatore