Received: by 10.213.65.68 with SMTP id h4csp1283535imn; Wed, 14 Mar 2018 15:35:21 -0700 (PDT) X-Google-Smtp-Source: AG47ELtNmRdWSuxzqiZ5oLGUl4mBzSgNsMMp5YHoL++9c/2/6DlVbT47ZKdY7kQSZV3/VOFbIcJF X-Received: by 10.101.96.212 with SMTP id r20mr4996829pgv.139.1521066921129; Wed, 14 Mar 2018 15:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521066921; cv=none; d=google.com; s=arc-20160816; b=qK0MPVEiN6luPkpo8SCVOQVRgCBJ3lqsFXL14UX+CemgdJ3f93/VgdRFw/SgnMWtHT JvcTG/3SEHL2YeW2gKgql6J4uost4isMlJf95z89LRCa1OaLt2WQg2Sw05VJRe4VVcm1 AAK8WVu+MmsahO3kdGOR3H3X84GQjH27bRysz4U2Z4L+g2OY/iAVmaMEks7As2U1MK4R HwJJ+XWsgAK9vmpVIeZ+8IJPJxeNGivKjfWsdMyI7n2hEith0Ov8jKXdN9NjZxc1Midu pvHffOUkeFhu0bgVo+OlHNn1504XM3d6Hd9TXHipD4xguY9deQSlb645fElN4Vv04IZQ Um1g== 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:dmarc-filter :arc-authentication-results; bh=eVDAIIjOL4448fvtqdglmfbBh4EBxDYmVxWyo/3hSh8=; b=V1QDI/fPfoBoRhlZHKN7FZ4XkZnlSA4gAukwVdxjWn8mHap7I/AVQFrhJbu3GNyCwd tK0ScAc26G+LY+lp9vMPsPOobnN6+eH3ClqpaA+Yb90j7uDwp3XBKuLHR8Rqi7w8gdBM 71dApmQVEXpCEseGb5Y/Hx1Ti/LBkiZn1qigNawLnuKJ/Ec/H2aUKSuK+fATVS73IAw8 dvETsm2WKGsYal9VOTZyD54fgYR6iEpUdsp89kEAbhCf3Ek/YHm0pvonVN6lYIWKkOXG lQQvAlatUthhloo8tqlvXKsUEnS8pFiKZx4tbDybgEWSQGx8GaHdu/jx4SOorqO/mXbn 69gg== 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 j25si2468835pgn.592.2018.03.14.15.35.06; Wed, 14 Mar 2018 15:35:21 -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 S1752052AbeCNWds (ORCPT + 99 others); Wed, 14 Mar 2018 18:33:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:38612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751459AbeCNWdq (ORCPT ); Wed, 14 Mar 2018 18:33:46 -0400 Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 81558217D3; Wed, 14 Mar 2018 22:33:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 81558217D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mcgrof@kernel.org Received: by mail-io0-f172.google.com with SMTP id e30so6274170ioc.3; Wed, 14 Mar 2018 15:33:45 -0700 (PDT) X-Gm-Message-State: AElRT7GzIBUpEOb4w6WfcjqXOe2dwJl8hSUU6+jBP6JzSVZxc/7SytqT GMNnhImUnj3p2Ouf8jsUDsEPEYcNEsHl8TFEDgM= X-Received: by 10.107.138.193 with SMTP id c62mr6496002ioj.280.1521066824660; Wed, 14 Mar 2018 15:33:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.10.9 with HTTP; Wed, 14 Mar 2018 15:33:23 -0700 (PDT) In-Reply-To: <20180314185634.GC15837@kroah.com> References: <20180310141501.2214-1-mcgrof@kernel.org> <20180310141501.2214-8-mcgrof@kernel.org> <20180314185634.GC15837@kroah.com> From: "Luis R. Rodriguez" Date: Wed, 14 Mar 2018 15:33:23 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 07/20] firmware: move loading timeout under struct firmware_fallback_config To: Greg KH Cc: Andrew Morton , cantabile.desu@gmail.com, kubakici@wp.pl, linux-wireless , Kees Cook , shuah@kernel.org, Martin Fuzzey , Mimi Zohar , David Howells , =?UTF-8?Q?Pali_Roh=C3=A1r?= , Takashi Iwai , Arend Van Spriel , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Nicolas Broeking , Vikram Mulukutla , Mark Brown , Dmitry Torokhov , David Woodhouse , Linus Torvalds , Abhay Salunke , Bjorn Andersson , jewalt@lgsinnovations.com, oneukum@suse.com, Alexei Starovoitov , Andres Rodriguez , "linux-kernel@vger.kernel.org" , Linux FS Devel 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 On Wed, Mar 14, 2018 at 11:56 AM, Greg KH wrote: > On Sat, Mar 10, 2018 at 06:14:48AM -0800, Luis R. Rodriguez wrote: >> The timeout is a fallback construct, so we can just stuff the >> timeout configuration under struct firmware_fallback_config. > > Why? What does it matter? Because we want to remove direct access to things which the direct firmware loader should not care about, and instead have proper wrappers so that the fallback code implements it when needed. Part of the motivation for this then was to move all fallback code into its own file therefore compartmentalizing it. >> While at it, add a few helpers which vets the use of getting or >> setting the timeout as an int. The main use of the timeout is >> to set a timeout for completion, and that is used as an unsigned >> long. There a few cases however where it makes sense to get or >> set the timeout as an int, the helpers annotate these use cases >> have been properly vetted for. > > This feels really odd to me. Why would you want to use it as an int, > just keep it the same "size" everywhere and it should be simpler and > easier to keep working correctly over time. One is the input/output we provide for it uses ints all over so its much easier to handle this as an int consistently in most places and only deal with the long where needed. See above uses of simple_strtol(), add_uevent_var(). Otherwise the inverse has to be done. This was easier to deal with and vet for. Luis