Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1075658rwr; Wed, 26 Apr 2023 09:46:59 -0700 (PDT) X-Google-Smtp-Source: AKy350b3fvlqkIgfQVDyOfk7FtMHZgp5LI6ifRqcozkcnMOaYjB5N/rfsbSaWkdvwErxu40/dpKu X-Received: by 2002:a17:90a:134b:b0:24b:8221:5bb4 with SMTP id y11-20020a17090a134b00b0024b82215bb4mr16308570pjf.4.1682527619665; Wed, 26 Apr 2023 09:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682527619; cv=none; d=google.com; s=arc-20160816; b=CdqFY7gTSYb7gg8lmZ5rM//5VPDb+csxQHaXcCUtqLtXNilVGi527MiV14SChhB465 uS9tgzk9VgW1nDBMQfRP11N2KOyKvd6Wus9CaemTSpxMEH0Fobmj4bcmdG9suNI2gtdM W+0THDHOrpqAgnjPAreWZCPUrHqOmlfSjCbCtvbrG1Q5QNG6ZU5nCaoQaE7iezJOq9yi /s/lct4T7T7wWDFrZBeJvcVDznXvO10TUHdSunpcLf7/bhnHWOTjqbl087e+3WL76abB nF6sBaT90ThYHHrNYGI7oHgotxC17hvjw1mF8EEsVsIlPCPoHRXqgYgxGnLhTg9GuTkb lTRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:to:subject:from:user-agent:mime-version :date:message-id; bh=HiIQGs9lDJpO3uMuMZoURiKGm77nW3DUPJPQrXJs0uE=; b=vB4eEWH7vjaFMtkSeWnkYjj+y+jWg2LOcRNS8YtwBQf1occuaeav514NBmw12paxxN djATsqGo56DeMr8UQVSDH05a4di4luttfpy33X5KOpF4XufdE2PGIYJCXewVztf9K/fB 5k2YNmga2XsQSmWLqR/rHbtoNyWFcBn9x86FosCpVyC6nrmDj/UWyCcZzd6zmvd8M2wS rLB5BaBA0+Dmit6Qv8iY1dKlOeo2i1hFCBpBxwyeUQMnv9yEU77bG5louFKOby9j8Nxb k7B6y8hXeyokCJ92z5pAXDivuHfHkVPzHFu72aGK49Xj0Mx8QqdvQwvPFbogwYUCZ9xK TVYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g3-20020a17090adb0300b0024675623f8esi16286546pjv.40.2023.04.26.09.46.47; Wed, 26 Apr 2023 09:46:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233308AbjDZQok (ORCPT + 99 others); Wed, 26 Apr 2023 12:44:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229915AbjDZQoj (ORCPT ); Wed, 26 Apr 2023 12:44:39 -0400 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CE722727; Wed, 26 Apr 2023 09:44:38 -0700 (PDT) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-246f856d751so5170838a91.0; Wed, 26 Apr 2023 09:44:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682527477; x=1685119477; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HiIQGs9lDJpO3uMuMZoURiKGm77nW3DUPJPQrXJs0uE=; b=JvrDF0PeUeEQJSy+xkhTY9ExgPmzgvRQHjNzAFk5MN7LjIqH7CIYZtykBsZa8gEkjR l2yty5JFlbtpFgaMqRHWnniwa9JYyqAuA4HEwPWaaz8PboNzCqPsLedHul31HhgIdfoP x96z7aEVZsgEFRfmIMYbTv8/H/jCUY6fpE9hu/2cEligjc+qRs5erUETZM0usNp5I2o9 C6aO3XJyYQFymVxuBQ3NBUBgLR+0EMOesgOXPfK2RLPWRPdnx/0H6PMBufuiJK0qR3wn YYs2qqvRgMS5n5zuUIAuBvCw+W0oxtK0bizD81thmE1V2ia5aHhbEVUnR4guSh2Ma8iA 5rnw== X-Gm-Message-State: AAQBX9dWYXVCLccOm3IuIf/94mqswyo0tf7eFOC1kJ0x4wVQ2il5xIBT w8pCARDpi8AsTZw9lL2uyIo= X-Received: by 2002:a17:90a:4812:b0:23b:4439:4179 with SMTP id a18-20020a17090a481200b0023b44394179mr21143122pjh.28.1682527477185; Wed, 26 Apr 2023 09:44:37 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:5099:ad7c:6c1:9570? ([2620:15c:211:201:5099:ad7c:6c1:9570]) by smtp.gmail.com with ESMTPSA id g2-20020a17090adb0200b00246f9725ffcsm9858549pjv.33.2023.04.26.09.44.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Apr 2023 09:44:36 -0700 (PDT) Message-ID: Date: Wed, 26 Apr 2023 09:44:34 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 From: Bart Van Assche Subject: Re: [PATCH] scsi: ufs: core: Simplify param_set_mcq_mode() To: keosung.park@samsung.com, ALIM AKHTAR , "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "stanley.chu@mediatek.com" , "quic_asutoshd@quicinc.com" , "beanhuo@micron.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20230426052153epcms2p27d64a865f15bfd452d564f77d63605db@epcms2p2> Content-Language: en-US In-Reply-To: <20230426052153epcms2p27d64a865f15bfd452d564f77d63605db@epcms2p2> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/25/23 22:21, Keoseong Park wrote: > This function does not require the "ret" variable because it returns > only the result of param_set_bool(). > > Remove unnecessary "ret" variable and simplify the code. > > Signed-off-by: Keoseong Park > --- > drivers/ufs/core/ufshcd.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c > index 9434328ba323..46c4ed478ad0 100644 > --- a/drivers/ufs/core/ufshcd.c > +++ b/drivers/ufs/core/ufshcd.c > @@ -108,13 +108,7 @@ static bool is_mcq_supported(struct ufs_hba *hba) > > static int param_set_mcq_mode(const char *val, const struct kernel_param *kp) > { > - int ret; > - > - ret = param_set_bool(val, kp); > - if (ret) > - return ret; > - > - return 0; > + return param_set_bool(val, kp); > } > > static const struct kernel_param_ops mcq_mode_ops = { Why do we even have the param_set_mcq_mode() callback? Has it been considered to remove mcq_mode_ops as in the untested patch below? Thanks, Bart. diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 7b1e7d7091ff..2b8c2613f7d7 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -98,7 +98,7 @@ /* Polling time to wait for fDeviceInit */ #define FDEVICEINIT_COMPL_TIMEOUT 1500 /* millisecs */ -/* UFSHC 4.0 compliant HC support this mode, refer param_set_mcq_mode() */ +/* UFSHC 4.0 compliant HC support this mode. */ static bool use_mcq_mode = true; static bool is_mcq_supported(struct ufs_hba *hba) @@ -106,23 +106,7 @@ static bool is_mcq_supported(struct ufs_hba *hba) return hba->mcq_sup && use_mcq_mode; } -static int param_set_mcq_mode(const char *val, const struct kernel_param *kp) -{ - int ret; - - ret = param_set_bool(val, kp); - if (ret) - return ret; - - return 0; -} - -static const struct kernel_param_ops mcq_mode_ops = { - .set = param_set_mcq_mode, - .get = param_get_bool, -}; - -module_param_cb(use_mcq_mode, &mcq_mode_ops, &use_mcq_mode, 0644); +module_param(use_mcq_mode, bool, 0644); MODULE_PARM_DESC(use_mcq_mode, "Control MCQ mode for controllers starting from UFSHCI 4.0. 1 - enable MCQ, 0 - disable MCQ. MCQ is enabled by default"); #define ufshcd_toggle_vreg(_dev, _vreg, _on) \