Received: by 10.213.65.68 with SMTP id h4csp3016072imn; Mon, 9 Apr 2018 12:46:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+FfsICF+5h2h7azWDmflnUuYLoZcBuKsYMPiqDYBOtMElE9aTHzQ3voktACQUL2AMOaTh4 X-Received: by 10.101.97.15 with SMTP id z15mr26066775pgu.393.1523303186556; Mon, 09 Apr 2018 12:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523303186; cv=none; d=google.com; s=arc-20160816; b=iC4A1gNxPpFp++txffUhHNQlE5f+o7qfeJjUldC7xOHNQeiG5M6D4ilvc5b9WzwZat w0y8VH6T4OFwwqMdN4kUUwnnx/AqC6ZHzLkvw1I27D62g8CR5T2XvZ3jubWwupP3c5Cx IhK5I17O4MdmBcPwpb8/X4LAGOl/qVExh06/AH5zVWA/VrWCYWeENKyovtFOnv6NXxkE g8+FWO49jX4EoEqtY+7Pq547qbmGH+7NlfybyAsBpIl1lSqOGLg/5jXEqEMFuMMpli0x C4T7zqZT9LkjpKpJ+X5SjdcEOeVbwNaAvgJENwCAh6mmCQid42hbIVv7xFcA2mckG4Gy swgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from :arc-authentication-results; bh=AHLBxORWEQH+WU8Eapxn1ni2Si4bbxg0EPNJYi8d6yw=; b=phg1NvSSZyB604aLJjRPNZP4oA9vd/x0uIDb4SHOmnByaiRse//Kf0uo6BASSZYy4+ KFDPFYUGBDtb3ZA3bZRbhDzw5t3e9/ttelnac0IssUzG2SHf+viXcOlwkUboBG5C9NBi FrqjBVZGDY9dbPmHWN7Soi+y4Ca7vvsPwm3yjgW9Y8DULZIiItJ7AzwBtT3Gh7cNslre qxsFRUONUuF3uR9a6b+8Y6+482FgB/rvcAFqRBRStYASQFqU0MZO4jF3QoC4xYsst4bb 0Q9mzdJHZH2Vv7YhZNZeYnmzrvp8s/DjLrdB/ucd7poktktqqSg3PyUQfq/cdEz2BEtn ECTw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f35-v6si881328plh.691.2018.04.09.12.45.49; Mon, 09 Apr 2018 12:46:26 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754256AbeDITjl (ORCPT + 99 others); Mon, 9 Apr 2018 15:39:41 -0400 Received: from anholt.net ([50.246.234.109]:53416 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753108AbeDITjk (ORCPT ); Mon, 9 Apr 2018 15:39:40 -0400 Received: from localhost (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id EE02B10A1521; Mon, 9 Apr 2018 12:39:39 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at anholt.net Received: from anholt.net ([127.0.0.1]) by localhost (kingsolver.anholt.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id IvTdoL-BAyTd; Mon, 9 Apr 2018 12:39:38 -0700 (PDT) Received: from eliezer.anholt.net (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id B231810A03D5; Mon, 9 Apr 2018 12:39:38 -0700 (PDT) Received: by eliezer.anholt.net (Postfix, from userid 1000) id 28EB42FE2D4E; Mon, 9 Apr 2018 12:39:38 -0700 (PDT) From: Eric Anholt To: Geert Uytterhoeven , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Stefan Wahren , Dave Stevenson , Greg Kroah-Hartman Cc: Arnd Bergmann , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: Re: [PATCH/RFC] soc: bcm2835: Make !RASPBERRYPI_FIRMWARE dummies return failure In-Reply-To: <1523178315-30562-1-git-send-email-geert@linux-m68k.org> References: <1523178315-30562-1-git-send-email-geert@linux-m68k.org> User-Agent: Notmuch/0.22.2+1~gb0bcfaa (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Mon, 09 Apr 2018 12:39:37 -0700 Message-ID: <87muycw4na.fsf@anholt.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Geert Uytterhoeven writes: > If CONFIG_RASPBERRYPI_FIRMWARE=3Dn: > > drivers/gpio/gpio-raspberrypi-exp.c: In function =E2=80=98rpi_exp_gpi= o_get_polarity=E2=80=99: > drivers/gpio/gpio-raspberrypi-exp.c:71: warning: =E2=80=98get.polarit= y=E2=80=99 is used uninitialized in this function > drivers/gpio/gpio-raspberrypi-exp.c: In function =E2=80=98rpi_exp_gpi= o_get_direction=E2=80=99: > drivers/gpio/gpio-raspberrypi-exp.c:150: warning: =E2=80=98get.direct= ion=E2=80=99 is used uninitialized in this function > > The dummy firmware interface functions return 0, which means success, > causing subsequent code to make use of the never initialized output > parameter. > > Fix this by making the dummy functions return an error code (-ENOSYS) > instead. > > Note that this assumes the firmware always fills in the requested data > in the CONFIG_RASPBERRYPI_FIRMWARE=3Dy case. > > Fixes: d45f1a563b92dac7 ("staging: vc04_services: fix up rpi firmware fun= ctions") > Signed-off-by: Geert Uytterhoeven You should definitely not be calling these if rpi_firmware_get() failed, so this seems like a good solution. Reviewed-by: Eric Anholt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlrLwXkACgkQtdYpNtH8 nuh2WQ/+JptLzv1KnWerohYv1FMIuzJL1mhg/BZUTBqkHx2Tp1SyJ6a8/+MpVQ9Q 4INe5it8Jeu+dRlOig2r9pNB4614rlQuk8bVmyp12PTnF91XmTANfXMmPd2XLWme EyydjBjx26cLRTP2lBA6NuM4jouaqiO74GAOvy3jwAUzK7Wk2DlL3lgj4alb77A/ cfunOumi3NFt7Yq4PT5fuN/CkBT01qPU6yzRQPu3QhscyXm982TafcSdLS+6l0eS Kwi92VhtELTiuT047ShL/FbLtT7ISnrTYMKUXHsgpbhvVJSBESDS0tk2tLe9t9cs 1LtD90y31XeNh1MAUsu4A+USB7PdzKWEpCF3pYSW56Iw+cQcHgKVVVE4P+PHycRG 8XVN6IYu7LjPOMDGLyYPPhOvIwvhB7u30JAy6bi11kJagf1RiHN7Eg6lzxT9NlXo p4MqzG3qhr6mwLVfP3TopVOQ6VDeuaOFu1v1guA2G8No4z6upfxBpwwVe5eUqmKo Q84gFA6L3agScWlFFcPhMQ9X/ss4osBg4wChXDdkHI4ShQnvETjgMB/oKYKa8sKG Aqycd9oho8p227UTrg+gAnH01D2acnqJI8c9Jgqu3uKZTDUjLOoVg2/m6pdoQJJP wSA+wn0JfMkCtq5Xyg+vwzV/smdmhT9n6+0A1ZQ9oACiHia/73A= =tHsI -----END PGP SIGNATURE----- --=-=-=--