Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp611363imm; Fri, 13 Jul 2018 03:22:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpczTaCn894kvSWXg8DWj1CvgPYOcRin/eIHZ965yTG5wwc4qPdySep/4NJYB7pJb6wPMxkt X-Received: by 2002:a62:e813:: with SMTP id c19-v6mr6393539pfi.124.1531477321865; Fri, 13 Jul 2018 03:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531477321; cv=none; d=google.com; s=arc-20160816; b=ahJpo6uW7bmEl2ck6CE20iulWDvoAIS1m/mec363vGA9mJA8tu6rM6qDngcmZL57J9 yCa5kNB7LOtqPlSga/1s1ewlvW1e1K23QH90yHeMMhZjOgawLOOe3xrEZpHcLAFgnAMg 0hNdhcMxptkoF73wMZ0kZ5iodYcz6rkO9bYsX1Kyi2gDDgvQuuu9vEa+7bJd7IV7xMVJ YWnMG0iVDFA1A4f0ToDoKwhD9NOPc3upqxbJbMfIrvPtoroxJ0DyQ6JQkstWEM+jsV8s Z/fcFaBA/28OHrF6jBIHalJQK7duUee9Hn8dspLroN3aCnHYVcvO5TRyHovH5XTWLwKx L8rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=aXhjnJjyxGwGBQNBVIUc3v+UOGe7/rz+EZPaPaMDsVg=; b=zcaHGiTSvQi5vLIALvhQ8klFq/Uz5COSa8k8nEidbOX6O2O8P+hrEMRAfM4KAuL90I HZvq3hVpn5yOPA1EKin848TfoK6VeUyBNWTGxp6xpCyt8XtjgHGKJxHcnb0buG9YBgWH pf3/H8w0P/7nCWrl8cnESVv0Xualw1vq7Zu2w+3bXA/z2H+uifp0+CMQFkr6jL0hlEoF Zx2dIPTyrHMRRQoVP0YR5QPxJugXWKJb9EFEhCnSxorsWRK46MKjPuVn/dYgrU7ayEjC +JTXmcp2Dzx5UWk8Ef38ps8FMXTiOOsyNIZdsEs9cd3gIgRfYxvCcxtrSez5h08nB5uE 3hJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hlf2vxXU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 199-v6si26330337pfv.114.2018.07.13.03.21.46; Fri, 13 Jul 2018 03:22:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hlf2vxXU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727389AbeGMKfO (ORCPT + 99 others); Fri, 13 Jul 2018 06:35:14 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:37822 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727015AbeGMKfN (ORCPT ); Fri, 13 Jul 2018 06:35:13 -0400 Received: by mail-pf0-f195.google.com with SMTP id a26-v6so325639pfo.4 for ; Fri, 13 Jul 2018 03:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=aXhjnJjyxGwGBQNBVIUc3v+UOGe7/rz+EZPaPaMDsVg=; b=Hlf2vxXUu2zfHijJ59myu6FZyEr+73ReJbu5etoEU+q4UiI41W8mN2Ua3RX721Oak9 q0+n7kAVKZYtIDaDbyEnYMR01wm9+C/kMbNEuJbXVlZMkY5+QArA4cTLVto9wKKkuS8w 8AStlH2niUqhSQc+Hr45DDJQdaTWN1mYOqrRxq8EWgk6nX2A+n6iVYjq3i4r9nHUmuYY HNFpmG6jctKN94LL2ITW7nYn2PhYmX7n+qQ1PAdKylcQnlhG9L6kCF2FaGrx9LWoOBzh mYsQolEjEKgc01MU0S6zYyBFq3Xqtx5e6ptnGzHLGqZjv5UngOSczP+Z38+w9NMWkBGf 7gFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=aXhjnJjyxGwGBQNBVIUc3v+UOGe7/rz+EZPaPaMDsVg=; b=DAoqFJepAEsCIzth/iRgTGXyZHXn9n3+HAamFBHeGwajBXv9Xr1cQ5Uc5H4JRJcaoT OuSQi2QUrqCm0f27B865G8/O/NNXcShnbFE+oJ7MWmDBcW4XNCX3lWqoc3hFdFFnbzxp 7qMgsLOlOJfKw5/vGJYwz/hEYAgG7Z+qkvhShYA7K4yGL9V0JuPZb0CI7ew3v8/uOWhG iDjKb1m5xjao5x/zbBzs+9HuZ3zUlAo838bQeQr2/LGUSwam4yVI+IJ8EbjjHGFbGxBr c2hl4vBKsKveR2YIUxwJNlqfIJNA26UD7tLr8+EJRgNdsvUX2oiVMaqzXT31Lvbnu31c SbLQ== X-Gm-Message-State: AOUpUlFmkrewED3bWNH/2iU7b11Or1Bg88Ns2mv6ngElnQqqFyUiwuup ET3tZ4jWk+E5RlJ1mRenw/g= X-Received: by 2002:aa7:8298:: with SMTP id s24-v6mr6388270pfm.136.1531477271944; Fri, 13 Jul 2018 03:21:11 -0700 (PDT) Received: from himanshu-Vostro-3559 ([103.233.116.134]) by smtp.gmail.com with ESMTPSA id u17-v6sm84352022pfa.176.2018.07.13.03.21.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 03:21:11 -0700 (PDT) Date: Fri, 13 Jul 2018 15:51:03 +0530 From: Himanshu Jha To: Julia Lawall Cc: Dominique Martinet , Michal Marek , Nicolas Palix , linux-kernel@vger.kernel.org, Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , yamada.masahiro@socionext.com, cocci@systeme.lip6.fr Subject: Re: [Cocci] [PATCH 01/18] coccinelle: change strncpy+truncation to strlcpy Message-ID: <20180713102103.GA12972@himanshu-Vostro-3559> References: <1531444483-17338-1-git-send-email-asmadeus@codewreck.org> <20180713074455.GA6859@himanshu-Vostro-3559> <20180713080023.GB9638@nautica> <20180713091412.GA11250@himanshu-Vostro-3559> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Thanks Himanshu for the suggestions. > > However, I'm not sure to follow the discussion. The original problem was > that Coccinelle was removing a comment that should be preserved. I think > that this occurs because the line just below the comment is completely > removed. Coccinelle considers that the comment belongs with that line and > if the line is removed the comment won't make much sense. > > In Himanshu's solution, the code is just not transformed at all, so as a > side effect the comment stays too. Is that what is wanted in this case? Yes, there is no transformation with my solution which I advised to prevent comment removal(which i thought was useful). My rule is more narrower approach than the regular ones which used "expression" metavariable. Rest upto Dominique to choose whatever suits better :) -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology