From patchwork Thu Feb 15 17:17:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 201661 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp548664dyb; Thu, 15 Feb 2024 09:18:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUmgAeRUZIRBi3wmdLTzApf5v9o/lPRRJcyqsly7qPEWi1wwD9fTfZl7AW/T90Sfw3jCqBXkj7HDEhwSa50rZvaFilGuw== X-Google-Smtp-Source: AGHT+IGA6RiPqBUEnOls4onYlPnBhB9FhpiiK+i6BhPupGqs3jT2zZWJYPLT3XjmZ208NlQs6GrB X-Received: by 2002:a92:c805:0:b0:363:bdf6:ea29 with SMTP id v5-20020a92c805000000b00363bdf6ea29mr2335183iln.21.1708017504036; Thu, 15 Feb 2024 09:18:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708017504; cv=pass; d=google.com; s=arc-20160816; b=trbMMpZSqQ0X0AwaHQ5Ra56CKKrnD5sqORUAExqtt1jd6NjSe4+G3WcDeMyPHHc9bb doGP+0RCNfgvvLQ0Ypml+iQfLBx5iTaOc4zA5rBABVuPw8TC1eHE9/aH+RDmbqL6D6pv X2i+phqKQ1OlZYR9wanN6TycvfBTKLPdB2HUzW3H/dJ/eAcuUXgddSro5iAUWj0ph8Sk Ahb7wXsxGVSrEcLiwjwVhGJLNdUst8xipToqeyYf/4X920vJgvNwtLL5dfrKtToTiqW2 jrR/znn97eR096oYPQQ+mosH33HTGuWxqqv9/ISYo7HxAecUZqAmk2KHtubpYswFz+S6 O0AA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LaEbk0wqkJrGhQpGNqYgT1jXkOwl5keUz4UPTBa9rB0=; fh=p3G15TSjAvwP8sriy8HIHw31EGqLRsuWdLokmQJygKY=; b=XAMWV5pyFcgR8fMoynb7OlvCUE3odACfwvuPurdbxafWpp7+BVl30ZfKN8B4DEnl0d b8fiKEIbfkTDpgevr0GdrcE8DzT5c0TkoWnGDQkeN9DT8lx7LhuW8iA1mcaY9osML/Ht 5qZG9MJHoMLCc+FiUXxwwRVq9b8kWR6p+tdhmnACxH+YvytOhvz2b0Xe6vsNdnyQdPbh V6sqguBLQLoF0gMkEBTk5J9sdS3jQMoB537mkEPZRtCgZoI6u8d1ZDjXOjR4gZXz5DZK 4kGSwdDBvWy98TI6swaDGDD0WTYthnfvfB4Xvv/PdJIuwmNgJdQDc6H1vQcczrEGkoz0 novw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a0EBncya; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67386-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67386-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x22-20020a63b216000000b005dc6d1551basi1378707pge.234.2024.02.15.09.18.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:18:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67386-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a0EBncya; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67386-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67386-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A4F4328B9F4 for ; Thu, 15 Feb 2024 17:18:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63EA7138481; Thu, 15 Feb 2024 17:17:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a0EBncya" Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EEA8136659; Thu, 15 Feb 2024 17:17:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708017476; cv=none; b=XwWo1+DZW86qe33pX5qgizyiNu0jP5lQ0oZB0LEUA3Ob6JGqREfe+gb46ENRAzjBipq75ZsCOkkOVuhgmrCTAt0JDf+pBfwjHcJOLjGXE3f8mtDbhiCygNtZV94X0lBvs/vkqvOpVpXJGnMBgb80C4s50XX3l2sIWD5wpjf/ax4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708017476; c=relaxed/simple; bh=eFdJHcujAkNakHE9cboLrLydtuz4OsYv+UTx701ru4Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q8f3lf1sZtcnqJ5f5x/sD+a9t89nOL7ILCFlbSb25AfXsKqk0AtAPIcxQ2WdQKTHe66Qu6BLzWpRQgDbOSDjWKVWbP4w+ens0xHvJc9QFfwXtyi93hk2UdsMLIccjLlcws5Lm8FwvIwOghPbhQbZ4FnDT9apHxGqPZfq9tQ9pMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=a0EBncya; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-51187830d6dso1340345e87.3; Thu, 15 Feb 2024 09:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708017473; x=1708622273; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LaEbk0wqkJrGhQpGNqYgT1jXkOwl5keUz4UPTBa9rB0=; b=a0EBncya+Mb5Ju/G75yymiTprr0j1f/yzhsXiAI+NFeo4QjVtioXb5qSH/f3BoDE+p 6bM51BG5IdYXtfQrtjKnPdfm39T581DAUt1UySOc6pRW1dsViJxueeZtbltg/3xTV8gh 1oG7TA9AA81/geIgfq8L9YCWiIqxYQTBUhu34FUC3KArBAV6cqcN57epCzskA45HQ8L2 We9l6S4oRNGkCk3srBN/VmdS/T7pUKi5s4rYj8qgXt0rZtTf5hrr2cbHQ/T7/U8LsOXb GTz7it5ggjhWYvbnSuP2NCcLaNGWAOuTnISz4ZkanS+FgT4Xm5rWTb2EZ7RT5AnyXnHg yVgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708017473; x=1708622273; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LaEbk0wqkJrGhQpGNqYgT1jXkOwl5keUz4UPTBa9rB0=; b=plbjCFxbEbpdmHIHiqkIMbnoV+bvGvjICdPc8lUQpRsAVTFGEyOfDzUD3TPvpur+GG eERxHGpxf4rWYgF5ZN2mv3Ouy9cmgsnbM4fE5jT8z8mqfzFAvt4fiWIXHlv0v9wqQr61 PwF2H0edP8B61lVhXWIQ/3doyOH7mOM2V50rccScO64Y7R6nUFAU6GISDBdBUy/8o8nm FDrlKYXnCUVwpkTOZMiyS84LCnTrlQR6q3QcMpRDfdPf6EVm7NYZci7qK2jFx85ayjqB DP9XR55TYuWWymN5BkOOO7S6uQm2leUdF77YYclu1aF5gNCjGxlg55vNl50FIuCi7KDc 86xQ== X-Forwarded-Encrypted: i=1; AJvYcCVRY1xF37tyTAHkTc+iAH2sDJrRgrJY7uMlDwGZyX63zIpXD1RO/10/iKmJfno8HCCS9XkVswxsBUdCEt3oCIdyTr74T1sQ34NAYag8ZHo2KXEhxhsYhimoxJ8xRsVtcxw++LJO8QOXXKcRtjGrTt33puC3iFmBBzFuJOQUalooZZmJ/CgJaA== X-Gm-Message-State: AOJu0YyzQyCYKzSA+dk2kOHUqVLM1CppO4E3/B5qJ/enHioeyrIzqehq A2mG4bLmxB0fW8o/J3LDsRiPpbfR/geBS3BRF4jZwb14USvLtNys X-Received: by 2002:a05:6512:1152:b0:511:7ebe:b160 with SMTP id m18-20020a056512115200b005117ebeb160mr2239460lfg.45.1708017472483; Thu, 15 Feb 2024 09:17:52 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id p17-20020a19f011000000b005118f61ffb3sm309458lfc.233.2024.02.15.09.17.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:17:52 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann , Jiaxun Yang , Andrew Morton Cc: Serge Semin , Alexey Malahov , Stephen Rothwell , linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] mips: cm: Add __mips_cm_l2sync_phys_base prototype declaration Date: Thu, 15 Feb 2024 20:17:26 +0300 Message-ID: <20240215171740.14550-2-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240215171740.14550-1-fancer.lancer@gmail.com> References: <20240215171740.14550-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790986162175737673 X-GMAIL-MSGID: 1790986162175737673 The __mips_cm_l2sync_phys_base() and mips_cm_l2sync_phys_base() couple was introduced in commit 9f98f3dd0c51 ("MIPS: Add generic CM probe & access code") where the former method was a weak implementation of the later function. Such design pattern permitted to re-define the original method and use the weak implementation in the new function. A similar approach was introduced in the framework of another arch-specific programmable interface: mips_cm_phys_base() and __mips_cm_phys_base(). The only difference is that the underscored method of the later couple was declared in the "asm/mips-cm.h" header file, but it wasn't done for the CM L2-sync methods in the subject. Due to the missing the global function declaration the "missing prototype" warning was spotted in the framework of the commit 9a2036724cd6 ("mips: mark local function static if possible") and fixed just be re-qualifying the weak method as static. Doing that broke what was originally implied by having the weak implementation globally defined. Fix that by dropping the static qualifier and adding the __mips_cm_l2sync_phys_base() prototype declared in the "asm/mips-cm.h" header file. Fixes: 9a2036724cd6 ("mips: mark local function static if possible") Signed-off-by: Serge Semin --- Note seeing there is no user of the pattern described above we can convert it to having just weakly defined methods. Let me know if that would be a better alternative. --- arch/mips/include/asm/mips-cm.h | 14 ++++++++++++++ arch/mips/kernel/mips-cm.c | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h index 23c67c0871b1..1f143dfad7a2 100644 --- a/arch/mips/include/asm/mips-cm.h +++ b/arch/mips/include/asm/mips-cm.h @@ -33,6 +33,20 @@ extern void __iomem *mips_cm_l2sync_base; */ extern phys_addr_t __mips_cm_phys_base(void); +/** + * __mips_cm_l2sync_phys_base - retrieve the physical base address of the CM + * L2-sync region + * + * This function returns the physical base address of the Coherence Manager + * L2-cache only region. It provides a default implementation which reads the + * CMGCRL2OnlySyncBase register where available or returns a 4K region just + * behind the CM GCR base address. It may be overridden by platforms which + * determine this address in a different way by defining a function with the + * same prototype except for the name mips_cm_l2sync_phys_base (without + * underscores). + */ +extern phys_addr_t __mips_cm_l2sync_phys_base(void); + /* * mips_cm_is64 - determine CM register width * diff --git a/arch/mips/kernel/mips-cm.c b/arch/mips/kernel/mips-cm.c index 84b3affb9de8..3f00788b0871 100644 --- a/arch/mips/kernel/mips-cm.c +++ b/arch/mips/kernel/mips-cm.c @@ -201,7 +201,7 @@ phys_addr_t __mips_cm_phys_base(void) phys_addr_t mips_cm_phys_base(void) __attribute__((weak, alias("__mips_cm_phys_base"))); -static phys_addr_t __mips_cm_l2sync_phys_base(void) +phys_addr_t __mips_cm_l2sync_phys_base(void) { u32 base_reg; From patchwork Thu Feb 15 17:17:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 201662 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp548791dyb; Thu, 15 Feb 2024 09:18:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWp17BUCskMGVk8sdHwgO6yehvED7NSBXKJbouVxtknBAhdgPPT1rvsA8K2QjvInuzZS3GmI3Sqs2hpAwxWjPaVs/SjUQ== X-Google-Smtp-Source: AGHT+IEbw+D/p3kJhLx21zdsxit9crLT6BghjPqDiDyYrLjkElSI1DtVeODb0lCxKq/2iyt7Eiyj X-Received: by 2002:a17:902:fe18:b0:1db:398c:3413 with SMTP id g24-20020a170902fe1800b001db398c3413mr2190476plj.46.1708017517128; Thu, 15 Feb 2024 09:18:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708017517; cv=pass; d=google.com; s=arc-20160816; b=ovbd1582/kfyqWyIwrdsAf+KRNjyOfeeHKMhsqF9oeex5K7asMX6WhXQXep/z/tR2U yVoQVZ78LYVjp3kKAeTZzhRi1W5OHYtSnx1NIySuBK7BXKGsdbT8yfUrdATad/Jb4hPm TF6CT4IcxBlvcztPqtAIFNaBJqQNajI1aYt/yGd5NDVPUBDPGql6mTZUf3nwHJqlPWHT kEPloN4B3+FXmL1XmMqv7/Uh2ce4zEJJACJVAcRRTsV6yeLdBcAstonyfEV6ckYFM8fr VZzFcn25Unu77lg9yu62XvlR/Xa4hhca7SgGLRYGsOxXBk63sLGDS1slSwjNgfHD91oF txHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LWD6NBu3YiSI1wWq6kinvIvYBM4vO3pv/UsA9bvpgzQ=; fh=w2wKCE38naN0/k+QB0Ip7Si7m0GIz+xPzwj1+AYcH4k=; b=pttTkZSWZFu3JThMHLvHEdKseNUiRglajTGiyuKGpoZSmyELvTvpUKpH5Yg/lqDYuM MkmhndtpAad9rotsLt9WwfuNCWFHIrpxWlwD7/txy0Wf2RDhxyqnQHzmwApV3N7JIjB9 A2AXBNTkSxNVdwewmfLmAPtsacatwoycSzLE1PETmqlwzbDfACeVvFFHpie2co4zb9/1 DJdavGZgyQ6JLH0jGmt4Ny/rkl+AX3qtsjjl03Ielwko4XW4R8eEtINg8nkv7oTHzDzW YtFEmkXWQVLJP/FRvYFKB1b6y9ELS75q0ObsBx2VnWCEjizFxj0At7owPCjjKf1XdT1o oRVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GvSPP72q; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67387-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67387-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u16-20020a170903125000b001db2d82e7f1si1457643plh.137.2024.02.15.09.18.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:18:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67387-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GvSPP72q; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67387-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67387-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 91EA6282738 for ; Thu, 15 Feb 2024 17:18:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA8DF136676; Thu, 15 Feb 2024 17:18:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GvSPP72q" Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 711B2136983; Thu, 15 Feb 2024 17:17:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708017478; cv=none; b=HH4dtq/UOJRKhCOzkwlHHVbgcrNY/zlxvOP66ZawKEExackHxeH/jR2YVSUm41AG990TbkFWs1HCGtFvplYviPBTHvbQ4rcifvuSz02+mI+QVwsdRoUMgJxxF1dM4XAmGsxqhRdPSEMK5gp98eT5BpsAikOoalOlgJwlNQ/paio= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708017478; c=relaxed/simple; bh=gv5DE7RXsTmH4yqXPX4t1wYgvuqILt6r3eF0XEGiPNI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AHkPBghjmXYdCP8cRpZZ5z9BdFEbk9qyOJp6uR8HCPK+93P9eyRi469lDdYXxsB1/DhsIQrSkXwnTov73LpnnQfBNI70veE4RBMpb17w61bJUJXOB7Lccn+XB03k/bUWoQZ+nU3WmEJSMX+MpgG4zhr6jLwbayJcDSVXmUhR4uQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GvSPP72q; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-51181d8f52fso1400942e87.3; Thu, 15 Feb 2024 09:17:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708017474; x=1708622274; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LWD6NBu3YiSI1wWq6kinvIvYBM4vO3pv/UsA9bvpgzQ=; b=GvSPP72qNDUfoP1jX15Gj5FDl9IADUxKWYljrXFzxrEyw4wfrAhbB8vlUtQ9nKXZVp PrF1m/x1bx5iaVEDb5u60zhqksBLS/jAgtBT32v4SVA88wdIJf/8HZo3suPjGZf4zju+ B/qRbvueSQmyh9rKarhQTg0dn1gzhaLlNxgyQgDXa81MA6aXMM2WV7O1C9/PklE0tnbK ve0Qglbd/1QqY6wj+yNoym4GjMqoYhrgQYed4CUkkEYOLmNj/RuJvWdJ0+1hw9CzyF3Q O5QvMO9I/IuS6Pgp5E0K4/d1F1HOGBZOM+cHkXkPc7fIBg8+imhbGHOqyqVs59QRIK4y aWFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708017474; x=1708622274; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LWD6NBu3YiSI1wWq6kinvIvYBM4vO3pv/UsA9bvpgzQ=; b=gtIQxG//Ep3mPNERhoFigrgZxuWFWoba3Ayz8r2eH8dWfexi75KJpfkVmDMnl14ZoE L+Bkv1vxgugHuYKwhhKWZzrxO5N08jwvzcs2Cfs9kvWEt/euv+Ck61r3PAFbsX/LK096 k5jHLsNBdruZlwl+UcNrSv0nvwBLVTrFFt0e0MKcskItOo1u5v93rVikZbghT1Yl5eeI XlOf2gM8BaaxgvRH1TVx4ZfeHSIJOi/lW8wunguyr+CqpSi8mWHhsoTGoEIpDmmq87de 4fARE+E/Zcp4h/UbR3tPzjfKVfcSpNq/6oNWwat3pODqfOiOdez+/5J0Ewssq7rvX+CY eqJQ== X-Forwarded-Encrypted: i=1; AJvYcCXfbxnYFRfpwa9yygmiHIATmw8XrKZ/YtwZRiknsY1HQmjDW9tZVbzmlscesBAc9i0n7Z95ZrvYtrHH0uCtzS8CH0hwcrwyTuBcC5c9WRa82TDy6YN6SEQTQJMnHkd920GGb5EaO3JUSvo+CJtbHmXJfRMikVGKnaCpTuVCDSE3+0Oi/BqRYQ== X-Gm-Message-State: AOJu0YwIvXCsdQ+LLY48Rwsif5VXEfDRu3CZX3KnxfGSJ5AEBiDumE4J 3zxSNkbL7X1wTQ49OK2Q+rfTiC6phpdwWcaZylkVjW3wchPS3D2E X-Received: by 2002:ac2:5bc4:0:b0:511:4844:77f2 with SMTP id u4-20020ac25bc4000000b00511484477f2mr1787996lfn.40.1708017474151; Thu, 15 Feb 2024 09:17:54 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id x21-20020ac24895000000b00511570772f1sm309401lfc.303.2024.02.15.09.17.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:17:53 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann , Jiaxun Yang Cc: Serge Semin , Alexey Malahov , Stephen Rothwell , Andrew Morton , linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] mips: cm: Add CM GCR and L2-sync base address getters declarations Date: Thu, 15 Feb 2024 20:17:27 +0300 Message-ID: <20240215171740.14550-3-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240215171740.14550-1-fancer.lancer@gmail.com> References: <20240215171740.14550-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790986176304038266 X-GMAIL-MSGID: 1790986176304038266 Based on the design pattern utilized in the CM GCR and L2-sync base address getters implementation the platform-specific code is capable to re-define the getters and re-use the weakly defined initial versions. But since the re-definition is supposed to be done in another source file the interface methods have been globally defined which in its turn causes the "no previous prototype" warning printed should the re-definition is finally introduced. Since without the global declarations the pattern can be considered as incomplete and causing the warning printed, fix it by providing the respective methods prototype declarations in "arch/mips/include/asm/mips-cm.h". Signed-off-by: Serge Semin --- Note as I mentioned in the previous patch, since the weak implementation of the getters isn't utilized other than as a default implementation of the original methods, we can convert the denoted pattern to a simple __weak attributed methods. Let me know if that would be more preferable. --- arch/mips/include/asm/mips-cm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h index 1f143dfad7a2..6dbe74dc323d 100644 --- a/arch/mips/include/asm/mips-cm.h +++ b/arch/mips/include/asm/mips-cm.h @@ -32,6 +32,7 @@ extern void __iomem *mips_cm_l2sync_base; * name mips_cm_phys_base (without underscores). */ extern phys_addr_t __mips_cm_phys_base(void); +extern phys_addr_t mips_cm_phys_base(void); /** * __mips_cm_l2sync_phys_base - retrieve the physical base address of the CM @@ -46,6 +47,7 @@ extern phys_addr_t __mips_cm_phys_base(void); * underscores). */ extern phys_addr_t __mips_cm_l2sync_phys_base(void); +extern phys_addr_t mips_cm_l2sync_phys_base(void); /* * mips_cm_is64 - determine CM register width From patchwork Thu Feb 15 17:17:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 201663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp549027dyb; Thu, 15 Feb 2024 09:18:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUOOLqhye/mOya4+/VeEtdn+AEDPSWNMPZ/08s/hnysVkTRuIpp6lsKdG+LppOGMs/esTRoOT7pIb/uSxZYW0QoMNmt5A== X-Google-Smtp-Source: AGHT+IH9uHPrUmztpJ+ATwDq/XvKTBvcXQx33Orkw5b6L7uU2k7zszZa7gYLjyTxOtlA4wKZahOa X-Received: by 2002:a17:902:c946:b0:1db:28b4:4475 with SMTP id i6-20020a170902c94600b001db28b44475mr3181349pla.9.1708017538877; Thu, 15 Feb 2024 09:18:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708017538; cv=pass; d=google.com; s=arc-20160816; b=vA26Mz0KrmfKFmJIZjRa+bI+lDD+sLDeOtTyLChJn5bZjbjEelhbeTHcHKNZeMt0v/ 0MwaiIBy5lxBIztLpXY+57MFPGlHx7dDCwbh/Vk1Z+KoOpTc95cyUfs9aM3IJ2jcjlp7 I7vL9VVRBIMu6lLLPSbzFIPaaIJWLWiZdfp0XubipdXWfq1/vnxlu1BcP4TLQZZq5RZt Gn5yLttv0uc1xcy2DYrleMrT8cHMQN06HBaf8F53+59OTzTCXXY6KpJEUslHj2pzGRM1 OFXdpFBAEafNfDoiaxdwo1jB8iiVY4hjaG4casL4XLvLydcPjkUTxnwc4W+UPfFZI93r XMRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=MBvrFBfn8f9ygHbETBGRtk4r0X8Ogb6B9wjwrJRvRzk=; fh=KeDEcR0uCKyMID/ceMPmCX3eqSUU5CAcV593AB5Enog=; b=gxhWO/PWMNtq5WEXAEMHQU8CJzlyXqgauZEiZXWpt8iXvycnjRCZ3KCxp3+QS8IjCm AcrCamOVkxnQAgkx0IohZnMQLxlC1kec8kAL3fxovj7W2PlYDAxwntOh9J2VK901VEcl UCOyXIvmKWUzfhtCQBDl0+PkezzHAlPY5r9LssDdLxtze35Ib9MK/dadZ9BdyBe+Vwsu g9eWIXprlW/rmkfXEytBunyLS0M5+bhPKIbdqVTfNl0E6a94mRMBvEeWDY83Gw4xYgEv +q/5NdFA4mOtZr5gLlxtG+/UK0C1ekJOsk8G5Z37/FYEJGUnGT1lEcXRXANq+Uk/gXpz BPfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LZNZQkbr; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u16-20020a170903125000b001db2d82e7f1si1457643plh.137.2024.02.15.09.18.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:18:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LZNZQkbr; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67389-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B202128BA4E for ; Thu, 15 Feb 2024 17:18:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E11E136982; Thu, 15 Feb 2024 17:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LZNZQkbr" Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8DC313848E; Thu, 15 Feb 2024 17:17:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708017481; cv=none; b=R4RDpq9oeIL5AS0fP1OWVU+XdGIBHVkwQYUdbcrpUBPnljjpdj3RTF1bDfO8LdwnBTS3f3ULi5VD7pV9giB/b3Jnwx9uibDiT322G99OGKkRYyzQyddet/pR5V/QBxZAc5UIFhuvz+anULRuhKWLYWu/IyOtg1zmQe/OnPcsz/s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708017481; c=relaxed/simple; bh=3niBVDG2P9zo7HyZa3mOAK6Iv/Wd2/y/+iNeqLtGf9g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ivDIErb8YQMIe+Er1oR/riwRQKgtyEvcXehuWHWUswGhMDtIb3HM1BztJSZayAEKafBLV1B54WirmZAna+jtyenImyqA3BIBaBVQY+bCfkdV/jC9QtCTL956wSnbUOuJohYREz2oPHTO9biYZTIYqO6Oh91Xan0PrXPz/nwwR60= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LZNZQkbr; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-5118290fcd8so1323199e87.3; Thu, 15 Feb 2024 09:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708017478; x=1708622278; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MBvrFBfn8f9ygHbETBGRtk4r0X8Ogb6B9wjwrJRvRzk=; b=LZNZQkbrB1i8LwT1am5RTu/Ps+KnQDPOLUACX3UkrPXPD9Qu/ttnYPZ0/dWG19yJ/w HjTDNZbFevgWplS9EtKsHQ37PjX1k7AtSuSDTSWOM094K8QLei4af3ka71OGkQYNZbkU VO7UKZcETrkQ/Ez6hxJBUN4pz/9Ev6q0rj86LuZ+C+x0xwavf3zvH+L2puyg5OvlaztM 8uVeMa8GcjGKLbDqK7rftJeXWmmFJybROpMMBTn1sswVkwYgrbRmFj4iq5TosjzRS4Wa pki7SeJru/II2iyjj5tmaRb3FtGiYariu/tkQ0HpWm1yqCGw9QwlYi8kudezHPaNAH17 yHNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708017478; x=1708622278; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MBvrFBfn8f9ygHbETBGRtk4r0X8Ogb6B9wjwrJRvRzk=; b=nx0EAIZ7Psjg6+HcES9uAD6wFVNPKPKd2m138crwXDjWMZd+OWQAiHGusitSNUcvRr qMenPrbbNhNEYD0CCJrQhgfKc4lcjvrMX5dRI74iwP/K2DxHTY+ig20TFalfOZvM/0NF RGh5PE9ypYbBeVQw0pFhWGMm46ZMpauM/FpyZGG4WKnZxrcUkEtTk5bFBZ/v9sJOGDFR L1l0McOwoP2S/frEcSI9Cej1HzAxukdM2IvkvcTOY68z7S/aHnKtqXBFo4fWnKxRJoG7 EQRPEqGcAhkbR+WR6NLn6aYBrf23+UcL3KFkumRwaY1mhbLGw5ipQ0sPn8t//f5tHd7G Hmdw== X-Forwarded-Encrypted: i=1; AJvYcCVEElUU9jbDAJhGRrell0mN9W+Y00F6vmOqXxy+9s3+8z3YAZB07Fn+xAFQyZ2graeoFDe/TZvEpq9ODDq83ixs/+EV9frZsuEMLrFViIIjs/mr0qk3+8v8RQzFW5wAPKTwtKo32R3GwKj3lwQihdxyp90HMBf1c9qoOqXsrhTEufSLHtXWzQ== X-Gm-Message-State: AOJu0YxnLZbLgZ37JTAbKYYgHW7opqiVfxZu/Cje3teO0drk5maugv4u dp9vn/q9jyBFhZTFjxMiJuHMSQjbmspFDvGkQ9GiMFMz3Z9huB9X X-Received: by 2002:a05:6512:1289:b0:512:55c9:6aad with SMTP id u9-20020a056512128900b0051255c96aadmr2145079lfs.10.1708017477781; Thu, 15 Feb 2024 09:17:57 -0800 (PST) Received: from localhost ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id f4-20020ac251a4000000b00511ad5c3487sm309263lfk.276.2024.02.15.09.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 09:17:57 -0800 (PST) From: Serge Semin To: Thomas Bogendoerfer , Greg Kroah-Hartman , Jiri Slaby , Arnd Bergmann , Jiaxun Yang Cc: Serge Semin , Alexey Malahov , Stephen Rothwell , Andrew Morton , linux-mips@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] tty: mips_ejtag_fdc: Fix passing incompatible pointer type warning Date: Thu, 15 Feb 2024 20:17:29 +0300 Message-ID: <20240215171740.14550-5-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240215171740.14550-1-fancer.lancer@gmail.com> References: <20240215171740.14550-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790986198637816319 X-GMAIL-MSGID: 1790986198637816319 mips_ejtag_fdc_encode() method expects having a first argument passed of the "u8 **" type, meanwhile the driver passes the "const char **" type. That causes the next build-warning: drivers/tty/mips_ejtag_fdc.c: In function ‘mips_ejtag_fdc_console_write’: drivers/tty/mips_ejtag_fdc.c:343:32: error: passing argument 1 of ‘mips_ejtag_fdc_encode’ from incompatible pointer type [-Werror=incompatible-pointer-types] word = mips_ejtag_fdc_encode(&buf_ptr, &buf_len, 1); ^ drivers/tty/mips_ejtag_fdc.c:216:24: note: expected ‘const u8 ** {aka const unsigned char **}’ but argument is of type ‘const char **’ static struct fdc_word mips_ejtag_fdc_encode(const u8 **ptrs, ^~~~~~~~~~~~~~~~~~~~~ Fix it by altering the type of the pointer which is passed to the mips_ejtag_fdc_encode() method. Fixes: ce7cbd9a6c81 ("tty: mips_ejtag_fdc: use u8 for character pointers") Signed-off-by: Serge Semin --- drivers/tty/mips_ejtag_fdc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/mips_ejtag_fdc.c b/drivers/tty/mips_ejtag_fdc.c index aac80b69a069..afbf7738c7c4 100644 --- a/drivers/tty/mips_ejtag_fdc.c +++ b/drivers/tty/mips_ejtag_fdc.c @@ -309,7 +309,7 @@ static void mips_ejtag_fdc_console_write(struct console *c, const char *s, unsigned int i, buf_len, cpu; bool done_cr = false; char buf[4]; - const char *buf_ptr = buf; + const u8 *buf_ptr = buf; /* Number of bytes of input data encoded up to each byte in buf */ u8 inc[4];