Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932127AbdHWNzj (ORCPT ); Wed, 23 Aug 2017 09:55:39 -0400 Received: from mx2.suse.de ([195.135.220.15]:58177 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754054AbdHWNzi (ORCPT ); Wed, 23 Aug 2017 09:55:38 -0400 Date: Wed, 23 Aug 2017 15:55:36 +0200 Message-ID: From: Takashi Iwai To: "Bhumika Goyal" Cc: , , , Subject: Re: [PATCH] ALSA: ctxfi: make hw structures const In-Reply-To: <1503491322-32332-1-git-send-email-bhumirks@gmail.com> References: <1503491322-32332-1-git-send-email-bhumirks@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 734 Lines: 51 On Wed, 23 Aug 2017 14:28:42 +0200, Bhumika Goyal wrote: > > Make these const as they are only used in a copy operation. > Done using Coccinelle: > > @match disable optional_qualifier@ > identifier s; > @@ > static struct hw s = {...}; > > @ref@ > position p; > identifier match.s; > @@ > s@p > > @good1@ > position ref.p; > identifier match.s,f,c; > expression e; > @@ > ( > e = s@p > | > e = s@p.f > | > c(...,s@p.f,...) > | > c(...,s@p,...) > ) > > @bad depends on !good1@ > position ref.p; > identifier match.s; > @@ > s@p > > @depends on forall !bad disable optional_qualifier@ > identifier match.s; > @@ > static > + const > struct hw s; > > Signed-off-by: Bhumika Goyal Applied, thanks. Takashi