Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2050797ybg; Thu, 24 Oct 2019 04:08:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzP8TdtW7CPqN5PloEielL8Y2F2MGTfBGCIMs1Ewvmpq4FX/0Dj6QNyzHuad0EvmsWgU5YB X-Received: by 2002:a17:906:cc9a:: with SMTP id oq26mr388818ejb.292.1571915313667; Thu, 24 Oct 2019 04:08:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571915313; cv=none; d=google.com; s=arc-20160816; b=x6RTT+PHRMpEQzjMsAav42Hk8/vcGkQLgToRe54qqSBW1dcwa+UpbF4iFCOa4CwCcY ibSTW1Ic4Upl64XM0N4n9unnT3XGgkdYljU2Pfq9WFDrqDyflj56Q+Wo9aIF597knXxC kzFxV6cO5Z37yOzqGntaI3IxEmLzA2PMSJGYxA4W0dJJ1pDMm1RV31Qqf7qiMATFBBCf 4cDfsqThHKpLgNgpVfjIdw+Uf4Bv+xXIkBytNE4IYvdF3AebDb6tzT8kU+42YdzAuGSQ 5qn2rDSe55axcLTC341nYMe+3Elp1y6/r7DOBvn7rEnJxtvZ0ZIdNKTy13qXI//lLROX SdKQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Yy+Q+MO7o3PqEp+UoYBC+R7KWKu64kj6MbDxzFRIVS4=; b=ka/wmjdht8HzcfvAO7Rhw03E996saW6RYTVbYuLMIbZeM1MGOsj0oPo8kHI+w4JuOM 0QCJLYNEv32k+vu8+Y8OaTeqE550lQYV6KOXqRhMzB7KMMugWactAs/T+i8yqBkKgH7z O4VzoUeDNGrX4fBYkNhqkbRgIjYBRlLuI6hsDx5xxpq7oB5PH7H3ssaZpvvjvj85UgoQ prZgt3UFmavmKHYEADYTwWs3SEtXNV+yp2ikuuwdTkPEi6Zsm7Cmyke8RWgmJu81n8IR JFU66j8rPAW5xfeClj8+Mlo9wTF5CTfimMx/srKclAS4Butoy9BSanMOa2CTgUEYy6yV rwdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dEnCgxsT; 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 us9si546093ejb.195.2019.10.24.04.08.08; Thu, 24 Oct 2019 04:08:33 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=dEnCgxsT; 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 S2408176AbfJXCUB (ORCPT + 99 others); Wed, 23 Oct 2019 22:20:01 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:42408 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406401AbfJXCUB (ORCPT ); Wed, 23 Oct 2019 22:20:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Yy+Q+MO7o3PqEp+UoYBC+R7KWKu64kj6MbDxzFRIVS4=; b=dEnCgxsTOr8tUJZcVSZ/rftmR HG6hrUcy3fuLKRMfJFmQGZBe9RKe2ulMzp4klpRgLlbx5ccaLeLmBDZtC3z+hsdqUdHBPh6qmoj6t aWTIivoXL4Mm5lDxc3wf/EbvTsfvBlQdhhc6rWjGpUDl67985LsRKo+4vo4NqqkfadocUqxDHuffT mSvLfD3/POsYxbdNLWzOw90RLub2ve2ebuNsCFgZEj6S0/Z4fM4JFtFbbj0LmU7zA9bpm/60/rZGK W3sNARSq/vUTTGaZOhgVcr24OnFRFzOMZ/bkN60Wg3hdNWnEHjII2Qg1T+l5QIRxXxIuS4eaOlCLa 1qduQRcxw==; Received: from hch by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNSjG-00038m-B6; Thu, 24 Oct 2019 02:19:58 +0000 Date: Wed, 23 Oct 2019 19:19:58 -0700 From: Christoph Hellwig To: Michal Suchanek Cc: linux-scsi@vger.kernel.org, Jonathan Corbet , Jens Axboe , "James E.J. Bottomley" , "Martin K. Petersen" , Alexander Viro , Mauro Carvalho Chehab , Eric Biggers , "J. Bruce Fields" , Benjamin Coddington , Hannes Reinecke , Omar Sandoval , Ming Lei , Damien Le Moal , Bart Van Assche , Tejun Heo , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 2/8] cdrom: factor out common open_for_* code Message-ID: <20191024021958.GA11485@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > static > -int open_for_data(struct cdrom_device_info *cdi) > +int open_for_common(struct cdrom_device_info *cdi, tracktype *tracks) Please fix the coding style. static never should be on a line of its own.. > } else { > cd_dbg(CD_OPEN, "bummer. this drive can't close the tray.\n"); > - ret=-ENOMEDIUM; > - goto clean_up_and_return; > + return -ENOMEDIUM; Can you revert the polarity of the if opening the block before and return early for the -ENOMEDIUM case to save on leven of indentation? > if ((ret == CDS_NO_DISC) || (ret==CDS_TRAY_OPEN)) { If you touch the whole area please remove the inner braces and add the proper spaces around the second ==. > +static > +int open_for_data(struct cdrom_device_info *cdi) Same issue with the static here.