From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751315AbdBLS4r (ORCPT ); Sun, 12 Feb 2017 13:56:47 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:36635 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbdBLS4p (ORCPT ); Sun, 12 Feb 2017 13:56:45 -0500 Date: Sun, 12 Feb 2017 19:56:41 +0100 (CET) From: Thomas Gleixner To: Bhumika Goyal cc: Ard Biesheuvel , Julia Lawall , "linux-kernel@vger.kernel.org" , Mark Rutland , Marc Zyngier , Daniel Lezcano , "linux-arm-kernel@lists.infradead.org" , Kees Cook Subject: Re: [PATCH] clocksource: add __ro_after_init to cyclecounter In-Reply-To: Message-ID: References: <1486840818-22214-1-git-send-email-bhumirks@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 12 Feb 2017, Bhumika Goyal wrote: > On Sun, Feb 12, 2017 at 2:01 AM, Ard Biesheuvel > wrote: > > On 11 February 2017 at 19:20, Bhumika Goyal wrote: > >> The object cyclecounter of type cyclecounter is not getting modified > >> after getting initialized by arch_counter_register. Apart from > >> initialization in arch_counter_register it is also passed as an argument > >> to the function timecounter_init but this argument is of type const. > >> Therefore, add __ro_after_init to its declaration. > >> > > > > I think adding __ro_after_init is fine if this struct is never > > modified after init. But the reference in the commit log to the > > constness of the timecounter_init() argument makes no sense: that > > only means timecounter_init() will not modify the object, which allows > > pointers to const objects to be passed to it as well. The opposite is > > not true, though: there is no requirement whatsoever that objects > > passed into const pointer arguments should be const themselves. > > > > > > Yes, true. I will change the commit log and send a v2. Thanks for explaining. I've applied it already and fixed up the subject/changelog. You should have mail from tip-bot ...