Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1502936pxm; Thu, 3 Mar 2022 20:07:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJymX1EdcPCVRZYQ15Hd4YPMhgfG4eR8tahRu/HKoseuQfx6HRLgZfFWiuDSxFwWgkDzVwBv X-Received: by 2002:a17:906:6144:b0:6cf:bb2e:a2e1 with SMTP id p4-20020a170906614400b006cfbb2ea2e1mr30086139ejl.299.1646366829875; Thu, 03 Mar 2022 20:07:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646366829; cv=none; d=google.com; s=arc-20160816; b=d7IyJ0hcANRwjlrs/6R/KO++R1rbNe8nIjrCSkxPBVOdQhVW3nOvgeiiiFZEE4XovI 6BnNPRxIQbk/D6F8/aDMclW8BigEYo+MRilqWJJt5Y/ufVgua4RZIV19peY1vUGq7T9d hHEtnUCeIIQOCM3DYvG+zNZISKrd6k3Mz3nxc9JaHisQZvaDzumMhYQKsNC1kMxWU+g0 GvgvJQejzuCkRNTB/VbSE9Jalb5LBcpHZPUlTei0C+OnGfSW678csVn4ncX413cirkJa ZIztfDVtimYswxFBXIL28KqWYICoh17tIsbN0LrlIqiv/cywg8L/QgnKpC4Gjdfxg4EL 8JOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kNt+uExOdKvZCrqX3s6CyLfTjSwbyhvpmHdSFHA+AhY=; b=UKZEs2h3hAkEEnR7OBN4g4m/8V9iDT+/V+7OzTZhUPa2PWTROzWkMsuPUY9Ood0l7p eaX1r4ENEfnu1ukzR128c+gzEGlbg4SLsJnhqjIJSdqFf2wJj78AYPoGQvHj7AFrM4hL Z8Z/WSR7qKQ8yVLScbB+2T4ltpxNy2dGn6MSamz2kS0UbOEMGdQ54VydFasozCWUo0J7 QM3hPrd/FdhQ1KyB/K5VKzwdaiO9nx7u1iSzsy6QvhmDmUsrPdtSq5Mi1lUxffAO7Mnl 9SSI0ExKQ4dc23NIN8UsD203phjF7pRPSR1Grg5qE9vtVocvArd1v3EltOMEVJPH3BIe ip4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nwhXL4Y7; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js5-20020a17090797c500b006d733812b03si2668341ejc.534.2022.03.03.20.06.44; Thu, 03 Mar 2022 20:07:09 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=nwhXL4Y7; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233840AbiCCNzc (ORCPT + 99 others); Thu, 3 Mar 2022 08:55:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233575AbiCCNza (ORCPT ); Thu, 3 Mar 2022 08:55:30 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0942418BA44 for ; Thu, 3 Mar 2022 05:54:45 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id x15so7943646wru.13 for ; Thu, 03 Mar 2022 05:54:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kNt+uExOdKvZCrqX3s6CyLfTjSwbyhvpmHdSFHA+AhY=; b=nwhXL4Y7SzmubyDO/RluoS1gzPfy0i7/i0iVcGpmq15LQ1w5Icge7BleowM9FTNlmx RZGu2nUyIwAh8WcjivkJuDTa6iL5tJmyI+ESovVQ3gQU+v+lYEHs+ABYsKgP/LT1GFn1 VEQjKpt3r4/gWFn5hFcZReeIO1UstwqX2IX3Fq2mNuHiM9tN1f90/uwOPzAH0fLET+Vb Z6Hkypu0qMCIyXvrTQ/lUzf79IxRfwq5cOMs7xvIAkXqQOovEhvGekceQCHS2skLmCcd wAqMsqC/eg4De3SaJ+8Zx/je0zYoywbrbcJuGiJz7la75fp40vPDGSndG2afvlxUe0EN 7b5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kNt+uExOdKvZCrqX3s6CyLfTjSwbyhvpmHdSFHA+AhY=; b=7Vt0ex9m0FtBUvz9w9U82HBGhCJk1gYM9cOryR4nP4aZ5efrn/fHgSLC1aj+0jz/5G pPKgfs2SBh9h0JQ2eezUEhwr9gLFAODPNIwUUzycf/T5gib/m89OFuqAOe25eX6zraIG gFq9KGJ2MfKFl3EwS2fIPT9kbR20yGjxgI/yKNYkusLQa31pzHJ73WnxT4UjVD3vmNjp T6o1unGE7l4kIxQWGd0W1dbzeAwwJcHAAhVUWwySHgCW4wZHudp+JiMXiEx8jIezXDaY HTzmXNbrGNA3nEFOlVMn3jYR5W1UJPiIRfhVMcvFYhyVnYcu8LI2MQY1WD0qmdWH71Le 1Z3w== X-Gm-Message-State: AOAM530JvYYxaMZOJhTzSjrSLRRp7FOD11WuBlQgw1UBQBfgHM1xt8b9 PR059rN/A9VjfSnWyrVxaTx1HW+gvctD5ByY X-Received: by 2002:a5d:64c1:0:b0:1e4:987a:51b with SMTP id f1-20020a5d64c1000000b001e4987a051bmr27397729wri.471.1646315683333; Thu, 03 Mar 2022 05:54:43 -0800 (PST) Received: from localhost.localdomain ([102.126.166.16]) by smtp.gmail.com with ESMTPSA id d1-20020a056000114100b001efb97fae45sm2053255wrx.77.2022.03.03.05.54.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 05:54:43 -0800 (PST) From: hatimmohammed369@gmail.com To: john.stultz@linaro.org Cc: tglx@linutronix.de, sboyd@kernel.org, linux-kernel@vger.kernel.org, gregkh@suse.de, Hatim Muhammed Subject: [PATCH] Staging: Fix coding style issues Date: Thu, 3 Mar 2022 15:54:39 +0200 Message-Id: <20220303135439.23205-1-hatimmohammed369@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 From: Hatim Muhammed Fixed coding style issues reported by scripts/checkpatch.pl in file kernel/time/time.c Signed-off-by: Hatim Muhammed --- kernel/time/time.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/kernel/time/time.c b/kernel/time/time.c index 29923b20e0e4..1a96370ad78f 100644 --- a/kernel/time/time.c +++ b/kernel/time/time.c @@ -48,7 +48,6 @@ * programs who obtain this value by using gettimeofday. */ struct timezone sys_tz; - EXPORT_SYMBOL(sys_tz); #ifdef __ARCH_WANT_SYS_TIME @@ -64,7 +63,7 @@ SYSCALL_DEFINE1(time, __kernel_old_time_t __user *, tloc) __kernel_old_time_t i = (__kernel_old_time_t)ktime_get_real_seconds(); if (tloc) { - if (put_user(i,tloc)) + if (put_user(i, tloc)) return -EFAULT; } force_successful_syscall_return(); @@ -109,7 +108,7 @@ SYSCALL_DEFINE1(time32, old_time32_t __user *, tloc) i = (old_time32_t)ktime_get_real_seconds(); if (tloc) { - if (put_user(i,tloc)) + if (put_user(i, tloc)) return -EFAULT; } force_successful_syscall_return(); @@ -373,9 +372,9 @@ SYSCALL_DEFINE1(adjtimex_time32, struct old_timex32 __user *, utp) */ unsigned int jiffies_to_msecs(const unsigned long j) { -#if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ) +#if MSEC_PER_SEC && !(MSEC_PER_SEC % HZ) >= HZ return (MSEC_PER_SEC / HZ) * j; -#elif HZ > MSEC_PER_SEC && !(HZ % MSEC_PER_SEC) +#elif MSEC_PER_SEC && !(HZ % MSEC_PER_SEC) < HZ return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC); #else # if BITS_PER_LONG == 32 @@ -435,7 +434,8 @@ time64_t mktime64(const unsigned int year0, const unsigned int mon0, unsigned int mon = mon0, year = year0; /* 1..12 -> 11,12,1..10 */ - if (0 >= (int) (mon -= 2)) { + mon -= 2; + if (0 >= (int) mon) { mon += 12; /* Puts Feb last since it has leap day */ year -= 1; } @@ -590,7 +590,7 @@ timespec64_to_jiffies(const struct timespec64 *value) u64 sec = value->tv_sec; long nsec = value->tv_nsec + TICK_NSEC - 1; - if (sec >= MAX_SEC_IN_JIFFIES){ + if (sec >= MAX_SEC_IN_JIFFIES) { sec = MAX_SEC_IN_JIFFIES; nsec = 0; } @@ -609,6 +609,7 @@ jiffies_to_timespec64(const unsigned long jiffies, struct timespec64 *value) * one divide. */ u32 rem; + value->tv_sec = div_u64_rem((u64)jiffies * TICK_NSEC, NSEC_PER_SEC, &rem); value->tv_nsec = rem; @@ -634,7 +635,7 @@ EXPORT_SYMBOL(jiffies_to_clock_t); unsigned long clock_t_to_jiffies(unsigned long x) { -#if (HZ % USER_HZ)==0 +#if (HZ % USER_HZ) == 0 if (x >= ~0UL / (HZ / USER_HZ)) return ~0UL; return x * (HZ / USER_HZ); @@ -679,10 +680,10 @@ u64 nsec_to_clock_t(u64 x) return div_u64(x * USER_HZ / 512, NSEC_PER_SEC / 512); #else /* - * max relative error 5.7e-8 (1.8s per year) for USER_HZ <= 1024, - * overflow after 64.99 years. - * exact for HZ=60, 72, 90, 120, 144, 180, 300, 600, 900, ... - */ + * max relative error 5.7e-8 (1.8s per year) for USER_HZ <= 1024, + * overflow after 64.99 years. + * exact for HZ=60, 72, 90, 120, 144, 180, 300, 600, 900, ... + */ return div_u64(x * 9, (9ull * NSEC_PER_SEC + (USER_HZ / 2)) / USER_HZ); #endif } @@ -699,7 +700,7 @@ EXPORT_SYMBOL(jiffies64_to_nsecs); u64 jiffies64_to_msecs(const u64 j) { -#if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ) +#if MSEC_PER_SEC && !(MSEC_PER_SEC % HZ) >= HZ return (MSEC_PER_SEC / HZ) * j; #else return div_u64(j * HZ_TO_MSEC_NUM, HZ_TO_MSEC_DEN); -- 2.35.1