From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932640Ab2AISEy (ORCPT ); Mon, 9 Jan 2012 13:04:54 -0500 Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11]:52402 "EHLO TX2EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932330Ab2AISEx (ORCPT ); Mon, 9 Jan 2012 13:04:53 -0500 X-SpamScore: -19 X-BigFish: VPS-19(zz1432N98dKzz1202hzz15d4Rz2dh668h839h944h64h) X-Spam-TCS-SCL: 3:0 X-Forefront-Antispam-Report: CIP:163.181.249.109;KIP:(null);UIP:(null);IPV:NLI;H:ausb3twp02.amd.com;RD:none;EFVD:NLI X-WSS-ID: 0LXJM80-02-AV1-02 X-M-MSG: Date: Mon, 9 Jan 2012 19:04:44 +0100 From: Joerg Roedel To: Alan Stern CC: Konrad Rzeszutek Wilk , Martin Schwidefsky , Michael Buesch , Dmitry Torokhov , Kernel development list Subject: Re: Incorrect uses of get_driver()/put_driver() Message-ID: <20120109180444.GD7166@amd.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: amd.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 09, 2012 at 12:35:09PM -0500, Alan Stern wrote: > lib/dma-debug.c:173: drv = get_driver(dev->driver); > lib/dma-debug.c:188: put_driver(drv); > > Joerg, these calls don't seem to do anything, as far as I can tell. > Is there any reason to keep them? No reason to keep them :) It can be replaced with dev->driver, even reference counting is not needed because only the pointer is kept and never dereferenced. Joerg -- AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632