Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp11767lqh; Fri, 3 May 2024 11:42:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsUV0EWdGg3dnuRtjDWUR0D59RxxMTKr4ICo1kJ4q3CqK2ISPpq0H/AGixQGGo+/OmJ2tlYNFDfG/ms/PrBmTM3vOgBAie/G7jYzDXUA== X-Google-Smtp-Source: AGHT+IHYojFTQaZAxxeWt+5jBcO1TvHS0w2BvpWIXhHWBA2a+hiDnR/FGVlQkZhXvsHnAOvaHRda X-Received: by 2002:a2e:96d8:0:b0:2dc:f12f:b7fb with SMTP id d24-20020a2e96d8000000b002dcf12fb7fbmr2302863ljj.43.1714761774480; Fri, 03 May 2024 11:42:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714761774; cv=pass; d=google.com; s=arc-20160816; b=wtzRo9Yw17xRycznd+T9iuO95xmrik4YEqC/Hz2Z+6OinNLzhzWjfPxrGSYBzzuu9H mFLh2QsM1ARaZbkyp+bMPOGgakqPdpfByjcUw5oSIAcjWGRFl6/W6J1UMan/XIWaDDu9 jIm4nGzLGgcqJ1/sQAyg4PTpBFhQR+oKro3VVKJU9N/T5xZoOmK649MPUNfnK2w53nj7 yrKzyxILwNOT+Yvga+Sdkaztb/bLlVkWkQ0H+1QyUh/zV+I4/BwSmUcvayt5tP8X3vj9 ppuMzfWWu3WRwiCbhxuxWNPz0r4ZsRSVHNIauv0QuZPRQYF8b/fYhAurdqEOZuuCd4Ix kmlg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=b9VJxZ0C0Ko6yaZwsbKvzJxC5CioSznikRet9eZOiIs=; fh=IlkveLSGx1C3skMgkA2o74BwytU7XmLhV2g6zWN2LvE=; b=sRmtMSrXHmUJzj8Dhj2vkd0nFR2KSSZf6VyKyZqH8irfsLFYndj4ttRwO0U6y3A+/0 eZMerO2D/AFnvOTETeuu2Dk9rD0r2cjF215i4McQVk/CtmoUN8i4QcY/Sr5B5Zdz8Os4 eDMqptrvSqY5CdU+8dDXRkYyfXxxpjqZE+iwHIF91i5LBsb5VTEAzkybz0GBXXZdTZWL oyFcNE4eNWBmNDS+csgsNg7A1Ln/VKxr8qrg9eqn2U+G8F8o9KGntCaRQDrX+MLy2XP8 I17f4H1xigb02x5GXFaG/8M4V7XMW6Ou+vp4ya2bS5fdOVU1aGb9niOJRDhwz0FaO0/9 AxLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AUOpQoXU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-168079-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e3-20020aa7d7c3000000b00572231ebeedsi1831209eds.81.2024.05.03.11.42.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 11:42:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168079-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AUOpQoXU; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-168079-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168079-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A1B241F21A4D for ; Fri, 3 May 2024 18:42:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96D3214A0A3; Fri, 3 May 2024 18:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AUOpQoXU" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6939857C8A for ; Fri, 3 May 2024 18:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714761757; cv=none; b=Y8fTnNDKHqGwfm34A+Qj8zrrz7xFCuJjKRLrp8DZVZTYPJdGF0OQbh/kAyPE/1b27UaiOto3345U2vGiTV178PPMvG/vMJPty2hRhC++1posDUYRybGQe/dqFHP/T7LziNfFCzZt5rQv5KPl8CXzEUomxizVnurK4pb3VDGNnHY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714761757; c=relaxed/simple; bh=q4xkNgHhMhLTgKFwLy/peK8W9gb/1njcDFxZND/a0m0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=S8ELtV8rhru2Wv1KzLPxgFAiGOK+YZkaz0FVO0ckUyUS4Is7zQIzRIB28cmhbnmUHMrgVB+ZmqSjjNrJR+ZVZLmDhietoV6cNL10jzC5J+s+uEhohou7qKzTEBLJ2hUB+cx95umTDYsrg7kn0wIqhN3U6K4JQN5Zu6bvqk/y2cA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=AUOpQoXU; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714761756; x=1746297756; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=q4xkNgHhMhLTgKFwLy/peK8W9gb/1njcDFxZND/a0m0=; b=AUOpQoXUy3UxtaG80tXkVhV/hde0bG/Nrky3njtFsiGBhfh5jVAigKMi qilfFOJ0CcEr2vp+t9fX+JJtiVcHucW2CYuw3ii8mNH85PoQ8D0S5eaui Osg6PtfNfKsFUWKZNgNJ7W3FeWItjzgNtEOxRFAfCswfSE0gZYr9vK48z Gzhf7C6qQrawmMlwUmn84TrbQP/vq1olmiW7lLVeMfXPLZf4k2s6HW2hX QyHSND05Q1Ue2YLnA5ZMhTmkqVJ/yVfLTZneMxxeeN/h50QBnsaSTwJsl xJuwShwizHLBZsVG6Yo8hbxp8lHzrI6PZTjHTTYmPs0CNCgQjzuNcCkja Q==; X-CSE-ConnectionGUID: j38AMJgjRD6W+pnCzRnebw== X-CSE-MsgGUID: Ul02x0LDTVaftZiw6fhYuQ== X-IronPort-AV: E=McAfee;i="6600,9927,11063"; a="10415183" X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="10415183" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 May 2024 11:42:36 -0700 X-CSE-ConnectionGUID: L7Jb2MVnRRqBAFDbvzalPg== X-CSE-MsgGUID: jsIjoHonTVqgZoTeH/PC6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,251,1708416000"; d="scan'208";a="27634376" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa006.fm.intel.com with ESMTP; 03 May 2024 11:42:35 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3FCBE19E; Fri, 3 May 2024 21:42:33 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Subject: [PATCH v1 1/1] mtd: cfi: Get rid of redundant 'else' Date: Fri, 3 May 2024 21:42:30 +0300 Message-ID: <20240503184230.2927283-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- include/linux/mtd/cfi.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 947410faf9e2..35ca19ae21ae 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h @@ -308,32 +308,32 @@ static inline uint8_t cfi_read_query(struct map_info *map, uint32_t addr) { map_word val = map_read(map, addr); - if (map_bankwidth_is_1(map)) { + if (map_bankwidth_is_1(map)) return val.x[0]; - } else if (map_bankwidth_is_2(map)) { + if (map_bankwidth_is_2(map)) return cfi16_to_cpu(map, val.x[0]); - } else { - /* No point in a 64-bit byteswap since that would just be - swapping the responses from different chips, and we are - only interested in one chip (a representative sample) */ - return cfi32_to_cpu(map, val.x[0]); - } + /* + * No point in a 64-bit byteswap since that would just be + * swapping the responses from different chips, and we are + * only interested in one chip (a representative sample) + */ + return cfi32_to_cpu(map, val.x[0]); } static inline uint16_t cfi_read_query16(struct map_info *map, uint32_t addr) { map_word val = map_read(map, addr); - if (map_bankwidth_is_1(map)) { + if (map_bankwidth_is_1(map)) return val.x[0] & 0xff; - } else if (map_bankwidth_is_2(map)) { + if (map_bankwidth_is_2(map)) return cfi16_to_cpu(map, val.x[0]); - } else { - /* No point in a 64-bit byteswap since that would just be - swapping the responses from different chips, and we are - only interested in one chip (a representative sample) */ - return cfi32_to_cpu(map, val.x[0]); - } + /* + * No point in a 64-bit byteswap since that would just be + * swapping the responses from different chips, and we are + * only interested in one chip (a representative sample) + */ + return cfi32_to_cpu(map, val.x[0]); } void cfi_udelay(int us); -- 2.43.0.rc1.1336.g36b5255a03ac