From patchwork Thu Jan 19 22:08:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13108893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85424C46467 for ; Thu, 19 Jan 2023 22:23:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbjASWX4 (ORCPT ); Thu, 19 Jan 2023 17:23:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230063AbjASWWK (ORCPT ); Thu, 19 Jan 2023 17:22:10 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBE2794301; Thu, 19 Jan 2023 14:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674166064; x=1705702064; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0Nb+PfTy4Kttk4m28YbXbR4pIOx0SX9GnTAgxRBpkEM=; b=bL9kKZMhKK7c8wNIP7QJFuNzH+zzPaZzIl4YMNyg6b62P1yA0XLfObqc MvqOz0B0Qf44Jaq/qrmNXIOCDshBBjfjWfQwsy3EC35XkT0PZqFoOnTMx uDK1HxkgrHiYLLL2vBTMJhNzft73EhD2N3f3hzclwjKPkTe7n6C90th0W 58+LBVt41wQWMiOUOtsUNQKWLSlEQxkYyiW91/k0FPrRuR67OiuOMRmKA CkBUjemM+60HXuzyRKQwaoFLxajbs4gZdzOc0tcormirxq08sFrEGSzBB ks++lHyTex25VUbRzUt1I2OboLFhz7WBAZhye6q+/NYas5dlLJsOlqY9B w==; X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="305114121" X-IronPort-AV: E=Sophos;i="5.97,230,1669104000"; d="scan'208";a="305114121" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2023 14:07:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="637879324" X-IronPort-AV: E=Sophos;i="5.97,230,1669104000"; d="scan'208";a="637879324" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 19 Jan 2023 14:07:43 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7D1C5488; Fri, 20 Jan 2023 00:08:15 +0200 (EET) From: Andy Shevchenko To: Jens Axboe , Greg Kroah-Hartman , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 8/9] pktcdvd: Get rid of redundant 'else' Date: Fri, 20 Jan 2023 00:08:08 +0200 Message-Id: <20230119220809.5518-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230119220809.5518-1-andriy.shevchenko@linux.intel.com> References: <20230119220809.5518-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org In the snippets like the following if (...) return / goto / break / continue ...; else ... the 'else' is redundant. Get rid of it. Signed-off-by: Andy Shevchenko Reviewed-by: Greg Kroah-Hartman --- drivers/block/pktcdvd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 340e953e3888..22048739a245 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -958,25 +958,25 @@ static int pkt_set_segment_merging(struct pktcdvd_device *pd, struct request_que { struct device *ddev = disk_to_dev(pd->disk); - if ((pd->settings.size << 9) / CD_FRAMESIZE - <= queue_max_segments(q)) { + if ((pd->settings.size << 9) / CD_FRAMESIZE <= queue_max_segments(q)) { /* * The cdrom device can handle one segment/frame */ clear_bit(PACKET_MERGE_SEGS, &pd->flags); return 0; - } else if ((pd->settings.size << 9) / PAGE_SIZE - <= queue_max_segments(q)) { + } + + if ((pd->settings.size << 9) / PAGE_SIZE <= queue_max_segments(q)) { /* * We can handle this case at the expense of some extra memory * copies during write operations */ set_bit(PACKET_MERGE_SEGS, &pd->flags); return 0; - } else { - dev_err(ddev, "cdrom max_phys_segments too small\n"); - return -EIO; } + + dev_err(ddev, "cdrom max_phys_segments too small\n"); + return -EIO; } static void pkt_end_io_read(struct bio *bio)