Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp899185pxb; Tue, 1 Feb 2022 12:44:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxFLgjowpjlCoYZPGJ7Qjl9KW+9ek4Mo+IZAp4YfQMnH9/IFmg7ext2powQ03hb+fn9lIh X-Received: by 2002:a17:902:bf06:: with SMTP id bi6mr27454134plb.24.1643748287244; Tue, 01 Feb 2022 12:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643748287; cv=none; d=google.com; s=arc-20160816; b=MAmpqDSdoWifUj0DOsjAHsbdnRg4q00LDYQ576Jo8pctBXpvRnPGUxErlG7q7PaAP7 dVpW6ANLEGKfO8fpvsfyDoVaRRg+ED74NbKmBhfzgmYc1+L2JvI2HZZLl68Gn2FEw4Z0 bxycGbl/THDmJ2fA8h4pbwAenMXVxICt6N7le8sIIxf9WXTT4ScPdDhxU660ABhtVKCq frTAVfONE4dI5NrqcjqJnfvonoIZyxp08hH4aH52gDKg4PwFrC7Lt0ZF9upG8JQzVnib ag29FhVumupXhbn5mZAgix9/iY0VycdJ8rSvZX02kjXGOXOANbQorrOyXgq6qdPrGitc BXVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SNnCkxNwIQWQYTRDHh1qopDr/upgsXnA1GNRroN4cJY=; b=jjq5iz9kcB6qERRPeK7vwsPoedy+pj8ihEHpAfAXmcUs4FhA0bTHF5kkx0HCP7JunT 00PVN72/0Av1ZlV/YPhr6pd29WSCziCE19QL1NEHymKZb8Zro/x19buPWMokc3Tj7VBg MtaNNgIlIt/BVdacE6r1DoRJPmGii1175K18aMosFE1VkRKzySdPbW/rYSYugr68Wors kja1mcSL4qPx2EvNQdxBDC5r8KQGnQvmTv0Y4hiHAT5lLux36CSuAtOS/inXL0b0UtTF CNaP3zD7Ev4D6CLUVBry+kfbWr9ReqVuYfQ5TbFnYm+iVNtUZNK3YcDqaEM00AsBZtOK yX9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KR83EWu6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t2si16539222plg.360.2022.02.01.12.44.35; Tue, 01 Feb 2022 12:44:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=KR83EWu6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380583AbiAaQpe (ORCPT + 99 others); Mon, 31 Jan 2022 11:45:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380574AbiAaQpb (ORCPT ); Mon, 31 Jan 2022 11:45:31 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD2FEC061714 for ; Mon, 31 Jan 2022 08:45:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4B0F760AE1 for ; Mon, 31 Jan 2022 16:45:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51B31C340E8; Mon, 31 Jan 2022 16:45:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643647530; bh=9MSg0aCS8sLQUyOSWxm+SNt05q8CIo7n+iLqnp0iDS8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KR83EWu6vecCqxOW80b5Y4wdxtsI8kTEhZUgY65a7ew6mCu69HO6ALZ4m8zo3rXbO HlKYKd7lJcF6aqlyNEn7Ugi4t3OZE2UxbqPMGXTbRHXa9ugO742ZM6xeA4SKh17DQ6 l0CkxaOFkQ9+yBOBc7F8DTGIQHELqa/dv/t5F/Os= Date: Mon, 31 Jan 2022 17:45:28 +0100 From: Greg KH To: Dan Carpenter Cc: Paulo Miguel Almeida , realwakka@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] staging: pi433: add debugfs interface Message-ID: References: <20220126132116.GA1951@kadam> <20220131134558.GL1951@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220131134558.GL1951@kadam> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 31, 2022 at 04:45:58PM +0300, Dan Carpenter wrote: > On Sun, Jan 30, 2022 at 03:57:26PM +1300, Paulo Miguel Almeida wrote: > > @@ -1102,12 +1104,75 @@ static const struct file_operations pi433_fops = { > > .llseek = no_llseek, > > }; > > > > +static int pi433_debugfs_regs_show(struct seq_file *m, void *p) > > +{ > > + struct pi433_device *dev; > > + u8 reg_data[114]; > > + int i; > > + char *fmt = "0x%02x, 0x%02x\n"; > > + int ret = 0; > > No need to initialize. Bogus initializers just disable ten thousand > person hours spent developing static analysis. > > > + > > + dev = m->private; > > + > > + mutex_lock(&dev->tx_fifo_lock); > > + mutex_lock(&dev->rx_lock); > > + > > + // wait for on-going operations to finish > > + ret = wait_event_interruptible(dev->rx_wait_queue, !dev->tx_active); > > + if (ret) > > + return ret; > > Drop the two mutexes before returning. Ick, I missed that. I'll go drop this patch from my tree now, good catch. greg k-h