From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16B0ECA9EB9 for ; Thu, 24 Oct 2019 02:20:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8F2220684 for ; Thu, 24 Oct 2019 02:20:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="dEnCgxsT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408180AbfJXCUB (ORCPT ); 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.