From patchwork Wed Feb 6 11:39:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: venu X-Patchwork-Id: 218562 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-vc0-f189.google.com (mail-vc0-f189.google.com [209.85.220.189]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D7E062C02B4 for ; Wed, 6 Feb 2013 22:39:57 +1100 (EST) Received: by mail-vc0-f189.google.com with SMTP id fo14sf460717vcb.6 for ; Wed, 06 Feb 2013 03:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-received:x-beenthere:x-received:x-received:received-spf :x-yahoo-newman-property:x-yahoo-newman-id:x-ymail-osg :x-rocket-mimeinfo:x-mailer:references:message-id:date:from:reply-to :subject:to:cc:in-reply-to:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=mFov8y9LbkprgMYiQ/boBvV0jGKefB6wtDAye13UeMI=; b=uav8hyOp7ohjz1w+ePfGZq+BcsqVet30u9P6+XgP3/OvIF0WZFr5vcjyQXrAtrSuSh 8tUqcdE16FO9AtTwPL72iyjfccz7E6L2xW0Jo0zU6NzTYrr88riWsFFbt/1vZqpXpOyB 5ClkKMUsIF2D1kRPPI6SWH0ru0PEjYbtCuEn8vjrrezZbn4CPcjL8yv88QabYednjgnN gN3qLA+5N/LWiys+H/eiltFSso96X4LaU077BCu+9tW5eb46i9/CVxvGtbPzP8FmVdQE TtcomS+p13L1sZrLYx9AoBtagNU3OLL8Z1z1HdiItlY0wrE8TAqhbSjc/1XbgIOrOkib q4pw== X-Received: by 10.50.154.132 with SMTP id vo4mr249394igb.7.1360150794667; Wed, 06 Feb 2013 03:39:54 -0800 (PST) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.50.36.225 with SMTP id t1ls2591116igj.9.canary; Wed, 06 Feb 2013 03:39:54 -0800 (PST) X-Received: by 10.66.86.166 with SMTP id q6mr3813073paz.44.1360150794173; Wed, 06 Feb 2013 03:39:54 -0800 (PST) X-Received: by 10.66.86.166 with SMTP id q6mr3813072paz.44.1360150794152; Wed, 06 Feb 2013 03:39:54 -0800 (PST) Received: from nm10.bullet.mail.sg3.yahoo.com (nm10.bullet.mail.sg3.yahoo.com. [106.10.148.89]) by gmr-mx.google.com with ESMTPS id n8si4668429paz.2.2013.02.06.03.39.53 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 06 Feb 2013 03:39:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bvg_1@yahoo.com designates 106.10.148.89 as permitted sender) client-ip=106.10.148.89; Received: from [106.10.166.120] by nm10.bullet.mail.sg3.yahoo.com with NNFMP; 06 Feb 2013 11:39:52 -0000 Received: from [106.10.151.123] by tm9.bullet.mail.sg3.yahoo.com with NNFMP; 06 Feb 2013 11:39:51 -0000 Received: from [127.0.0.1] by omp1005.mail.sg3.yahoo.com with NNFMP; 06 Feb 2013 11:39:51 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 932675.48496.bm@omp1005.mail.sg3.yahoo.com Received: (qmail 5962 invoked by uid 60001); 6 Feb 2013 11:39:51 -0000 X-YMail-OSG: v2L6EJcVM1mcdRZEqF6IHI4t2Ah5VU8.cMUKGipLGkzzq6E adfi4aqHNumA_jX2rgLb32cO0ba_Mgx1pVeBYn5zJOa4wLEtFKHHf3BFNKMv VC2v5wwdsdRu53ugNzfBeG0XipmLK06.M_8d4C0gPd26PGwMsc6e8ZeJ92iV 4nDawOlXpK.hcXYQ_B05YBQUdcSD1javXiCiTPEAiEWR_YLSujKul6y6BycQ l6TEZVWTHBBCVrFRccwQk8vJA0ofWxOBCAE7l5zoz.LZhMvFtEqyJLCg0ir1 gdAJgrkp4TgPlo5pUMpy9dsHyHcQzEvllcIW_HqXjq2nCSDaBHLOZQSWzb1j DD1Khrm8HS2dKmJeBSyI5B.mNgITttT2U_RSGLeSXYOSSZoJMxz6_R8.f._V BFOV_Ii3Lkz4Lv97XYnkAXyoubKWyGq9OkgJHXYsnokbryZ1fd5aWspreU5c Sn3xKC3dyLBrDNyHExJDZbRfnDoJ4c6Wh2wS4caHGAIPmjqpQE8UBdBgtG_g sYFvwdNdu3X86aHZ_0n98xlEib1BWTH_DzLlhTReXFoK9lRhsDfSSMQHwHUI 5Gzg8MzpFJ4WSUjweAEFw0PqQyTybtx5T5.WVUPqp09ShUXGjOyQtHL2Rp3D 6F1I86U9D7K3O88UT5vMM82aM8ZEOfocHNX9kK9zSs6oPpP9xneKkaw7WPhM - Received: from [202.164.25.5] by web192506.mail.sg3.yahoo.com via HTTP; Wed, 06 Feb 2013 19:39:51 SGT X-Rocket-MIMEInfo: 001.001, QnkgZGVmaW5pdGlvbiBvZiBMZWFwIHllYXIsCklmIGEgeWVhciBpcyBtdWx0aXBsZSBvZiAxMDAgYW5kIG5vdCA0MDAsIHRoZW4gdGhhdCBzaG91bGQgbm90IGJlIGEgbGVhcCB5ZWFyLgoKWW91ciBsb2dpYyBkb2VzIG5vdCB0YWtlIGNhcmUgb2YgdGhpcyBjb25kaXRpb24uCgpIZW5jZSBJIGZlZWwgdGhpcyBwYXRjaCBpcyBub3QgY29ycmVjdC4KClRoYW5rcywKVmVudQoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCiBGcm9tOiBKb25naHdhIExlZSA8am9uZ2h3YTMubGVlQHNhbXN1bmcuY28BMAEBAQE- X-Mailer: YahooMailWebService/0.8.132.503 References: <1360149775-19606-1-git-send-email-jonghwa3.lee@samsung.com> Message-ID: <1360150791.5912.YahooMailNeo@web192506.mail.sg3.yahoo.com> Date: Wed, 6 Feb 2013 19:39:51 +0800 (SGT) From: venu Reply-To: rtc-linux@googlegroups.com Subject: Re: [rtc-linux] [PATCH] rtc: Modify leap year test for more simpler way To: "rtc-linux@googlegroups.com" , "linux-kernel@vger.kernel.org" Cc: "a.zummo@towertech.it" , Andrew Morton , Jonghwa Lee In-Reply-To: <1360149775-19606-1-git-send-email-jonghwa3.lee@samsung.com> MIME-Version: 1.0 X-Original-Sender: bvg_1@yahoo.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of bvg_1@yahoo.com designates 106.10.148.89 as permitted sender) smtp.mail=bvg_1@yahoo.com; dkim=pass header.i=@yahoo.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , By definition of Leap year, If a year is multiple of 100 and not 400, then that should not be a leap year. Your logic does not take care of this condition. Hence I feel this patch is not correct. Thanks, Venu diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 9531845..d662b8d 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -181,7 +181,7 @@ void rtc_timer_do_work(struct work_struct *work); static inline bool is_leap_year(unsigned int year) { -    return (!(year % 4) && (year % 100)) || !(year % 400); +    return !(year & 0x3); } #ifdef CONFIG_RTC_HCTOSYS_DEVICE