lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <123046455f123d9964970dd8fcf87f2c0b780fda.camel@redhat.com>
Date: Wed, 21 Jan 2026 14:43:59 +0100
From: Gabriele Monaco <gmonaco@...hat.com>
To: Wander Lairson Costa <wander@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>, Nam Cao <namcao@...utronix.de>, 
 open list <linux-kernel@...r.kernel.org>, "open list:RUNTIME VERIFICATION
 (RV)"	 <linux-trace-kernel@...r.kernel.org>
Subject: Re: [PATCH 09/26] rv/rvgen: replace inline NotImplemented with
 decorator

On Mon, 2026-01-19 at 17:45 -0300, Wander Lairson Costa wrote:
> 
[...]
> +    @not_implemented
> +    def fill_tracepoint_detach_helper(self): ... 
[...] 
> +    @not_implemented
>      def normalize(self):
> -        raise NotImplementedError
> +        ... 

Is there a reason why you didn't collapse it all on the same line here (like you
did above)?

  @not_implemented
  def normalize(self): ...

I see it's probably better to break the line if there is a type annotation
making the line longer. Did you keep it separated because you will add
annotation in a separate patch?

Anyway this is minor and the change is good, thanks.

Reviewed-by: Gabriele Monaco <gmonaco@...hat.com>

> diff --git a/tools/verification/rvgen/rvgen/utils.py
> b/tools/verification/rvgen/rvgen/utils.py
> new file mode 100644
> index 0000000000000..e09c943693edf
> --- /dev/null
> +++ b/tools/verification/rvgen/rvgen/utils.py
> @@ -0,0 +1,36 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +
> +def not_implemented(func):
> +    """
> +    Decorator to mark functions as not yet implemented.
> +
> +    This decorator wraps a function and raises a NotImplementedError when the
> +    function is called, rather than executing the function body. This is
> useful
> +    for defining interface methods or placeholder functions that need to be
> +    implemented later.
> +
> +    Args:
> +        func: The function to be wrapped.
> +
> +    Returns:
> +        A wrapper function that raises NotImplementedError when called.
> +
> +    Raises:
> +        NotImplementedError: Always raised when the decorated function is
> called.
> +            The exception includes the function name and any arguments that
> were
> +            passed to the function.
> +
> +    Example:
> +        @not_implemented
> +        def future_feature(arg1, arg2):
> +            pass
> +
> +        # Calling future_feature will raise:
> +        # NotImplementedError('future_feature', arg1_value, arg2_value)
> +    """
> +    def inner(*args, **kwargs):
> +        raise NotImplementedError(func.__name__, *args, **kwargs)
> +
> +    return inner


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ