From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.200 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796079239; b=htWE/EyvqYK1ZP799XcsdC47ISC8YKUlkvN1zv/6ZnJ14RQmOxMYaIwnwp/r7quY9xZk ZrSttnIDQ2sh9f7IAXXiZZxqD/ZvED2pmO0GI/k2F/h31HFyR/MTY6oLQm+s0hU0AklS0 e/xJIfP+abtgX7blKToytniqsNlKxxNrgEvCUJVUfBPZsUNrwS0r5XCA1lqzBFoha9PpH De9HQg02Ce7ErvdEIsLfM6moiAhHBaH8K3Q+QMsiRy3nhr5AaPLT9splJ/KhVSVrqPtLD fI34Etv38JUElnZoeQe+tj+obq7omBAcY5xr0vunlsFM0HqScs06R/4eAiveazqnxlQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796079239; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=62Wfy+i8FJFpSMnVfrzLH+SU9wxJ0R0rHXMC8fiVnRQ=; b=upbS/0i/6uKAJveZfG1BEWI17LApDPu4NKp1/83LMcnvUvdWU9oZ/5Mz0/v6nTbI6ix2 M6sTvkuYKSchGArGFbkzFtb9wi1oKwRDNbJ5bHNg33lOoyagXzvUlSELRmKTJ90oXM1we 0bCkAP0u6bNNS/+8kZRgxzPNuUKtB5K5HYfHqoey1AeyTxxHz+Ztcm8L867ps8oOM+xEr vBS0ykuVM4/ber6h0PBvjTpXhePQq6VywssiwMK/wZXUjBbqqWNa+tnGKtSd5dIMiJJ3m HvPGAn2JjgyLrv4U6vofGBzOhfZzOPfl45bj8K9fMH/LmqBLymLwN6VbFKcU/VBVLIA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=CxpmGjKN; arc=none smtp.remote-ip=74.125.82.200 Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01318606A33E for ; Mon, 30 Nov 2026 22:53:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 01318606A33E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=CxpmGjKN Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-386177b0516so2523649eec.1 for ; Mon, 30 Nov 2026 14:53:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796079238; x=1796684038; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=62Wfy+i8FJFpSMnVfrzLH+SU9wxJ0R0rHXMC8fiVnRQ=; b=CxpmGjKNSljbP2ABtbfxWQJyUVypzJnay6qIrdZiXFpu2O6redbRcb12yCuSpyF8TY Aq5UQB3+vMXxZUIoZGl7WMW3TYcl8kQUcaUKh0VmS5VKlismz3PFNdr2GJ97Ho7D1O76 w0Q1AggEhhNOI0LaYa2v59F/2rFd4itzkYXwROTCCt26jjDBvLFCspNtlLfdYjPk7LoE 1oR5U/Do9rJHsoteHZe8gZC5n6U9jDCo0zWjyY707HM9XPq0RUZIQxJ3EZxRRdlmkwFo NoIbFzUK/IoMFsO5RRBOLjvGrRyhLFjU48jMQwH6hueqz0V92KZA1yxyZiUydJbxVw8A d9hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796079238; x=1796684038; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=62Wfy+i8FJFpSMnVfrzLH+SU9wxJ0R0rHXMC8fiVnRQ=; b=V7LmtriAu+9FHkUjmmxtpulsGPqKB0EIbvUWOBgSSrsw2Sxcy0LpdXi7471Hj4Httn ztCe+P3Zy0Md/W0YqjybHHL2ncWpFPhN32NurGhlZ4zfqRjgenWcJKEpF9Nam0m6vyRp bj/Lx/XjBc/pwDsm4+Ac/mPT6pLR0pmvqxzixLujpBsWbepAQ7so2NySVtLMvBN059BC cihGG3nZSS1wZVjQEVF1EP0xtSwP02UAXI6iOfvKv3t1KTR9So6LwfcT4al9sau/IIY6 rYAAs7GYeb7nxa3J5hGRoIiqzFuWUZm9Z6QehXPsIb9/iftxd9saPghZ0RYjlEKndtMt dLBQ== X-Forwarded-Encrypted: i=1; AL+hErF78dS12P71syEU9GM6lWvV8+EKWzIOP9if6G0+ws6xVmJ5izTU73H/m2F1pd5CR/Xp7sLI94AQiydN7Mc=@vger.kernel.org X-Gm-Message-State: APuU4Z/bMCgxDnNJp7xL4bOdFnpDTzXNF7iexLFJiCXn39VH/C91j7Ni /6phCjCuoecVap0IZcUP7wz/+VzsjyRA73jmaTY0Is8BJBkC4Rq528wv7Ayg1rzPI9Rc/AGY2lU mgn3UdzzGvw== X-Received: from dyaw26-n1.prod.google.com ([2002:a05:693c:415a:10b0:359:a8c8:38e2]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:cf84:b0:386:ebc5:3dfe with SMTP id 5a478bee46e88-386ebc53ea7mr12209233eec.22.1796079237788; Mon, 30 Nov 2026 14:53:57 -0800 (PST) Date: Mon, 30 Nov 2026 14:53:40 -0800 In-Reply-To: <20261130225340.96859-1-irogers@google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261130225340.96859-1-irogers@google.com> X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261130225340.96859-4-irogers@google.com> Subject: [PATCH 3/3] firmware_loader: Annotate mandatory fw_upload_ops with __must_init From: Ian Rogers To: Greg Kroah-Hartman , "Rafael J . Wysocki" , Danilo Krummrich , Johan Hovold , Luis Chamberlain Cc: Dave Ertman , Ira Weiny , Leon Romanovsky , Kees Cook , Miguel Ojeda , Nathan Chancellor , driver-core@lists.linux.dev, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Ian Rogers Content-Type: text/plain; charset="UTF-8" firmware_upload_register() requires prepare, write, poll_complete, and cancel in struct fw_upload_ops and returns ERR_PTR(-EINVAL) if any are omitted. Annotate these mandatory callbacks with __must_init so missing callbacks are caught at compile time. Signed-off-by: Ian Rogers --- include/linux/firmware.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 0fa3b027f02f..65126ca6c8d9 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h @@ -69,12 +69,13 @@ struct fw_upload { */ struct fw_upload_ops { enum fw_upload_err (*prepare)(struct fw_upload *fw_upload, - const u8 *data, u32 size); + const u8 *data, u32 size) __must_init; enum fw_upload_err (*write)(struct fw_upload *fw_upload, const u8 *data, u32 offset, - u32 size, u32 *written); - enum fw_upload_err (*poll_complete)(struct fw_upload *fw_upload); - void (*cancel)(struct fw_upload *fw_upload); + u32 size, u32 *written) __must_init; + enum fw_upload_err (*poll_complete)(struct fw_upload *fw_upload) + __must_init; + void (*cancel)(struct fw_upload *fw_upload) __must_init; void (*cleanup)(struct fw_upload *fw_upload); }; -- 2.56.1.839.g22a8290db9-goog