Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4018957ybv; Tue, 25 Feb 2020 11:34:08 -0800 (PST) X-Google-Smtp-Source: APXvYqzP4nVDWsVYhrJjLsjV6Jvkh4MXkEijEPBFBQ3XdY85DYjB1jER1hI03/fwBZFYtyW77BH+ X-Received: by 2002:a9d:4f04:: with SMTP id d4mr164769otl.78.1582659248196; Tue, 25 Feb 2020 11:34:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582659248; cv=none; d=google.com; s=arc-20160816; b=E15YDF7kObfubcDcExLl4Tz0PJKfJU/+FAAIU+VUOkawmcFFYBTK5OkYPxn9o0E8mU ijj71CDlHHgl3Kt4p9iO2T36JCmk8A0UANJkrK0h+KNU/fOqwag0PFvZxmF/bRCxipAZ 91bRWxsM4dcbmSWRg99jRLpk9FF8TTcWsnLShDVvSzK4ZLDltY0a6QL0wqf37L9fO+uD rR2IDyd9/yUqEYI7XBvhRw1Z4Uy8RyD5EJJ8IsZ5Fd1SyUsxAfDSqfvnVa7gg/gZz3ro RiCmp6AzJ9q3RCNnXpQej6GjmDbNwJl96LEQPB7/9v7vHrPy6XG3RsZU9Ugm5DoCUiGB +RFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=6fj2i98wrBqHNFBClWRPI0aXIGQwNsnnkHZjmeFx4vo=; b=fUnQuyGPbFzOqTLlcZbf6mrmP6EVSPzDATg5mATCK/W6VIhiMQRx2RekUJhOPzWdFO p5eHLCnci/jzRxMJvp0wP/ecv16/cd4Qg3OcJ2BA2h+GWW0XzicaH7bSZs65WCXg5eRV YsULVBNAbdDIJeNWbRr4Qg6EmQvjeC0+yDecg8A50spDa9zTZv8OXPLnRVSpmTgtD7Fv FuGhL7h1qQ1MMmy/N6IvDpvtBNsbawAsSZjvK/I6cxYx2ct/tRbRN6Qf8P3YV6eZVjF/ j/8nbtc6V9WtTOcjA2pRMzBds9FVVVM+p2ezeTxeeycBwpMDPt94BYfEdC1uk54lTqTK P39Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12si65275oim.195.2020.02.25.11.33.56; Tue, 25 Feb 2020 11:34:08 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731388AbgBYTLS (ORCPT + 99 others); Tue, 25 Feb 2020 14:11:18 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38501 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729489AbgBYTLS (ORCPT ); Tue, 25 Feb 2020 14:11:18 -0500 Received: by mail-pg1-f195.google.com with SMTP id d6so13154pgn.5; Tue, 25 Feb 2020 11:11:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=6fj2i98wrBqHNFBClWRPI0aXIGQwNsnnkHZjmeFx4vo=; b=lEmnenjDQ2KVRDWbKgSezI5Y9S8HulB2boliEz/CIatSs7pal+yLKXus2dAQKcc8LX TnTu6evVNMB5AFZAiBL5L/0Y+tEsExAwiZbkh8KkBVmyXV37DRwgjo4kIGhTYMRzN640 9kwkEwnsRs/C/nzTUBppNb8rsAJm+9ICP7ygdS10CVfnHO4yQ1U3waNFCPpRLBV7B2s9 L4XjYATIPTELXyBUKL5DkT9D9HAuZsh8KRUU1oGNJIgF9yzCaPJ+wkOZMyG/q3lnMDh/ eqDoCIOFAZHgIETVWFbOK7UCY6/h+W+Q6EQDdD2++5clWLHdGKXE0lB/IE6thDr5VGcV QgUw== X-Gm-Message-State: APjAAAXj2550UR9JP2QfjExfG0C3JND9uApKkZ/I/u1DfSuf7dJdRWmD uyhV7VyyYhG/d71rFCGiXHQ= X-Received: by 2002:a63:48f:: with SMTP id 137mr2886pge.245.1582657875635; Tue, 25 Feb 2020 11:11:15 -0800 (PST) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id s125sm17944724pgc.53.2020.02.25.11.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 11:11:13 -0800 (PST) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 59BFA40297; Tue, 25 Feb 2020 19:11:12 +0000 (UTC) Date: Tue, 25 Feb 2020 19:11:12 +0000 From: Luis Chamberlain To: Scott Branden Cc: Dan Carpenter , Greg Kroah-Hartman , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson , Andrew Morton , Colin Ian King , Kees Cook , Takashi Iwai , linux-kselftest@vger.kernel.org, Andy Gross Subject: Re: [PATCH v2 3/7] test_firmware: add partial read support for request_firmware_into_buf Message-ID: <20200225191112.GX11244@42.do-not-panic.com> References: <20200220004825.23372-1-scott.branden@broadcom.com> <20200220004825.23372-4-scott.branden@broadcom.com> <20200220084255.GW7838@kadam> <9afab7f8-1b5f-a7bb-6b76-f7b19efb2979@broadcom.com> <4a666590-461d-17f9-5580-31a41869383f@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4a666590-461d-17f9-5580-31a41869383f@broadcom.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 21, 2020 at 05:13:08PM -0800, Scott Branden wrote: > > > > +static ssize_t test_dev_config_show_size_t(char *buf, int cfg) > > > > +{ > > > > +??? size_t val; > > > > + > > > > +??? mutex_lock(&test_fw_mutex); > > > > +??? val = cfg; > > > > +??? mutex_unlock(&test_fw_mutex); > > > Both val and cfg are stack variables so there is no need for locking. > > > Probably you meant to pass a pointer to cfg? > I am following the existing code as was done for > test_dev_config_show_bool(), > test_dev_config_show_int(), > test_dev_config_show_u8() > > Mutex probably not needed but I don't think I need to deviate from the rest > of the test code. > > Luis, could you please explain what the rest of your code is doing? The lock is indeed not needed in the functions you mentioned, so you can also remove the other locks as a precursor patch. It would be a seperate patch. Luis