Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp613717rdb; Thu, 19 Oct 2023 13:55:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjTdAPHj0Nq/VB42BMgngDJSFYx8WAJjH5ehzr1AjW6p57/062Wa4d3fygOsk72FN8U9Jg X-Received: by 2002:a05:6a21:998e:b0:14c:f16a:2b78 with SMTP id ve14-20020a056a21998e00b0014cf16a2b78mr4161112pzb.45.1697748958756; Thu, 19 Oct 2023 13:55:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697748958; cv=none; d=google.com; s=arc-20160816; b=sD83UOiTioak0hwJZQiGzxdDJ9M+Nku7R3dF/va8O4jM5luWkr5snbdVEmly1lfTvA HcAUEqv6oIl1J3LFb0YTG/NHIvzysAVH+r+kve0wha6oX8TyiebcOBIyteufUAqJ3eCe aopacjDBO3ZOZKbwIf0ubHZ7ZO/tsD+rJybiaCawJF9M4X3nmDCXJv1bVL+e3uPqkv20 ImnAOE7vvktYrWJfI6Q/tOu8qzxnilT/hjzL3tQxdUSHjn1xLK5QQJCkE8+RgJgDmzmK BUCZpP0gtyiOsdyk1vs7rv6Axg1Mypz8iS7bBu7e33pi1byZV0HDq9lwtpi9HD2F2J8R cn6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PbXLmjJs4tDfsTjbZlYEpWsUipeZmvWuN4h1mPUkDJ0=; fh=I8neygvW90mteaepb3EsGPWeBP2Ko6O9PeFKCJ8ssKg=; b=a3kWR4afT+4NSEWQV+o9xHFHvl9HLCFEKbmSWbvBTGpenBaNg2CDvBI3noT/pjzmvO Y47hExH3FZIzDjPZH71ABfoPBcfh+i8IN3C4o8ajEWPS9S5PH5l3X9y2+LCpufcwmMGL ha+qFTr+NwWEMsQkZT4meTLKFZndNi1ysrJOXN3GgSUEuTXJbqfz8nGPRonRPhqlgJmU zZ6WN3mAX4/VqroF2UUp6f0duG+4vxZN4U7XmLE1bxVTy3sF5MAeWf+fuYu0/J9xUga3 Sri2a/53IqLWC1j9lv2lYCGPq5SSA7yOKZF3A9w93TMFvKKB+5avHYwOp+4HopxBzwl2 /oTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZOi7CXqh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id h24-20020a17090aa89800b0027ced9acac0si3050879pjq.2.2023.10.19.13.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 13:55:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZOi7CXqh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5789E83C75B0; Thu, 19 Oct 2023 13:55:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233319AbjJSUzo (ORCPT + 99 others); Thu, 19 Oct 2023 16:55:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232348AbjJSUzn (ORCPT ); Thu, 19 Oct 2023 16:55:43 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A0FAD7 for ; Thu, 19 Oct 2023 13:55:41 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6b7f0170d7bso143383b3a.2 for ; Thu, 19 Oct 2023 13:55:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697748941; x=1698353741; darn=vger.kernel.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=PbXLmjJs4tDfsTjbZlYEpWsUipeZmvWuN4h1mPUkDJ0=; b=ZOi7CXqhJsiv9A5OCuhNTJmx79o2Q/ApOQXzoIsoAdbAVL3Qwu+lK0sOj0WOM8ZFgh xV3GZt0qEQpZ0ZqDpG5zw7xhZbAdCgofF0MPS86WT/4G5M8CGXXDacJCu9KbX1oLRamJ bx3Bs+DciM+voQwx6bCmI6nnxwT/NSt0a/jqGp4u+P12z9kDCjNLSep55qPbcPNe2uSL c9I6mN2NhpR379wvjp2EgCwnSAi3Bk88sYqk0U3eCTMu+k90g2IZcVwBXyP29CcJsoc8 c1Q0MpJnxiSuxMmEyryIVEP26ipKhPZp0RNf6brAiOsbd0E502KPPcxlYg7Wp9ABnuDI e4Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697748941; x=1698353741; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PbXLmjJs4tDfsTjbZlYEpWsUipeZmvWuN4h1mPUkDJ0=; b=dhZkxQjvPWVTWpgn8iuwU5lF9K3oUB+X8OzAHdUmr7OFm+Vn0noZXVCvfevESZjwHS cRnYDv8Q0maIXPzP3xpo4kFPSCFDyltFEiyxOVplF9hD4LEeBwpYfjqLJ2aDwoJOXjYc kdSaJ7um/8FAekKP7TaewUiwYIdmhs+hjUFZEkHD/J0ngcWUVLNQQ/NMb0nPPaKLrI5c 6WagNyydIH8Vrtf+9F4UTLBEF7zEu47RuObK+FIeXBP0klaagOSpW8pWgt3iSgsRWm2R UgIUt9yG7+P9oSuhvkklqPbDlHjzCw9uZK/r4ShMTQFdXwqoFYNMOa69IJyrOI3v8l7E GWBQ== X-Gm-Message-State: AOJu0Yx1lCapGEixgn/5SRl5Im3SSDi02nbZCXAO3ugGLSzQqg/j/NzW sYeXRzKv7hqwSffEo0FXW4I= X-Received: by 2002:a05:6a20:7486:b0:17a:fa76:805f with SMTP id p6-20020a056a20748600b0017afa76805fmr3692636pzd.23.1697748940668; Thu, 19 Oct 2023 13:55:40 -0700 (PDT) Received: from Negi ([68.181.16.134]) by smtp.gmail.com with ESMTPSA id l18-20020a17090aec1200b0027dc2af3a17sm1974326pjy.27.2023.10.19.13.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 13:55:40 -0700 (PDT) Date: Thu, 19 Oct 2023 13:55:39 -0700 From: Soumya Negi To: Greg Kroah-Hartman Cc: Martyn Welch , Manohar Vanga , outreachy@lists.linux.dev, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH 1/2] staging: vme_user: Replace printk() with pr_*(),dev_*() Message-ID: <20231019205539.GA3017@Negi> References: <2023101823-unhidden-draw-d68c@gregkh> <20231018193855.GA32553@Negi> <2023101925-kudos-playful-7c5a@gregkh> <20231019190618.GA29750@Negi> <2023101941-poncho-disagree-8c77@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2023101941-poncho-disagree-8c77@gregkh> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 19 Oct 2023 13:55:55 -0700 (PDT) On Thu, Oct 19, 2023 at 09:42:26PM +0200, Greg Kroah-Hartman wrote: > On Thu, Oct 19, 2023 at 12:06:18PM -0700, Soumya Negi wrote: > > On Thu, Oct 19, 2023 at 05:34:01PM +0200, Greg Kroah-Hartman wrote: > > > On Wed, Oct 18, 2023 at 12:38:56PM -0700, Soumya Negi wrote: > > > > Hi Greg, > > > > > > > > On Wed, Oct 18, 2023 at 03:26:07PM +0200, Greg Kroah-Hartman wrote: > > > > > On Tue, Oct 17, 2023 at 09:36:32PM -0700, Soumya Negi wrote: > > > > > > vme.c uses printk() to log messages. To improve and standardize message > > > > > > formatting, use logging mechanisms pr_err()/pr_warn() and > > > > > > dev_err()/dev_warn() instead. Retain the printk log levels of the > > > > > > messages during replacement. > > > > > > > > > > > > Issue found by checkpatch.pl > > > > > > > > > > > > Signed-off-by: Soumya Negi > > > > > > --- > > > > > > drivers/staging/vme_user/vme.c | 175 ++++++++++++++++++--------------- > > > > > > 1 file changed, 94 insertions(+), 81 deletions(-) > > > > > > > > > > > > diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c > > > > > > index 6519a7c994a0..e8c2c1e77b7d 100644 > > > > > > --- a/drivers/staging/vme_user/vme.c > > > > > > +++ b/drivers/staging/vme_user/vme.c > > > > > > @@ -9,6 +9,8 @@ > > > > > > * Copyright 2004 Motorola Inc. > > > > > > */ > > > > > > > > > > > > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > > > > > > > > > > No, this is a driver, as others have pointed out, always use dev_*() > > > > > calls instead. > > > > > > > > Some of the pr_ fns can be dev_, but I don't think all can. > > > > e.g. device NULL-check error messages > > > > > > I would argue that those are pointless and can be removed and also the > > > check is probably not needed either. > > > > Got it. The pr_() in find_bridge() can't be converted to dev_ so I'll remove > > the message entirely in another patch. > > > > I understand that the device-NULL checks should be done on the caller's side. > > Since empty devices would mean something went wrong, would it be better to > > put in an assertion(..WARN_ON) when removing the check? > > WARN_ON() means "I have no idea what can happen here so I give up", > which is not a good idea in kernel development. If that every hits, > then your machine will reboot as the huge majority of all Linux systems > in the world run with panic-on-warn enabled. > > If it is impossible for something to happen (i.e. you control all > callers) then just do not check for it. If it happens, you will get a > NULL-dereference which is the same as a WARN_ON() in a way. > > No new WARN_ON() should ever be added to the kernel, especially in a > driver. Handle the condition if it is possible to be hit. If it can > never be hit, don't even check it. > > thanks, > > greg k-h Hi Greg, Thank you for explaining in detail. I'll remove the device NULL-checks completely. Regards, Soumya