Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4211390pxf; Tue, 30 Mar 2021 02:02:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3vwdCvF28j0py5lZPF8eU6jPYgjLgrUD2kFMMrqwjkYFq4xnna5rjI0ig6lY7dnJDI/ES X-Received: by 2002:a17:906:f247:: with SMTP id gy7mr32996928ejb.183.1617094936092; Tue, 30 Mar 2021 02:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617094936; cv=none; d=google.com; s=arc-20160816; b=kzmsWcABARxDliTbWvAiPFTa1Y3HHW9dVvNcmBYF+fbI/JJy0GqddQ6kBAKxeHZBum lbanxA8lRtOQ1XTSZyVglKBix12utCxx6uMNdzLOn9kLwGYLitaJAiDXaMTau670v37q mL8BFitzMzAyv7yZXSQxWR64H6sku/w/MCiir6me+UXnLCCUJWhSsOScvdJVbu0qSOCI 58g41zvlnEfUd/KgXwiOTKPM5AtfxlDF+GAXnhdkqKerESNJ8Cq8WHGCGd2FhN/hXcuF EULfjAmkwb9VEidzwcjuwc0+vd/OS0mCZz8Zo7Au9T3FwtZQe2O+792Bcct8HDcnXBII 1R1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=c4to6SbgVAXhoSHDJH3I5lj0KdreVwAkPSAMgDGWTCg=; b=i8MYKZYbczI83cs5t/x7aicc1oinDSlZGvB9PHNdINEzcFBP2K3xJo0aB9RN7SbnGx w6LOS7m1OsoFJN0Jgpbg66JkN7x/Eu0wdbyj+50EcgPbiKiY2DeyQZtQMLk8HBLFRb56 5lyble/a3GWbBz+POYb/wSXGjM1KwMuISib8FQ2ZBF1AIPoRzaj1eAUx4V4DH/XDXvyR FVVtR71WvNHBDsUDQ1lV9LXcpIHQbWOSKyn8XDdH3j2hwT3eAkGapEtcbdJBg6Rwbw0C h/ZEgu5zGlI7OC61HTobYPU8+PAKopkHaqtkfbn01AUU2F/blNnqgY+mMNprY4HwfBkk z/xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wsuslf1a; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t18si14256310ejj.437.2021.03.30.02.01.53; Tue, 30 Mar 2021 02:02:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Wsuslf1a; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231607AbhC3JBQ (ORCPT + 99 others); Tue, 30 Mar 2021 05:01:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:48496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231626AbhC3JAw (ORCPT ); Tue, 30 Mar 2021 05:00:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 69DB5619AD; Tue, 30 Mar 2021 09:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617094851; bh=7BKJpJRJJea7jWMl80W5EN9UAj8omc2Cs2r3GAQepzo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Wsuslf1aShoCKyVO6hEvzEdZFMLQDIu2sbrH3x69Zj3fzv+Ssz4//dpuMEbWngOUq Zjq5v+sm416E8eDL5lOizTzEa7Erwc/f8fCuW75qsYfDXgJ3oE6b4i2kQYeYtPZd4I FK+fITjA3iXC63XWANkkhj4NvYlqDfeUjJbbuVDoJnM3Z/9egQRLEp8Koxo3BlExlm KJf0GkZPfII5XV5fPTrpbDnwtlOxinHOG65Ikgkmm49iP6nf4qHit/q0d/LnVY5qb5 qa+2M5n3XKCJv1Wm+mrJgHL5nAHA2YFzyo0MHv0A+yCW12hqtwqifDnY1PrNFQltR4 2Y+g7lZslykhg== Received: by mail-oo1-f53.google.com with SMTP id j10-20020a4ad18a0000b02901b677a0ba98so3616658oor.1; Tue, 30 Mar 2021 02:00:51 -0700 (PDT) X-Gm-Message-State: AOAM531q1tUjYttWC1Plkfc9XuItgOGcA+fFv0WHfXrMBQvc7MswRNus E9i6o0x2QMgnTmzWwbDN6fRjkSuusGeFcFzGuws= X-Received: by 2002:a4a:304a:: with SMTP id z10mr25148861ooz.26.1617094850520; Tue, 30 Mar 2021 02:00:50 -0700 (PDT) MIME-Version: 1.0 References: <20210322160253.4032422-1-arnd@kernel.org> <20210322160253.4032422-7-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 30 Mar 2021 11:00:36 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 06/11] cgroup: fix -Wzero-length-bounds warnings To: =?UTF-8?Q?Michal_Koutn=C3=BD?= Cc: Linux Kernel Mailing List , Martin Sebor , Tejun Heo , Zefan Li , Johannes Weiner , "the arch/x86 maintainers" , Ning Sun , Jani Nikula , Kalle Valo , Simon Kelley , James Smart , "James E.J. Bottomley" , Anders Larsen , Serge Hallyn , Imre Deak , Linux ARM , tboot-devel@lists.sourceforge.net, Intel Graphics , dri-devel , ath11k@lists.infradead.org, linux-wireless , Networking , linux-scsi , Cgroups , LSM List , Roman Gushchin , Christian Brauner , Alexei Starovoitov , Andrii Nakryiko , Odin Ugedal , Cong Wang , Bhaskar Chowdhury Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Mar 30, 2021 at 10:41 AM Michal Koutn=C3=BD wrot= e: > > On Mon, Mar 22, 2021 at 05:02:44PM +0100, Arnd Bergmann = wrote: > > I'm not sure what is expected to happen for such a configuration, > > presumably these functions are never calls in that case. > Yes, the functions you patched would only be called from subsystems or > there should be no way to obtain a struct cgroup_subsys reference > anyway (hence it's ok to always branch as if ss=3D=3DNULL). > > I'd prefer a variant that wouldn't compile the affected codepaths when > there are no subsystems registered, however, I couldn't come up with a > way how to do it without some preprocessor ugliness. Would it be possible to enclose most or all of kernel/cgroup/cgroup.c in an #ifdef CGROUP_SUBSYS_COUNT block? I didn't try that myself, but this might be a way to guarantee that there cannot be any callers (it would cause a link error). > Reviewed-by: Michal Koutn=C3=BD Thanks Arnd