Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4019724imm; Tue, 11 Sep 2018 05:51:59 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZbv1cLb4ds2X3MTrlgsyzViDCl2fuWHN93khaQg72Y1t25xhviKzgUf9GNHnF9g8hgy0oO X-Received: by 2002:a62:56d9:: with SMTP id h86-v6mr29525093pfj.229.1536670319940; Tue, 11 Sep 2018 05:51:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536670319; cv=none; d=google.com; s=arc-20160816; b=i7UzDCSmSGTA+eXcxhh2wYB5RgPesgB301o5eLZzHwPLRd5pwph6BnX7woWZnc+WmR dWp+tqE1Y+ks1+ndr5Auq4owFxT2paSYOspwQKIU674R8KswBgiYG+n2GuK+WpD2Md7m 4f7MyCRpV3HXJ5DYrFZf+wdg+fM2P7YFWV7LrZSmnXEcneA4kM5J1906qb7bMTyaJKof M7FHY8snjDjTxb7nNzr3+KlwaG59/NGtrcTGBWBFVmfjHvTFdENnGuGhix5D5elx1Cu9 fLlpYw1sTAMUPI+nBf4hA6tPUle2pNJms2oKQqyX9Z+g+Y5mLu5h0aoTbv5vt298wUgN T4yw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=D7X6ouYZgtmxr5vcfmMsrcOASzHcoKi0YMOsNUidqCU=; b=Qf80G0LKfQoAElIYD1PLFBOumuAojijCEYBiuwXrH2U4gY/hwnC1RDxYCPZHgy38o2 Tek1vA08ousgSf3alzCqTFfa3HOh4SRsGMSKz0Iosw+oEOKw84z6vE8U+shdMdNu7+pv /wL0yNP1uZNPt2S8Z9K6C4M3+ulMOnv5kmi+hB+NQIC+jXdjtSj7EL2RtusPg9E21FU6 G8h/qA1+p5FytyMm0r2cgcyvMY5bc93WuX+dCKtI5V+PrFZRtt++4IP06y1BKDuYNMGB JLnGuiu7RedtcLQVbRV7tqXDIsDrUwauxJPoDrEusTZCQkxhEwXIjNfJp6sdvpxHmwR6 a03A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=efihKtGP; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6-v6si15574968plp.434.2018.09.11.05.51.44; Tue, 11 Sep 2018 05:51:59 -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=@linaro.org header.s=google header.b=efihKtGP; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727152AbeIKRtK (ORCPT + 99 others); Tue, 11 Sep 2018 13:49:10 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:38385 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726761AbeIKRtK (ORCPT ); Tue, 11 Sep 2018 13:49:10 -0400 Received: by mail-wm0-f65.google.com with SMTP id t25-v6so848566wmi.3 for ; Tue, 11 Sep 2018 05:49:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=D7X6ouYZgtmxr5vcfmMsrcOASzHcoKi0YMOsNUidqCU=; b=efihKtGP79huGr8AeAIW59GrY031+vA3lHiYnvtJriXrj6wYega71PNcFuMPqlKGtG xDGaLNnx2wUkcLYzBR5/L59kSwKf7UcQ/2Zj+EX+AlXcT1YHvxXvuARk6ek9Elyntc2a DB2ASUY1RlFR4RWcOJ5leDsmb6HBpT24q26KA= 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:content-transfer-encoding :in-reply-to:user-agent; bh=D7X6ouYZgtmxr5vcfmMsrcOASzHcoKi0YMOsNUidqCU=; b=CAzZkdAbryddkh+8h9DaDPjooEg9cLpCumDtbprwAfXDwOFTCxpeItpinKqkAwQ8pq SA3APv82adpgy5o0J8LHVP4jOfQK5kyf5QARy/EiH1ylRSH/dOnMrkyXpjQ+gmHNb9fo 0t5lmTkXuIi2dwHiU3s+OJ+pxR0190IOldGyWhxs7r4bppBmwvPSG2GcuvO2nYW/VQhu x3f7QIFtUyWykgJnkYlwhlnRknA0XnB4MvlTuH56UpeYGBQZUCsM3ROm3aAVqvofooAC f0acYwtG1ssDAtzrbuUygeTp1Q16FJCgvohQgInq0NprH0j9A1aVVle3ivCpI/u4kx09 3JzQ== X-Gm-Message-State: APzg51BSk07nPQ/8BzQ15pkdfOYUMJl/DVrcaPlhKR4motqlkMSt/a28 oYoBZ3tAKudr2E+5wr+ik3wJpQ== X-Received: by 2002:a1c:8587:: with SMTP id h129-v6mr1244321wmd.105.1536670197236; Tue, 11 Sep 2018 05:49:57 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id 142-v6sm1296388wme.35.2018.09.11.05.49.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Sep 2018 05:49:56 -0700 (PDT) Date: Tue, 11 Sep 2018 13:49:54 +0100 From: Daniel Thompson To: Laura Abbott Cc: Jason Wessel , Greg Kroah-Hartman , Jiri Slaby , kgdb-bugreport@lists.sourceforge.net, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kgdboc: Fix restrict error Message-ID: <20180911124954.zwhzxshx6zzddj4v@holly.lan> References: <20180910232014.2642-1-labbott@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180910232014.2642-1-labbott@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 10, 2018 at 04:20:14PM -0700, Laura Abbott wrote: > There's an error when compiled with restrict: > > drivers/tty/serial/kgdboc.c: In function ‘configure_kgdboc’: > drivers/tty/serial/kgdboc.c:137:2: error: ‘strcpy’ source argument is the same > as destination [-Werror=restrict] > strcpy(config, opt); > ^~~~~~~~~~~~~~~~~~~ > > As the error implies, this is from trying to use config as both source and > destination. Drop the call to the function where config is the argument > since nothing else happens in the function. > > Signed-off-by: Laura Abbott Reviewed-by: Daniel Thompson > --- > drivers/tty/serial/kgdboc.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c > index b4ba2b1dab76..dd503743bbff 100644 > --- a/drivers/tty/serial/kgdboc.c > +++ b/drivers/tty/serial/kgdboc.c > @@ -154,15 +154,13 @@ static int configure_kgdboc(void) > { > struct tty_driver *p; > int tty_line = 0; > - int err; > + int err = -ENODEV; > char *cptr = config; > struct console *cons; > > - err = kgdboc_option_setup(config); > - if (err || !strlen(config) || isspace(config[0])) > + if (!strlen(config) || isspace(config[0])) > goto noconfig; > > - err = -ENODEV; > kgdboc_io_ops.is_console = 0; > kgdb_tty_driver = NULL; > > -- > 2.17.1 >