Received: by 2002:a4a:3008:0:0:0:0:0 with SMTP id q8-v6csp3527049oof; Mon, 10 Sep 2018 16:23:02 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb9QiaHmoewZIqF1EJOtXXYhwpPLwKiV88MNcpY8O2Mvoj7Lfn/9vmRF+9VYmis7OGc6MPZ X-Received: by 2002:a17:902:bd07:: with SMTP id p7-v6mr23783643pls.32.1536621782282; Mon, 10 Sep 2018 16:23:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536621782; cv=none; d=google.com; s=arc-20160816; b=XBuXwd3EQUtqfxiMxszkfYtXrwiqQR4/qm0HgyCDcjtwa8WZyzzsJJrtATW5q4UVFT QmHfkfbhCgS2CUiyWQ4bOKNTbnQFkLr4bjpJTl8RJ/iCmLkl+dcK6cXP+m09hhnkOufb anWyHR700VJ5mjn1TJOscIktQM9CHtEGFPIF/F+pqxCVYLOa7vrirYPl0oB5j1KNB+C3 JkaUrp9nvgjkxjRYRFVaQbb9s7615f/LnXjWJ7Pv+J7hwBPvXu+v89ssCSyCWwG3XQuU sagzjUkFGM/6E6li+wvurjWScWozJnocf41ClPcdpjCzOUIqar9tErANaNwfz4kn8/Lk Ue8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=JMFMt7s2Fn5IXYGJbzlzQT9gKqCzA1W3C8hRQZcEHUU=; b=Q9Q5Otj9KNguTXub+ZgJhnnWxpib2WGDyoPsMleUUxusup0Q28n8yeW3+hAG9DSJIb JNAKpatV5c5fF6jB3M23Dq6lViC0mX91rJ/ztcGvQBwGlseVSqsF0fh27ar2jUSqcee4 IX8yuJM93tOVNKBgt1F2fDOn9xPDRDaNwgi/LeorsoyHb+KlwVEDsXmJEZI55ICHdm0x 6UgRNhFOoY/LEwl/6h1B9Tj7GHGfzQsusCBL0sLr1LC3kwXUDhi6YY/WNtTBMuN8XjK7 0aW4FVtb6rMaLZxt0kYeKylmifwii0PHg05GGlR8mh7iahU7MngVqdVubnj+WDv7GbLV Dnjw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h185-v6si18647891pfc.172.2018.09.10.16.22.47; Mon, 10 Sep 2018 16:23:02 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726459AbeIKEQm (ORCPT + 99 others); Tue, 11 Sep 2018 00:16:42 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34958 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbeIKEQm (ORCPT ); Tue, 11 Sep 2018 00:16:42 -0400 Received: by mail-qt0-f194.google.com with SMTP id j7-v6so26322083qtp.2 for ; Mon, 10 Sep 2018 16:20:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JMFMt7s2Fn5IXYGJbzlzQT9gKqCzA1W3C8hRQZcEHUU=; b=NYKFKcyxC6pwIUu49RXzrAlEg2LPuOwipjR06hQEDrOn3gPa0sOJPs9Hx8gOG2C5sZ CWbdHnewfWxdED/6Tu/F44liOxXLTHbenwPOExmEhL/VU4BEjD3hMTbKYPrPaxVYXBMV CKi7eJ9hiZuk9S91HoP99yZrAf7/PImHAYrLaX+ia+wmKIDsWoxt7YehmAnt77/8pEFk bjqM8tBly7lg5Yjlt6FojA1dCnN4QuAqssmEFXtpY2kdelINqdTYs7ssrHV2dF4GXy1s isYLBlSddQww6PBC1uJRPsw9z2kekMao53EJRGF0YGTT77ovZmwMHMPyx6Ya8knfwuZf WKtQ== X-Gm-Message-State: APzg51CG5mGSmFTKbf3PegegfkPW3xDBEmoc1niuSwS/Nx0LQD1MVRGV G7aCezuc6gm4GV1hRuhZLbtRHw== X-Received: by 2002:a0c:8a4b:: with SMTP id 11-v6mr16410304qvu.57.1536621620485; Mon, 10 Sep 2018 16:20:20 -0700 (PDT) Received: from labbott-redhat.redhat.com ([2601:602:9802:a8dc::42c3]) by smtp.gmail.com with ESMTPSA id k5-v6sm10057941qkf.53.2018.09.10.16.20.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Sep 2018 16:20:19 -0700 (PDT) From: Laura Abbott To: Jason Wessel , Daniel Thompson Cc: Laura Abbott , Greg Kroah-Hartman , Jiri Slaby , kgdb-bugreport@lists.sourceforge.net, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kgdboc: Fix restrict error Date: Mon, 10 Sep 2018 16:20:14 -0700 Message-Id: <20180910232014.2642-1-labbott@redhat.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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